/* REL sign-in and error pages: magic-link verify, expired link, /login, 404, 500.

   Served as a static file from the portal host and LINKED, never inlined: the portal CSP is
   style-src 'self' and font-src 'self' with no 'unsafe-inline' (no <style>, no style=).

   The real tracker API renders /auth/magic/verify (it reaches members through the portal proxy).
   Its HTML must link /auth.css and use the same markup as the mock (portal/mock/handler.ts).
   The class names and structure are the contract in portal/README.md ("Sign-in page markup").

   Self-contained on purpose (no @import): colours mirror site/src/styles/tokens.css. */

@font-face {
  font-family: 'Jost Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('/fonts/jost-latin-wght-normal.woff2') format('woff2-variations');
}
@font-face {
  font-family: 'Inter Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('/fonts/inter-latin-wght-normal.woff2') format('woff2-variations');
}

:root {
  --a-bg: #000;
  --a-ink: #eef1ec;
  --a-muted: #9aa39c;
  --a-green: #9dff3a;
  --a-blue: #3fc8ff;
  --a-purple: #b07bff;
  --a-line: rgb(255 255 255 / 0.12);
  --a-glass: rgb(255 255 255 / 0.045);
  --a-display: 'Jost Variable', 'Jost', 'Futura', 'Century Gothic', system-ui, sans-serif;
  --a-text: 'Inter Variable', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--a-bg); color: var(--a-ink); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--a-text);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  /* The three brand rings as soft light behind the card. */
  background:
    radial-gradient(28rem 22rem at 12% 8%, rgb(63 200 255 / 0.16), transparent 70%),
    radial-gradient(30rem 24rem at 50% 105%, rgb(157 255 58 / 0.13), transparent 70%),
    radial-gradient(26rem 22rem at 92% 30%, rgb(176 123 255 / 0.15), transparent 70%),
    var(--a-bg);
}

/* Page: centres one card, phone first. */
.auth {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 2rem 1.25rem 3rem;
}

.auth-card {
  width: 100%;
  max-width: 26rem;
  display: grid;
  gap: 1.25rem;
  justify-items: center;
  text-align: center;
  padding: 2.25rem 1.5rem 2rem;
  border: 1px solid var(--a-line);
  border-radius: 1.25rem;
  background: var(--a-glass);
  box-shadow: 0 1.5rem 4rem rgb(0 0 0 / 0.6);
}

.auth-mark { display: block; width: 11.5rem; max-width: 70%; height: auto; margin-bottom: 0.25rem; }

.auth h1,
.auth-title {
  margin: 0;
  font-family: var(--a-display);
  font-weight: 400;
  font-size: clamp(1.75rem, 1.4rem + 1.6vw, 2.25rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.auth p,
.auth-copy { margin: 0; color: var(--a-muted); max-width: 30ch; text-wrap: pretty; }

.auth form { display: grid; gap: 1rem; width: 100%; margin: 0.25rem 0 0; text-align: left; }

/* Buttons: the bare <button> in a form, or a link styled .auth-btn. 56px tall, full width. */
.auth button,
.auth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 3.5rem;
  padding: 0.9rem 1.5rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--a-green);
  color: #000;
  font-family: var(--a-display);
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 0 0.75rem rgb(157 255 58 / 0.35), 0 0 2.5rem rgb(157 255 58 / 0.15);
  transition: box-shadow 0.25s ease, transform 0.1s ease;
}
.auth button:hover,
.auth-btn:hover { box-shadow: 0 0 0.75rem rgb(157 255 58 / 0.6), 0 0 2.5rem rgb(157 255 58 / 0.3); }
.auth button:active,
.auth-btn:active { transform: scale(0.98); }

/* Secondary way forward, still a full 48px tap target. */
.auth-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.5rem 1rem;
  color: var(--a-blue);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.auth button:focus-visible,
.auth-btn:focus-visible,
.auth-link:focus-visible,
.auth input:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

/* Form fields (/login). 16px+ text so iOS does not zoom on focus. */
.auth label { font-weight: 600; color: var(--a-ink); }
.auth input[type='email'] {
  width: 100%;
  min-height: 3.25rem;
  padding: 0.75rem 1rem;
  border: 1px solid rgb(255 255 255 / 0.25);
  border-radius: 0.75rem;
  background: rgb(0 0 0 / 0.55);
  color: var(--a-ink);
  font: inherit;
  font-size: 1.0625rem;
}
.auth input[type='email']:focus { border-color: var(--a-green); }
.auth .field { display: grid; gap: 0.4rem; }
.auth .cf-turnstile { min-height: 65px; }

.auth-foot { margin: 0; font-size: 0.9375rem; color: var(--a-muted); }

@media (prefers-reduced-motion: reduce) {
  .auth button, .auth-btn { transition: none; }
  .auth button:active, .auth-btn:active { transform: none; }
}

.nowrap { white-space: nowrap; }

/* Narrow phones: the Turnstile widget is a fixed 300px, so trim side padding until it fits at 360px+,
   and scale it down below that. Page never scrolls sideways. */
@media (max-width: 25rem) {
  .auth { padding-left: 0.5rem; padding-right: 0.5rem; }
  .auth-card { padding-left: 0.75rem; padding-right: 0.75rem; }
}
@media (max-width: 22.5rem) {
  .auth .cf-turnstile { width: 300px; transform: scale(0.84); transform-origin: left top; margin-right: -48px; min-height: 55px; }
}
html, body { overflow-x: clip; }
