/* Client portal — "Engineered Stability" theme (same tokens as the main site's rebrand).
   No glow, no glass, no shadows, no motion beyond a colour change. */
@font-face { font-family: "Newsreader"; src: url("/static/fonts/Newsreader-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Public Sans"; src: url("/static/fonts/PublicSans-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Public Sans"; src: url("/static/fonts/PublicSans-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

:root {
  --navy: #0A2540; --surface: #F9F8F6; --panel: #FFFFFF; --ink: #1A1A1A; --ash: #5B5B57;
  --label: #6E6E67; --hairline: #E4E1DA; --tint: #D7E0EA; --muted: #8FA3BC; --edge: #8A877E;
  --err-ink: #7A1B18; --err-bg: #FBEDEC; --err-edge: #A12622;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Public Sans", -apple-system, "Segoe UI", Arial, sans-serif;
}
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body { min-height: 100dvh; font-family: var(--sans); font-size: 16px; line-height: 1.5; color: var(--ink); background: var(--surface); -webkit-font-smoothing: antialiased; }
a { color: var(--navy); }
:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── buttons ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border: 1px solid var(--navy); border-radius: 6px; background: var(--navy); color: #fff; font: 700 15px/1 var(--sans); text-decoration: none; cursor: pointer; transition: background-color .15s, color .15s; }
.btn:hover { background: #12365C; }
.btn[disabled] { opacity: .65; cursor: progress; }
.btn.ghost { background: transparent; color: var(--navy); }
.btn.ghost:hover { background: var(--tint); }
.btn.sm { min-height: 40px; padding: 0 16px; font-size: 14px; }

/* ── sign-in ── */
.auth { display: grid; grid-template-columns: minmax(340px, 42%) 1fr; min-height: 100dvh; }
.auth-brand { background: var(--navy); color: #fff; padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; }
.auth-brand .logo { display: block; width: 190px; height: auto; }
.auth-brand h1 { font: 400 clamp(32px, 3.6vw, 44px)/1.15 var(--serif); letter-spacing: -.01em; margin-bottom: 18px; }
.auth-brand p { color: var(--tint); max-width: 34ch; }
.auth-brand .foot { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.auth-brand .foot a { color: var(--tint); text-decoration: none; }
.auth-brand .foot a:hover { text-decoration: underline; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.card { width: 100%; max-width: 420px; background: var(--panel); border: 1px solid var(--hairline); border-radius: 10px; padding: 36px 32px; }
.card h2 { font: 400 28px/1.2 var(--serif); margin-bottom: 6px; }
.card .lede { color: var(--ash); font-size: 14.5px; margin-bottom: 26px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; color: var(--ink); }
.input-wrap { position: relative; }
.field input { width: 100%; height: 48px; padding: 0 14px; border: 1px solid var(--edge); border-radius: 6px; background: #fff; color: var(--ink); font: 400 16px/1 var(--sans); }
.field input::placeholder { color: var(--label); }
.field input:focus-visible { outline: 2px solid var(--navy); outline-offset: 1px; border-color: var(--navy); }
.field .toggle { position: absolute; right: 4px; top: 4px; height: 40px; padding: 0 12px; border: 0; background: transparent; color: var(--navy); font: 700 13px/1 var(--sans); cursor: pointer; border-radius: 4px; }
.field .toggle:hover { background: var(--tint); }
.field input.has-toggle { padding-right: 72px; }
.alert { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 18px; padding: 12px 14px; background: var(--err-bg); color: var(--err-ink); border-left: 3px solid var(--err-edge); border-radius: 4px; font-size: 14px; }
.alert svg { flex: none; margin-top: 2px; }
.card .btn { width: 100%; }
.card .help { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--hairline); font-size: 14px; color: var(--ash); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ── dashboard ── */
.topbar { background: var(--navy); color: #fff; }
.topbar-in { max-width: 1040px; margin: 0 auto; padding: 14px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.topbar .logo { height: 34px; width: auto; display: block; }
.topbar-right { display: flex; align-items: center; gap: 16px; font-size: 14px; }
.client-badge { color: var(--tint); }
.signout { color: #fff; text-decoration: none; border: 1px solid var(--muted); border-radius: 6px; padding: 8px 14px; min-height: 40px; display: inline-flex; align-items: center; font-weight: 700; font-size: 14px; }
.signout:hover { background: #12365C; }
.page { max-width: 1040px; margin: 0 auto; padding: 48px 24px 64px; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--label); margin-bottom: 10px; }
.welcome h1 { font: 400 clamp(30px, 4vw, 42px)/1.15 var(--serif); letter-spacing: -.01em; margin-bottom: 8px; }
.welcome p { color: var(--ash); }
.welcome { margin-bottom: 40px; }
.section-label { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--label); margin: 0 0 14px; padding-bottom: 10px; border-bottom: 1px solid var(--hairline); }
.group { margin-bottom: 40px; }
.apps-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.app-card { display: flex; flex-direction: column; gap: 14px; padding: 22px; background: var(--panel); border: 1px solid var(--hairline); border-radius: 10px; text-decoration: none; color: inherit; min-height: 188px; transition: border-color .15s; }
a.app-card:hover { border-color: var(--navy); }
.app-card.disabled { opacity: .65; }
.app-icon { width: 44px; height: 44px; border-radius: 8px; background: var(--tint); color: var(--navy); display: grid; place-items: center; }
.app-name { font: 700 16px/1.3 var(--sans); margin-bottom: 4px; }
.app-desc { color: var(--ash); font-size: 14px; }
.app-body { flex: 1; }
.app-cta { color: var(--navy); font-weight: 700; font-size: 14px; }
.status-bar { display: flex; align-items: center; gap: 10px; color: var(--ash); font-size: 13px; margin-top: 32px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #2E7D4F; }
.status-dot.down { background: #B7791F; }

@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .auth-brand { padding: 22px 24px; gap: 0; }
  .auth-brand .hero, .auth-brand .foot { display: none; }
  .auth-brand .logo { width: 150px; }
  .auth-main { align-items: flex-start; padding: 28px 16px 40px; }
  .card { padding: 28px 20px; border-radius: 8px; }
  .topbar-in { padding: 12px 16px; }
  .client-badge { display: none; }
  .page { padding: 32px 16px 48px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
