/*
  Auth pages (register / login / verify-code / account) — WBS 2.4, 2.5,
  2.6. Split layout matching layout/High school portal redesign/
  University Application Guide Portal v3.dc.html's isRegister/isLogin screens. Reuses the
  existing design tokens only (app/static/css/tokens.css) — no new
  colors, no raw hex/oklch values.

  A new, auth-only stylesheet rather than additions to base.css /
  components.css / marketing.css: those are CLAUDE.md S3's frozen,
  shared "design tokens" contract, out of this stream's lane while
  another stream works in the same shared directory. Every rule below
  is scoped under .auth-* classes used only by app/templates/auth/*.

  Every one of this app's other templates styles exclusively through
  classes, never inline style="" attributes — confirmed empirically
  this session against the live dev server: the Content Security
  Policy's style-src ('self' https://fonts.googleapis.com, no
  'unsafe-inline', no nonce) silently drops inline style attributes in
  the browser, so an inline style would render un-styled. Followed here
  throughout for exactly that reason.
*/

.auth-split {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  align-items: stretch;
  min-height: 74vh;
}
.auth-split__form { padding: 64px 64px 80px; max-width: 620px; justify-self: end; width: 100%; }
.auth-split__form h1 { font-size: 2.5rem; line-height: 1.08; margin: 14px 0 0; }
.auth-split__form > .lead { margin-top: 12px; }
.auth-split__form > .eyebrow--role { display: block; margin-top: 32px; }

.auth-split__aside { padding: 64px; display: flex; flex-direction: column; justify-content: center; }
.auth-split__aside > div { max-width: 30em; }
.auth-split__aside h2 { font-size: 1.875rem; line-height: 1.3; margin: 16px 0 0; }
.auth-split__aside-list { display: flex; flex-direction: column; gap: 18px; margin-top: 32px; }
.auth-split__aside-item { border-top: 1px solid var(--border-soft); padding-top: 16px; }
.auth-split__aside-item h3 { font-family: var(--font-sans); font-size: 1.03125rem; font-weight: 600; margin: 0 0 6px; }
.auth-split__aside-item p { font-size: var(--text-small); line-height: 1.6; margin: 0; }

.auth-split__aside--dark { background: var(--brand); color: var(--on-ink); }
.auth-split__aside--dark h2 { color: var(--on-ink); }
.auth-split__aside--dark .auth-split__aside-item { border-top-color: var(--brand-soft); }
.auth-split__aside--dark .auth-split__aside-item h3 { color: var(--on-ink); }
.auth-split__aside--dark .auth-split__aside-item p { color: var(--on-ink-muted); }
.auth-split__aside--dark .eyebrow { color: var(--brand-tint); }

.auth-split__aside--light { background: var(--bg-band); border-left: 1px solid var(--border-soft); color: var(--ink); }
.auth-split__aside--light .auth-split__aside-item p { color: var(--ink-muted); }

/* Role picker (CSS-only, no JavaScript: two radios, :has() toggles the
   matching panel — degrades gracefully to "both panels visible" on a
   browser old enough not to support :has(), never to "broken"). */
.auth-role-picker { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
/* Each radio+label pair gets its own position:relative wrapper so the
   hidden radio's position:absolute is scoped to that one pair, not to
   the picker's shared ancestor - without this, every hidden radio in
   the group collapses to the same physical point (the container's
   origin), which is invisible to a mouse click on the visible label
   (label[for] activation is id-based, not spatial) but breaks any
   direct interaction with the <input> itself, confirmed by a real
   Playwright test hitting "wrong sibling input intercepts pointer
   events" when clicking the input directly instead of its label. */
.auth-role-picker__item { position: relative; }
.auth-role-picker input[type="radio"] { position: absolute; opacity: 0; width: 1px; height: 1px; }
.auth-role-picker label { display: block; cursor: pointer; background: var(--surface); border-radius: var(--radius-md); padding: 16px 18px; border: 2px solid var(--border); }
.auth-role-picker input:checked + label { border-color: var(--accent-strong); }
.auth-role-picker input:focus-visible + label { outline: 2px solid var(--accent-strong); outline-offset: 2px; }
.auth-role-picker__title { font-size: 1rem; font-weight: 600; }
.auth-role-picker__desc { font-size: var(--text-micro); line-height: 1.5; color: var(--ink-muted); margin-top: 4px; }

.auth-student-fields { display: none; margin-top: 20px; }
.auth-role-section:has(#auth-role-student:checked) .auth-student-fields { display: block; }
.auth-role-section:has(#auth-role-student:checked) .auth-guardian-fields { display: none; }
/* CR-045: picker hidden (hand-off / buy paths) — the role is decided
   server-side and expressed as a class, never an inline style (CSP). */
.auth-role-section--guardian .auth-student-fields { display: none; }
.auth-role-section--guardian .auth-guardian-fields { display: block; }
.auth-role-section--student .auth-student-fields { display: block; }
.auth-role-section--student .auth-guardian-fields { display: none; }

/* Form fields */
.auth-form-field { display: flex; flex-direction: column; gap: 7px; margin-top: 16px; }
.auth-form-field:first-child { margin-top: 0; }
.auth-form-field label { font-size: var(--text-small); font-weight: 600; }
.auth-form-field .hint { font-family: var(--font-mono); font-size: 0.71875rem; color: var(--ink-soft); }
/* CR-060: the Google sign-in button and the divider under it. Drawn
   here rather than loaded from Google, so no asset of theirs is
   fetched by a page children use. */
.auth-google { display: flex; align-items: center; justify-content: center; gap: 10px; height: 48px; background: var(--surface); color: var(--ink); border: 1.5px solid var(--border-strong); font-weight: 700; text-decoration: none; }
.auth-google:hover, .auth-google:focus-visible { border-color: var(--ink); color: var(--ink); }
.auth-google__mark { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; background: var(--ink); color: var(--surface); font-weight: 800; font-size: 14px; }
.auth-google__note { margin: 8px 0 0; font-size: 13px; line-height: 1.5; color: var(--ink-soft); text-align: center; }
.auth-or { display: flex; align-items: center; gap: 12px; margin: 18px 0 6px; color: var(--ink-soft); font-size: 13px; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
/* CR-057: the authenticator code is optional per account. */
.auth-optional { font-weight: 400; color: var(--ink-soft); }
.auth-form-field input[type="text"],
.auth-form-field input[type="email"],
.auth-form-field input[type="password"],
.auth-form-field input[type="date"],
.auth-form-field select {
  font-family: var(--font-sans); font-size: var(--text-body-lg);
  padding: 12px 14px; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); background: var(--surface); color: var(--ink);
}
.auth-form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.auth-form-row .auth-form-field { margin-top: 0; }

.auth-consent { display: flex; align-items: flex-start; gap: 11px; margin-top: 22px; font-size: var(--text-small); line-height: 1.55; color: var(--ink-2); cursor: pointer; }
.auth-consent input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--accent); flex: none; }
.auth-submit { margin-top: 24px; }
.auth-price-note { margin: 10px 0 0; font-size: var(--text-small); color: var(--ink-muted); text-align: center; }

/* Tabs (real navigation, ?tab=code / ?tab=staff — no JavaScript) */
.auth-tabs { display: flex; gap: 6px; margin-top: 32px; border-bottom: 1px solid var(--border); }
.auth-tabs a { font-family: var(--font-sans); font-size: var(--text-small); font-weight: 600; color: var(--ink-2); padding: 10px 14px; margin-bottom: -1px; border-bottom: 2px solid transparent; }
.auth-tabs a:hover { color: var(--accent-strong); }
.auth-tabs a.is-active { color: var(--ink); border-bottom-color: var(--accent); }
.auth-tab-panel { margin-top: 28px; }

.auth-field-note { margin-top: 22px; border-left: 3px solid var(--accent); background: var(--bg-band); padding: 16px 20px; border-radius: 0 var(--radius-md) var(--radius-md) 0; }

/* Errors */
.auth-errors { margin-top: 20px; border-left: 3px solid var(--bad); background: oklch(0.96 0.02 30); padding: 14px 18px; border-radius: 0 var(--radius-md) var(--radius-md) 0; }
.auth-errors ul { margin: 0; padding-left: 18px; }
.auth-errors li { font-size: var(--text-small); line-height: 1.6; color: oklch(0.30 0.05 30); }

.auth-success { margin-top: 20px; border-left: 3px solid var(--good); background: oklch(0.96 0.03 155); padding: 14px 18px; border-radius: 0 var(--radius-md) var(--radius-md) 0; }
.auth-success p { font-size: var(--text-small); line-height: 1.6; color: oklch(0.28 0.07 155); margin: 0; }

.auth-switch { display: flex; align-items: center; gap: 8px; margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--border-soft); font-size: var(--text-small); color: var(--ink-muted); }
.auth-switch a.link-btn { font-family: var(--font-sans); font-size: var(--text-small); font-weight: 600; color: var(--target); }
.auth-switch a.link-btn:hover { color: var(--accent-strong); }

/* Verify-code step */
.auth-code-card { max-width: 460px; margin: 0 auto; padding: var(--space-8) 40px; }
.auth-code-input { font-family: var(--font-mono); font-size: 1.75rem; letter-spacing: 0.35em; text-align: center; padding: 16px; width: 100%; }

/* Minimal account / staff-stub pages */
.auth-page-narrow { max-width: 560px; margin: 0 auto; padding: var(--space-7) 40px; }
.auth-student-list { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.auth-student-list li { border: 1px solid var(--border-soft); background: var(--bg-band); border-radius: var(--radius-md); padding: 12px 16px; }
.auth-student-list__actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

/* CR-038: college pills on the register page when entering from the
   hand-off card. Neutral style — no band colour here because the
   visitor hasn't seen the bands again on this page. */
.register-pills { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0 0 var(--space-3); }
.register-pill { font-size: 13px; font-weight: 600; padding: 3px 10px; border-radius: 99px; border: 1.5px solid var(--likely-border); background: var(--likely-bg); color: var(--likely); }

@media (max-width: 900px) {
  .auth-split { grid-template-columns: 1fr; }
  .auth-split__form { justify-self: stretch; max-width: none; padding: 40px 24px; }
  .auth-split__aside { padding: 40px 24px; }
  .auth-form-row, .auth-role-picker { grid-template-columns: 1fr; }
}

/* ===============================================================
   CR-073 — the page a visitor lands on after verifying their email.

   It was a headline, a grey paragraph and a bare green bar, which
   read like an error page at the one moment the visitor had just
   done the thing we wanted. It is now a card with a green
   confirmation edge, the colleges as chips, three numbered steps and
   one thumb-sized button. Phone first: this traffic arrives from
   Instagram on a phone.
   =============================================================== */
.kept { max-width: 720px; }
.kept__card {
  background: var(--surface); border: 2px solid var(--likely-border);
  border-top: 6px solid var(--likely); border-radius: var(--radius-lg);
  padding: 26px 28px 24px; box-shadow: var(--shadow-panel);
}
.kept__eyebrow {
  font-family: var(--font-sans); font-size: 12px; font-weight: 800; letter-spacing: .14em;
  text-transform: uppercase; color: var(--likely); margin: 0 0 6px;
}
.kept__h1 { font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2.1rem); line-height: 1.12; margin: 0 0 16px; color: var(--ink); }
.kept__lead { font-size: 15px; line-height: 1.55; color: var(--ink-muted); margin: 0 0 18px; max-width: 46em; }

.kept__pills { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0 0 20px; }
.kept__pill {
  font-family: var(--font-sans); font-size: 12.5px; font-weight: 700; padding: 6px 12px;
  border-radius: 99px; border: 1.5px solid var(--likely-border); background: var(--likely-bg); color: var(--likely);
}

.kept__steps { list-style: none; padding: 0; margin: 0 0 22px; display: grid; gap: 12px; }
.kept__steps li { display: flex; align-items: flex-start; gap: 12px; font-size: 14.5px; line-height: 1.5; color: var(--ink-muted); }
.kept__steps strong { color: var(--ink); }
.kept__step-n {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%; background: var(--likely); color: #fff;
  font-family: var(--font-sans); font-weight: 800; font-size: 13px;
}

.kept__cta {
  display: flex; align-items: center; justify-content: center; width: 100%;
  height: 56px; background: var(--likely); color: #fff; border: none; border-radius: var(--radius);
  font-family: var(--font-sans); font-size: 16.5px; font-weight: 800; text-decoration: none;
  box-shadow: 0 2px 0 rgb(2 122 72 / .35);
}
.kept__cta:hover, .kept__cta:focus-visible { color: #fff; filter: brightness(1.08); }
.kept__alt { margin: 14px 0 0; text-align: center; font-size: 13.5px; }
.kept__alt a { color: var(--ink-muted); }

@media (max-width: 640px) {
  .kept__card { padding: 20px 16px 18px; border-radius: var(--radius); }
  .kept__h1 { font-size: 1.4rem; }
  .kept__pill { font-size: 11.5px; padding: 5px 10px; }
  .kept__steps li { font-size: 13.5px; gap: 10px; }
  .kept__cta { height: 52px; font-size: 15.5px; }
}

/* CR-075: the signed-in account pages on a phone. The narrow card had
   40px of side padding on a 390px screen, which left less room for an
   input than the input asked for, and the page scrolled sideways. */
@media (max-width: 760px) {
  .auth-page-narrow { padding: 20px 16px 28px; max-width: none; }
  .auth-code-card { padding: 22px 16px; max-width: none; }
  .auth-split__form { padding: 24px 16px 32px; }
  .auth-form-row, .auth-role-picker { grid-template-columns: 1fr; gap: 12px; }
  .auth-form-field { margin-top: 14px; }
  .auth-submit { width: 100%; }
  .auth-kept .btn, .auth-page-narrow .btn { width: 100%; }
  .auth-tabs { gap: 4px; }
  .auth-tabs a { font-size: 13px; padding: 10px 8px; }
}
