/* Legal and error pages. Same tokens, type, top bar and buttons as the homepage (templates/public/landing.html). */
:root {
  --bg: #F3F5FA;          /* paper */
  --main: #F7F8FC;        /* app main area */
  --sidebar: #E9EDF7;
  --card: #EEF1F8;
  --surface: #FFFFFF;
  --fg: #0B1433;          /* ink */
  --ink: #0B1433;
  --ink-soft: #1C2A55;
  --on-ink: #F7F8FC;
  --muted: #4C5673;
  --line: #D7DCE8;
  --brass: #2340FF;
  --brass-soft: #E6EAFF;
  --brass-line: #C3CCFF;
  --blue: #2340FF;        /* bold panels kept from v1 */
  --on-blue: #F4F6FF;
  --blue-soft: #C9D1FF;
  --signal: #FF5B37;
  --on-signal: #1A0703;
  --mint: #AFC0FF;
  --on-mint: #0B1433;
  --st-progress-bg: #F8EDBE; --st-progress-fg: #7D5F0E;
  --st-new-bg: #E6E9F1;      --st-new-fg: #4C5673;
  --st-rej-bg: #F7DAD3;      --st-rej-fg: #A63A27;
  --due: #B3261E;
  --ok: #2E7D4F;
  --display: "Big Shoulders Display", "Arial Narrow", "Roboto Condensed", sans-serif;
  --body: "Inter", "Helvetica Neue", Arial, sans-serif;
  --mono: "Inter", "Helvetica Neue", Arial, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
  --r: 28px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0A0F22; --main: #0E1530; --sidebar: #18213F; --card: #121A36; --surface: #16203F;
    --fg: #E9ECF5; --ink: #E9ECF5; --ink-soft: #D3D8E6; --on-ink: #0B1433; --muted: #A4ADC6; --line: #27314F;
    --brass: #8C9BFF; --brass-soft: #1D2654; --brass-line: #34418A;
    --blue: #3D57FF; --on-blue: #F4F6FF; --blue-soft: #2A3BA8;
    --signal: #FF6A48; --on-signal: #1A0703; --mint: #A9B8FF; --on-mint: #0A0F22;
    --st-progress-bg: #3A3216; --st-progress-fg: #E8CB6A; --st-new-bg: #222B48; --st-new-fg: #B3BACB;
    --st-rej-bg: #3D211B; --st-rej-fg: #F29A86; --due: #FF8A7A; --ok: #6FD39A;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0A0F22; --main: #0E1530; --sidebar: #18213F; --card: #121A36; --surface: #16203F;
  --fg: #E9ECF5; --ink: #E9ECF5; --ink-soft: #D3D8E6; --on-ink: #0B1433; --muted: #A4ADC6; --line: #27314F;
  --brass: #8C9BFF; --brass-soft: #1D2654; --brass-line: #34418A;
  --blue: #3D57FF; --on-blue: #F4F6FF; --blue-soft: #2A3BA8;
  --signal: #FF6A48; --on-signal: #1A0703; --mint: #A9B8FF; --on-mint: #0A0F22;
  --st-progress-bg: #3A3216; --st-progress-fg: #E8CB6A; --st-new-bg: #222B48; --st-new-fg: #B3BACB;
  --st-rej-bg: #3D211B; --st-rej-fg: #F29A86; --due: #FF8A7A; --ok: #6FD39A;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { background: var(--bg); color: var(--fg); font: 400 16.5px/1.55 var(--body); -webkit-font-smoothing: antialiased; }
::selection { background: var(--brass-soft); color: var(--ink); }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; border-radius: 6px; }
.wrap { max-width: 1280px; margin-inline: auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
@media (min-width: 720px) { .wrap { padding-left: max(32px, env(safe-area-inset-left, 0px)); padding-right: max(32px, env(safe-area-inset-right, 0px)); } }
body { margin: 0; }
/* Nav */
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: #0B1433; }
.nav { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 9; background: var(--bg); border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent); color: var(--fg); }
.nav .wrap { display: flex; align-items: center; gap: 24px; padding-block: 14px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--display); font-weight: 800; font-size: 1.7rem; letter-spacing: .01em; text-transform: lowercase; line-height: 1; }
.brand svg { width: 32px; height: 32px; flex: none; }
.nav ul { display: flex; gap: 22px; list-style: none; margin: 0 0 0 12px; padding: 0; font-size: .92rem; font-weight: 500; }
.nav ul a { text-decoration: none; color: var(--muted); }
.nav ul a:hover { color: var(--fg); }
.nav a:focus-visible { outline-color: var(--brass); }
.nav .spacer { flex: 1; }
.nav ul.nav-tail { margin-left: 0; }
.nav-cta { display: flex; gap: 8px; align-items: center; }
.btn.btn-ghost { background: transparent; color: var(--fg); border: 0; padding: 0 14px; }
.btn.btn-ghost:hover { background: transparent; color: var(--fg); text-decoration: underline; text-underline-offset: 4px; }
.btn.btn-outline { background: transparent; color: var(--fg); border: 1px solid var(--fg); }
.btn.btn-outline:hover { background: var(--brass-soft); }
.btn.btn-lg { height: 52px; padding: 0 26px; font-size: 1rem; }
@media (max-width: 420px) { .brand-text { display: none; } }
@media (max-width: 480px) { .nav .btn { height: 38px; padding: 0 14px; font-size: .88rem; } .brand { font-size: 1.4rem; } .nav .wrap { gap: 12px; } }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 20px; border-radius: 999px; border: 0; font: 600 .95rem/1 var(--body); cursor: pointer; text-decoration: none; white-space: nowrap; transition: transform .25s cubic-bezier(.16,1,.3,1), background-color .2s; }
.btn:active { transform: scale(.97); }
.btn-dark { background: var(--ink); color: var(--on-ink); }
.btn-dark:hover { background: var(--ink-soft); }
.btn-brass { background: #2340FF; color: #FFFFFF; }
.btn.btn-cream { background: #2340FF; color: #FFFFFF; }
.btn.btn-cream:hover { background: #3D57FF; box-shadow: 0 0 0 2px #C9D1FF; }
.btn-brass:hover { background: #1A2FD0; }
@media (max-width: 860px) { .nav ul { display: none; } }

/* Skip link */
.skip-link { position: absolute; left: 16px; top: -60px; z-index: 40; padding: 10px 14px; background: var(--ink); color: var(--on-ink); border-radius: 8px; font-weight: 600; text-decoration: none; }
.skip-link:focus { top: 12px; }

/* Legal pages */
.legal-page { width: min(75ch, 100%); margin: 0 auto; padding: clamp(32px, 6vw, 64px) 16px 32px; }
@media (min-width: 720px) { .legal-page { padding-inline: 32px; } }
.legal-back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 12px; padding-block: 12px; color: var(--muted); font-size: .92rem; font-weight: 500; text-decoration: none; }
.legal-back svg { width: 16px; height: 16px; flex: none; }
.legal-back:hover { color: var(--fg); text-decoration: underline; }
.legal-page h1, .legal-body h1 { margin: 0 0 20px; font-family: var(--display); font-weight: 800; text-transform: uppercase; font-size: clamp(2.6rem, 7vw, 4.4rem); line-height: .9; letter-spacing: -0.005em; text-wrap: balance; }
.legal-body h2 { margin: 44px 0 12px; font-size: 1.3rem; line-height: 1.3; font-weight: 700; letter-spacing: -0.01em; scroll-margin-top: 88px; }
.legal-body h3 { margin: 28px 0 8px; font-size: 1.05rem; line-height: 1.4; font-weight: 650; scroll-margin-top: 88px; }
.legal-body p, .legal-body li { color: var(--muted); }
.legal-body p, .legal-body li, .legal-body h1, .legal-body h2, .legal-body h3 { overflow-wrap: break-word; }
.legal-body strong { color: var(--fg); font-weight: 650; }
.legal-body a { color: var(--fg); text-decoration: underline; text-decoration-color: var(--brass); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.legal-body a:hover { text-decoration-thickness: 2px; }
.legal-body ul { margin: 0; padding-left: 1.25rem; }
.legal-body li { margin: 8px 0; }
.legal-body li::marker { color: var(--brass); }
.legal-body code { font-size: .88em; }
.legal-table { overflow-x: auto; max-width: 100%; margin: 16px 0 24px; border: 1px solid var(--line); border-radius: 12px; }
.legal-table:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
.legal-body table { border-collapse: collapse; width: 100%; min-width: 520px; font-size: .9rem; line-height: 1.45; }
.legal-body th, .legal-body td { border-bottom: 1px solid var(--line); padding: 10px 12px; text-align: left; vertical-align: top; }
.legal-body tr:last-child td { border-bottom: 0; }
.legal-body th { background: var(--card); color: var(--fg); font-weight: 650; }
.legal-body td { color: var(--muted); }

/* Frosted top bar: the page scrolls behind it and stays faintly visible */
.nav { background: color-mix(in srgb, var(--bg) 72%, transparent); -webkit-backdrop-filter: saturate(1.6) blur(16px); backdrop-filter: saturate(1.6) blur(16px); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .nav { background: var(--bg); } }
