body { margin: 0; background: #F4F6F8; color: #15202B; font: 16px/1.6 Inter, system-ui, sans-serif; }
main { max-width: 720px; margin: 0 auto; padding: 32px 16px 48px; }
h1 { font-size: 26px; line-height: 1.25; }
h2 { font-size: 18px; margin-top: 28px; }
a { color: #174EA6; }
/* Sign-in pages: /auth/login (app/static/login.html), the refusal pages (app/routes_identity.py auth_page), and the
   recovery-link page. Same tokens as app/static/app.css; light/dark follow the device. CSP: no inline styles. The tokens
   also give /privacy and /terms a dark mode. */
:root {
  --bg: #EEF2F6; --surface: #FFFFFF; --surface-2: #F4F6F8; --ink: #15202B; --muted: #56626E;
  --line: #D3DAE1; --input-line: #8894A0; --accent: #174EA6; --on-accent: #FFFFFF; --pick: #DDE6F5;
  --urgent: #B3261E; --plate: #FFFFFF; --shadow: rgba(21, 32, 43, .10); color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0F151B; --surface: #161E26; --surface-2: #1B242D; --ink: #E6EBF0; --muted: #97A3AF;
    --line: #26313C; --input-line: #4A5865; --accent: #8DB4FF; --on-accent: #0F151B; --pick: #22324A;
    --urgent: #FF9A90; --shadow: rgba(0, 0, 0, .45);
  }
}
body { background: var(--bg); color: var(--ink); }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

body.auth { font: 15px/1.5 Inter, system-ui, sans-serif; min-height: 100vh; }
body.auth main { max-width: 420px; box-sizing: border-box; padding: 56px 16px 40px; }
.auth h1, .auth h2 { font-family: 'Space Grotesk', Inter, system-ui, sans-serif; font-weight: 600; }
.auth h1 { font-size: 24px; margin: 0 0 18px; }
.auth h2 { font-size: 16px; margin: 0 0 10px; }
.auth-brand { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 20px;
  font-family: 'Space Grotesk', Inter, system-ui, sans-serif; font-weight: 600; font-size: 17px; }
.auth-brand img { border-radius: 8px; flex: none; }
.auth-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 28px 24px;
  box-shadow: 0 1px 3px var(--shadow); }
.auth-card > p { margin: 0 0 16px; overflow-wrap: anywhere; }
.auth-card > :last-child { margin-bottom: 0; }
.auth-btn { display: flex; align-items: center; justify-content: center; gap: 10px; box-sizing: border-box; width: 100%;
  min-height: 44px; padding: 10px 16px; border-radius: 8px; border: 1px solid var(--accent); font: inherit;
  font-weight: 600; text-decoration: none; cursor: pointer; text-align: center; }
.auth-btn-primary { background: var(--accent); color: var(--on-accent); }
.auth-btn-primary:hover { filter: brightness(1.08); }
.auth-btn-secondary { background: var(--surface); color: var(--accent); }
.auth-btn-secondary:hover { background: var(--pick); }
.auth-btn .g-logo { background: #FFFFFF; border-radius: 50%; padding: 4px; box-sizing: content-box; flex: none; }
.auth-card > .auth-or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; margin: 22px 0; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.login-form label { display: block; font-weight: 500; margin-bottom: 6px; }
.login-form input { display: block; width: 100%; box-sizing: border-box; min-height: 44px; padding: 9px 12px;
  border: 1px solid var(--input-line); border-radius: 8px; font: inherit; background: var(--surface); color: var(--ink); }
.login-form input::placeholder { color: var(--muted); opacity: 1; }
.login-form input:user-invalid { border-color: var(--urgent); box-shadow: 0 0 0 1px var(--urgent); }
.field-hint { font-size: 13px; color: var(--muted); margin: 6px 0 14px; }
.field-error { display: none; font-size: 13px; font-weight: 500; color: var(--urgent); margin: 6px 0 0; }
.login-form input:user-invalid ~ .field-error { display: block; }
.other-ways { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 14px; }
.other-ways summary { display: flex; align-items: center; justify-content: space-between; min-height: 44px; padding: 8px 4px;
  cursor: pointer; font-weight: 600; color: var(--accent); list-style: none; border-radius: 8px; }
.other-ways summary::-webkit-details-marker { display: none; }
.other-ways summary::after { content: ""; width: 8px; height: 8px; margin-right: 6px; border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor; transform: translateY(-3px) rotate(45deg); transition: transform .15s; }
.other-ways[open] summary::after { transform: translateY(3px) rotate(-135deg); }
.other-body { display: flex; flex-direction: column; gap: 14px; padding-top: 8px; }
.other-item h2 { margin-bottom: 10px; }
.other-item .login-form { margin: 0; }
.auth-btn-disabled { justify-content: space-between; background: var(--surface-2); color: var(--muted); border-color: var(--line); cursor: not-allowed; }
.soon-tag { font-size: 13px; font-weight: 500; color: var(--muted); }
.auth-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
.auth-actions form { margin: 0; }
.auth-note, .auth-foot { font-size: 13px; color: var(--muted); text-align: center; margin: 16px 8px 0; }
.auth-foot a { color: var(--muted); }
@media (max-width: 480px) {
  body.auth main { padding-top: 32px; }
  .auth-card { padding: 22px 18px; }
}

/* Branded sign-in landing (host-login.html) and the handoff line (login.html). A custom brand turns on through
   data-brand (host-login.js); the server's /brand/brand.css supplies the variables. Buttons, links and the focus ring only. */
html[data-brand] { --accent: var(--brand-primary, currentColor); --on-accent: var(--brand-on-primary, currentColor); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.auth-brand .auth-logo { max-height: 44px; max-width: 240px; width: auto; height: auto; box-sizing: content-box; padding: 4px 10px; border-radius: 8px; background: var(--plate); object-fit: contain; }
.auth-brand .auth-logo[hidden] { display: none; }
html[data-brand] .auth-card { border-top: 4px solid var(--brand-accent, currentColor); }
.auth-handoff { margin: -6px 0 16px; padding: 8px 12px; text-align: center; font-size: 14px; font-weight: 500; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); overflow-wrap: anywhere; }
.auth-handoff[hidden] { display: none; }
.wordmark { font-family: 'Space Grotesk', Inter, system-ui, sans-serif; font-weight: 600; letter-spacing: -0.02em; }
.auth-brand .wordmark { font-size: 30px; }
.auth-tag { text-align: center; color: var(--muted, #5b6670); font-size: 14px; line-height: 1.45; margin: -8px 0 18px; }
body.auth main { padding-top: 32px; }
.auth-cta { text-align: center; margin: 0 0 18px; }
.auth-cta .auth-btn { display: inline-block; min-width: 200px; }
body.auth main { padding-top: 24px; }
.auth-brand { margin-bottom: 12px; }

/* Legal pages (/privacy, /terms, /subprocessors) */
main.legal ul, main.legal ol { padding-left: 22px; }
main.legal li { margin: 6px 0; }
.table-wrap { overflow-x: auto; }
main.legal table { border-collapse: collapse; width: 100%; font-size: 14px; }
main.legal th, main.legal td { text-align: left; vertical-align: top; padding: 8px 10px; border: 1px solid var(--line); }
main.legal th { background: var(--surface-2); }
.legal-foot { margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
@media (max-width: 480px) { main.legal table { font-size: 13px; } main.legal th, main.legal td { padding: 6px 5px; overflow-wrap: break-word; } }
