/*
  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; }

/* 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); }
.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; }

/* 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; }

@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; }
}
