@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("https://bluevale.uk/fonts/geist/geist-98bbbccb.woff2") format("woff2");
}

:root {
  color-scheme: light;
  --navy: #101927;
  --navy-hover: #1b293b;
  --paper: #ffffff;
  --surface: #f6f7f8;
  --surface-2: #eceff1;
  --cream: #e8e2c7;
  --text: #101927;
  --muted: #5d6875;
  --line: rgba(16, 25, 39, .15);
  --line-strong: rgba(16, 25, 39, .27);
  --danger: #913d46;
  --success: #235944;
  --warning: #64562f;
  font-family: "Geist", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 300px; background: var(--surface); }
body { min-height: 100vh; margin: 0; display: flex; flex-direction: column; background: var(--surface); color: var(--text); }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
h1, h2, h3, .portal-summary strong { font-family: "Roboto Slab", Georgia, serif; }
:focus-visible { outline: 2px solid var(--cream); outline-offset: 3px; }

header {
  min-height: 76px;
  padding: 0 clamp(20px, 5vw, 72px);
  border-bottom: 1px solid rgba(232, 226, 199, .42);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: var(--navy);
  color: var(--paper);
}
.portal-wordmark { display: flex; align-items: center; gap: 11px; font-size: 13px; font-weight: 750; letter-spacing: .11em; }
.portal-wordmark img { width: 34px; height: 34px; object-fit: contain; }
.portal-wordmark span { display: flex; flex-direction: column; }
.portal-wordmark small { margin-top: 3px; color: #aeb6c0; font-size: 10px; font-weight: 500; letter-spacing: .05em; text-transform: none; }
header > a:not(.portal-wordmark), header button { border: 0; padding: 10px 0; background: transparent; color: #d2d7dd; cursor: pointer; font-size: 12px; }
header > a:not(.portal-wordmark):hover, header button:hover { color: var(--paper); }

main { width: min(1180px, calc(100% - 40px)); min-height: calc(100vh - 152px); margin: 0 auto; padding: 64px 0 88px; flex: 1; }
.auth-card { width: min(100%, 580px); margin: 7vh auto 0; border: 1px solid var(--line-strong); border-radius: 2px; padding: clamp(30px, 6vw, 58px); background: var(--paper); }
.auth-card .icon { width: 48px; height: 48px; margin-bottom: 28px; display: grid; place-items: center; background: var(--navy); color: var(--cream); font-size: 18px; }
.kicker { margin: 0 0 16px; color: var(--muted); font-size: 11px; font-weight: 750; letter-spacing: .08em; }
.auth-card h1, .portal-head h1 { margin: 0 0 18px; font-size: clamp(38px, 6vw, 58px); font-weight: 600; line-height: 1.02; letter-spacing: -.035em; }
.auth-card > p:not(.kicker), .portal-head > div > p:last-child { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.7; }
.auth-card form { margin-top: 34px; display: flex; flex-direction: column; gap: 16px; }
.auth-card label { display: flex; flex-direction: column; gap: 8px; color: var(--muted); font-size: 11px; font-weight: 750; letter-spacing: .06em; }
.auth-card input { min-height: 50px; border: 1px solid var(--line-strong); border-radius: 2px; padding: 12px 14px; outline: 0; background: var(--paper); color: var(--text); }
.auth-card input:focus { border-color: var(--navy); box-shadow: 0 0 0 2px var(--cream); }
.auth-card button, .portal-button { min-height: 48px; border: 1px solid var(--navy); border-radius: 2px; padding: 12px 16px; display: inline-flex; align-items: center; justify-content: space-between; gap: 24px; background: var(--navy); color: var(--paper); cursor: pointer; font-size: 13px; font-weight: 750; }
.auth-card button:hover, .portal-button:hover { background: var(--navy-hover); }
.portal-button { margin-top: 30px; }
.portal-button.secondary { border-color: var(--line-strong); background: var(--paper); color: var(--navy); }
.auth-card > small { margin-top: 17px; display: block; color: var(--muted); font-size: 11px; line-height: 1.5; }

.portal-head { margin-bottom: 38px; display: flex; align-items: flex-end; justify-content: space-between; gap: 36px; }
.portal-head > div:first-child { max-width: 700px; }
.contact-chip { min-width: 260px; border-left: 3px solid var(--cream); padding: 12px 0 12px 18px; display: flex; flex-direction: column; gap: 4px; }
.contact-chip small { color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: .07em; }
.contact-chip b { font-size: 13px; }
.contact-chip span { color: var(--muted); font-size: 12px; }
.portal-summary { margin-bottom: 22px; border: 1px solid var(--line-strong); display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line-strong); }
.portal-summary > div { min-height: 142px; padding: 21px; display: flex; flex-direction: column; background: var(--paper); }
.portal-summary small { color: var(--muted); font-size: 11px; font-weight: 750; letter-spacing: .07em; }
.portal-summary strong { margin: auto 0 3px; font-size: 44px; font-weight: 600; line-height: 1; }
.portal-summary span { color: var(--muted); font-size: 12px; }
.portal-panel { margin-bottom: 22px; border: 1px solid var(--line-strong); border-radius: 2px; overflow: hidden; background: var(--paper); }
.panel-heading { min-height: 78px; border-bottom: 1px solid var(--line); padding: 18px 22px; display: flex; align-items: center; justify-content: space-between; }
.panel-heading h2 { margin: 0 0 5px; font-size: 20px; font-weight: 600; }
.panel-heading p { margin: 0; color: var(--muted); font-size: 12px; }
.invoice-list article { border-bottom: 1px solid var(--line); padding: 18px 22px; display: grid; grid-template-columns: 90px minmax(170px, 1fr) 120px auto; gap: 20px; align-items: center; }
.invoice-list article:last-child { border-bottom: 0; }
.invoice-list article > div:nth-child(2) { display: flex; flex-direction: column; gap: 5px; }
.invoice-list b { font-size: 13px; }
.invoice-list small { color: var(--muted); font-size: 11px; }
.invoice-list article > strong { font-family: "Roboto Slab", Georgia, serif; font-size: 17px; }
.invoice-actions { display: flex; gap: 8px; }
.invoice-actions a { border: 1px solid var(--line-strong); border-radius: 2px; padding: 9px 11px; font-size: 11px; font-weight: 700; }
.invoice-actions a.pay { border-color: var(--navy); background: var(--navy); color: var(--paper); }
.portal-status { width: max-content; border: 1px solid var(--line-strong); border-radius: 2px; padding: 5px 8px; background: var(--surface-2); color: var(--navy); font-size: 10px; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; }
.portal-status.paid, .portal-status.active { border-color: #a8c2b7; background: #e9f1ed; color: var(--success); }
.portal-status.overdue { border-color: #d3b2b6; background: #f6eeee; color: var(--danger); }
.portal-status.open, .portal-status.part_paid, .portal-status.paused { border-color: #d4c99f; background: #f5f1df; color: var(--warning); }
.portal-empty { padding: 64px 22px; text-align: center; }
.portal-empty > span { width: 44px; height: 44px; margin: auto; display: grid; place-items: center; background: var(--navy); color: var(--cream); }
.portal-empty h3 { margin: 18px 0 7px; font-size: 20px; font-weight: 600; }
.portal-empty p { max-width: 560px; margin: 0 auto; color: var(--muted); font-size: 12px; line-height: 1.6; }
.portal-empty.compact { padding: 48px 22px; }
.retainer-list article { border-bottom: 1px solid var(--line); padding: 24px 22px; display: flex; align-items: center; justify-content: space-between; gap: 30px; }
.retainer-list article:last-child { border-bottom: 0; }
.retainer-list h3 { margin: 14px 0 7px; font-size: 19px; font-weight: 600; }
.retainer-list p { max-width: 720px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.retainer-list article > strong { font-family: "Roboto Slab", Georgia, serif; font-size: 22px; white-space: nowrap; }
.retainer-list article > strong small { display: block; color: var(--muted); font-family: "Geist", sans-serif; font-size: 10px; font-weight: 500; text-align: right; }

footer { min-height: 76px; border-top: 1px solid rgba(232, 226, 199, .32); padding: 0 clamp(20px, 5vw, 72px); display: flex; align-items: center; justify-content: space-between; gap: 18px; background: var(--navy); color: #b9c0c8; font-size: 11px; }
footer a { border-bottom: 1px solid var(--cream); color: var(--paper); }

@media (max-width: 760px) {
  header { min-height: 70px; padding: 0 16px; }
  .portal-wordmark { gap: 8px; font-size: 12px; }
  .portal-wordmark img { width: 30px; height: 30px; }
  main { width: min(100% - 28px, 1180px); padding: 42px 0 66px; }
  .auth-card { margin-top: 2vh; padding: 30px 24px; }
  .portal-head { display: block; }
  .contact-chip { margin-top: 24px; }
  .portal-summary { grid-template-columns: 1fr; }
  .portal-summary > div { min-height: 118px; }
  .invoice-list article { grid-template-columns: 80px 1fr; gap: 12px; }
  .invoice-list article > strong { text-align: right; }
  .invoice-actions { grid-column: 1 / -1; }
  .invoice-actions a { flex: 1; text-align: center; }
  .retainer-list article { align-items: flex-start; flex-direction: column; }
  .retainer-list article > strong small { text-align: left; }
}

@media (max-width: 420px) {
  .portal-wordmark small { display: none; }
  header > a:not(.portal-wordmark) { font-size: 10px; }
  .auth-card h1, .portal-head h1 { font-size: 38px; }
  .invoice-list article { grid-template-columns: 1fr; }
  .invoice-list article > strong { text-align: left; }
  .invoice-actions { grid-column: auto; flex-direction: column; }
  footer span:first-child { display: none; }
}
