/*
 * wb-login-restyle-a.css — T523: the /login and /signup pages ("the front
 * door for signed-out users, including the auth-gate redirect target
 * /login?next=/v2/buddy") never received the T483 restyle-A treatment and
 * still shipped the pre-rebuild dark-hero + brass-accent look. This sheet is
 * that surface's OWN restyle round.
 *
 * Gated by the SAME flag as every other restyle-A surface
 * (auth.resolve_restyle_a — allow-list, the wb_restyle_a cookie, or
 * ?restyle=a on /login or /signup, both of which also set the cookie — see
 * welcome_page.py's `_login_page_html`/`_signup_page_html` and app.py's
 * `login_page`/`signup_page` routes).
 *
 * APPEARANCE ONLY. Every selector below already exists in the shipped DOM
 * (welcome_page.py's `_auth_shell_css`, `_auth_welcome_panel`,
 * `_login_page_html`, `_signup_page_html`); nothing here adds, removes,
 * reorders or rewords a field, button or link, and no id/name used by the
 * page's own auth JS is touched. The inline `_AUTH_SHELL_CSS` stays linked
 * first, unedited (it also carries the pinned `button.apple{...display:
 * none...}` native-gating test contract) — this file is linked AFTER it, so
 * it wins the cascade.
 *
 * Tokens/values are the SAME r2 palette as the account, catalogue and bottle
 * rounds (sprint-state/ui-rebuild/TOKENS.md) — nothing here invents a colour.
 * One divergence from the flattened-everything-onto-greys pattern those
 * rounds use: Google's and Apple's own sign-in buttons keep their brand-
 * mandated fill colours (white/black) — those are platform brand-guideline
 * assets, not a second in-house accent, so the one-accent rule does not
 * reach them; only their border/radius are brought in line with the token
 * shape scale.
 */

:root {
  --r2l-paper:   #FBF9F6;
  --r2l-surface: #FBF9F6;
  --r2l-sunk:    var(--sk-q-sunk);
  --r2l-ink:     var(--sk-q-dark);
  --r2l-ink-2:   #5C5651;
  --r2l-hair:    var(--sk-q-hair-2);
  --r2l-hair-2:  #CFC9C0;
  --r2l-accent:  var(--sk-deep-accent);
  --r2l-accent-ink: #FFFFFF;
  --r2l-focus:   var(--sk-q-dark);

  --r2l-display: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --r2l-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
              "Liberation Sans", Helvetica, Arial, sans-serif;

  /* The dark hero (.greet) is a permanent brand treatment, independent of
     the OS colour scheme, exactly as it ships today — only its accent and
     paper are re-pointed onto the token sheet's own dark values, so it no
     longer carries a hardcoded hex outside the sheet. */
  --r2l-hero-paper: #14120F;
  --r2l-hero-ink: #F3EFE9;
  --r2l-hero-ink-2: #B4ADA4;
  --r2l-hero-accent: #E5A25C;
}

@media (prefers-color-scheme: dark) {
  :root {
    --r2l-paper:   #14120F;
    --r2l-surface: #1C1916;
    --r2l-sunk:    #211D19;
    --r2l-ink:     #F3EFE9;
    --r2l-ink-2:   #B4ADA4;
    --r2l-hair:    #2E2A25;
    --r2l-hair-2:  #423C35;
    --r2l-accent:  #E5A25C;
    --r2l-accent-ink: #1A1409;
    --r2l-focus:   #F3EFE9;
  }
}

html:not(#_) body {
  background: var(--r2l-paper) !important;
  color: var(--r2l-ink) !important;
  font-family: var(--r2l-body) !important;
}
html:not(#_) body * {
  box-shadow: none !important;
  text-shadow: none !important;
}
html:not(#_) a:focus-visible,
html:not(#_) button:focus-visible,
html:not(#_) input:focus-visible {
  outline: 2px solid var(--r2l-focus) !important;
  outline-offset: 2px !important;
  border-radius: 6px !important;
}

/* ── The gate (sign-in / sign-up form) ────────────────────────────────── */
html:not(#_) .gate { background: var(--r2l-paper) !important; }
/* /forgot's `.card` is its OWN bordered box with a hardcoded dark-brown
   fill (#241a11), a direct child of <body> — unlike /login's/.signup's
   `.card`, which is nested inside `.gate` and is only a width wrapper with
   no fill of its own, so the page background alone carries it there.
   Without this, the `.card h1`/`.note`/`.err` overrides below paint
   dark-ink text onto that still-dark box in light mode: readable in dark
   mode (where the box happens to already read dark), invisible in light
   mode. Scoped to `body > .card` so it reaches ONLY /forgot's card, not
   /login's or /signup's nested one — those are already verified correct
   and must not change. Neutralising the fill onto the same surface token
   used everywhere else brings /forgot in line with the login round's card
   treatment in both modes. */
html:not(#_) body > .card {
  background: var(--r2l-surface) !important;
  border: 1px solid var(--r2l-hair) !important;
}
html:not(#_) .card h1 {
  font-family: var(--r2l-display) !important;
  color: var(--r2l-ink) !important;
  font-weight: 700 !important;
}
html:not(#_) .card .note { color: var(--r2l-ink-2) !important; }
html:not(#_) label { color: var(--r2l-ink-2) !important; }
html:not(#_) input {
  background: var(--r2l-sunk) !important;
  border: 1px solid var(--r2l-hair) !important;
  border-radius: 6px !important;
  color: var(--r2l-ink) !important;
}
html:not(#_) input:focus {
  outline: 2px solid var(--r2l-focus) !important;
  outline-offset: 1px !important;
  border-color: var(--r2l-hair-2) !important;
}
/* One accent means money/a deal, and this page has neither — the primary
   submit button flattens onto ink/paper like every other non-money control
   the account, catalogue and bottle rounds restyle. */
html:not(#_) button[type="submit"] {
  background: var(--r2l-ink) !important;
  color: var(--r2l-paper) !important;
  border-radius: 6px !important;
  box-shadow: none !important;
}
html:not(#_) button.pk {
  background: transparent !important;
  border: 1px solid var(--r2l-hair) !important;
  color: var(--r2l-ink) !important;
  border-radius: 6px !important;
}
html:not(#_) button.pk:hover { border-color: var(--r2l-hair-2) !important; }
/* Google's and Apple's own sign-in buttons keep their brand-mandated fill —
   only the corner radius/border move onto the shape scale. */
html:not(#_) button.google {
  border: 1px solid var(--r2l-hair) !important;
  border-radius: 6px !important;
  box-shadow: none !important;
}
html:not(#_) button.google:hover { background: var(--r2l-sunk) !important; }
html:not(#_) button.apple { border-radius: 6px !important; }
html:not(#_) .divider { color: var(--r2l-ink-2) !important; }
/* No green for good / red for bad — errors and confirmations read as plain
   ink sentences, matching the account round's treatment of save messages. */
html:not(#_) .err,
html:not(#_) .ok { color: var(--r2l-ink) !important; }
html:not(#_) .alt { color: var(--r2l-ink-2) !important; }
html:not(#_) .alt a,
html:not(#_) .card p a {
  color: var(--r2l-ink) !important;
  font-weight: 500 !important;
  text-decoration: underline !important;
}
html:not(#_) .freeline { color: var(--r2l-ink-2) !important; }

/* ── The welcome hero (.greet — the dark benefits panel) ──────────────── */
html:not(#_) .greet {
  background: var(--r2l-hero-paper) !important;
  color: var(--r2l-hero-ink) !important;
}
html:not(#_) .back { color: var(--r2l-hero-ink-2) !important; }
html:not(#_) .back:hover { color: var(--r2l-hero-ink) !important; }
html:not(#_) .wb-word,
html:not(#_) .wb-word .wb-w,
html:not(#_) .wb-word .wb-b {
  font-family: var(--r2l-display) !important;
  color: var(--r2l-hero-ink) !important;
}
html:not(#_) .wb-word .wb-ai { color: var(--r2l-hero-ink-2) !important; }
html:not(#_) .greet-eyebrow { color: var(--r2l-hero-ink-2) !important; }
html:not(#_) .greet h1 {
  font-family: var(--r2l-display) !important;
  color: var(--r2l-hero-ink) !important;
  font-weight: 700 !important;
}
html:not(#_) .greet h1 em {
  font-style: normal !important;
  color: var(--r2l-hero-accent) !important;
}
html:not(#_) .ctx-chip {
  background: rgba(255,255,255,.06) !important;
  border: 1px solid rgba(255,255,255,.14) !important;
  color: var(--r2l-hero-ink) !important;
}
html:not(#_) .ctx-chip b { color: var(--r2l-hero-accent) !important; }
html:not(#_) .perk svg {
  stroke: var(--r2l-hero-ink) !important;
  stroke-width: 1.5 !important;
}
html:not(#_) .perk b { color: var(--r2l-hero-ink) !important; }
html:not(#_) .perk span { color: var(--r2l-hero-ink-2) !important; }
html:not(#_) .greet-foot { color: var(--r2l-hero-ink-2) !important; }

/* Option B card (9 Nov 2026): the blanket no-shadow rule above would flatten
   the floating auth card; this one shadow is the only exception. */
html:not(#_) .gate input { background: var(--r2l-surface) !important; border-radius: 10px !important; }
html:not(#_) .gate .card { background: none !important; border: 0 !important; }
html:not(#_) .gate button { border-radius: 10px !important; }
html:not(#_) .door { box-shadow: 0 30px 80px rgba(0,0,0,.55) !important; }
html:not(#_) .back { color: #e6e1d6 !important; }
html:not(#_) .back:hover { color: #fff !important; }
html:not(#_) .greet-line { color: var(--r2l-hero-ink) !important; }
