/* The auth server's sign-in pages (BEL-54). Every page shares Pages/Shared/_Layout.cshtml, so this is the
   whole look. The tokens come from tokens.css next to this file (a byte copy of packages/ui's, held
   identical by dev-tools/test/shared-copies.test.mjs); the approved result is
   docs/design/auth/login.html, whose ".a" rules these mirror. The only colours here are var(--...).
   packages/ui/src/styles/authStylesheet.test.ts pins the rules that matter. */

/* Inks derived from the tokens, copied from packages/ui/src/styles/app.css (tokens.css does not carry them). */
:root{--on-accent:oklch(99% 0 0);--accent-ink:oklch(46% 0.16 255);--crit-ink:oklch(45% 0.17 25);--ok-ink:oklch(43% 0.11 155)}
@media (prefers-color-scheme: dark){
  :root{--on-accent:oklch(16% 0.02 262);--accent-ink:oklch(82% 0.11 255);--crit-ink:oklch(86% 0.09 25);--ok-ink:oklch(85% 0.09 155)}
}

*,*::before,*::after{box-sizing:border-box}
body{margin:0;font-family:var(--font-ui);font-size:14px;line-height:1.45;color:var(--ink);background:var(--bg)}
:focus-visible{outline:2.5px solid var(--accent);outline-offset:2px;border-radius:7px}

/* The page and the card. */
.auth-page{position:relative;min-height:100dvh;display:grid;place-items:center;padding:var(--space-6)}
.auth-page::before{content:"";position:absolute;inset:0;pointer-events:none;background:radial-gradient(1000px 460px at 50% -14%,var(--accent-soft),transparent 70%)}
.auth-card{position:relative;width:min(400px,100%);background:var(--panel);border:1px solid var(--line);border-radius:16px;box-shadow:var(--shadow);padding:var(--space-8) var(--space-6) var(--space-6)}

/* Brand, headings, text. */
.brand{display:flex;justify-content:center;margin-bottom:var(--space-5)}
.brand img{display:block;height:44px;width:auto}
h1{font-size:var(--text-xl);font-weight:600;letter-spacing:-.01em;text-align:center;margin:0 0 4px}
.subtitle{text-align:center;color:var(--ink-2);font-size:var(--text-sm);margin:0 0 var(--space-6)}
a{color:var(--accent-ink)}
.foot a,a.link{color:var(--accent-ink);font-weight:600;text-decoration:none}
.hint{text-align:center;margin:var(--space-4) 0 0;font-size:var(--text-sm)}
/* The help line under the form (Login). */
.foot{margin:var(--space-5) 0 0;padding-top:var(--space-4);border-top:1px solid var(--line);text-align:center;font-size:var(--text-xs);color:var(--ink-2)}

/* Fields: a .field owns the label-to-input and field-to-field spacing. */
.field{display:flex;flex-direction:column;gap:6px;margin-bottom:var(--space-3)}
label{display:block;font-size:var(--text-sm);font-weight:600}
input[type=email],input[type=password],input[type=text]{display:block;width:100%;height:42px;padding:0 12px;font:inherit;font-size:var(--text-md);color:var(--ink);background:var(--panel);border:1px solid var(--line);border-radius:var(--r-md)}
input.input-validation-error{border-color:var(--crit)}

/* The primary action: the submit button, and a link styled as one (.btn stays a centred flex box with no underline). */
button[type=submit],.btn{display:flex;align-items:center;justify-content:center;width:100%;height:42px;margin-top:var(--space-2);padding:0 var(--space-4);font:inherit;font-weight:600;text-decoration:none;cursor:pointer;color:var(--on-accent);background:var(--accent);border:1px solid var(--accent);border-radius:9px;transition:background-color var(--dur-fast) var(--ease-out),border-color var(--dur-fast) var(--ease-out)}
button[type=submit]:hover,.btn:hover{background:var(--accent-hover);border-color:var(--accent-hover)}

/* The error notice: the console's crit notice. The "!" is drawn here, not in the markup, so the alert's text is exactly the message. */
.err{display:grid;grid-template-columns:20px 1fr;gap:10px;align-items:start;margin:0 0 var(--space-4);padding:10px 12px;font-size:var(--text-sm);color:var(--crit-ink);background:var(--crit-soft);border-radius:var(--r-md)}
.err-ic{width:20px;height:20px;border-radius:50%;background:var(--crit);color:var(--panel);display:grid;place-items:center;font-weight:700;font-size:12px}
.err-ic::before{content:"!"}

/* The state icon above the heading on the invalid-link and password-changed pages. */
.state-ic{width:44px;height:44px;margin:0 auto var(--space-4);border-radius:50%;display:grid;place-items:center}
.state-ic-crit{background:var(--crit-soft);color:var(--crit-ink)}
.state-ic-ok{background:var(--ok-soft);color:var(--ok-ink)}

/* Phones: the card sits near the top so the keyboard does not cover the button. */
@media (max-width:480px){
  .auth-page{place-items:start center;padding:48px 16px 16px}
  .auth-card{padding:24px 18px 18px;border-radius:14px}
}

/* Touch targets. */
@media (pointer:coarse){
  input[type=email],input[type=password],input[type=text],button[type=submit],.btn{height:44px}
}

@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{transition:none!important;animation:none!important}
}
