/* Authentication is a separate surface; app panels keep their shared styles. */
body.public-page { background: linear-gradient(135deg, var(--canvas), var(--cofer-sand)); }
.auth-page, .auth-page * { box-sizing: border-box; }
.auth-page { min-height: calc(100vh - var(--app-safe-top, 0px)); min-height: calc(100dvh - var(--app-safe-top, 0px)); padding: 24px; display: flex; flex-direction: column; }
.auth-shell { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); width: 100%; max-width: 1380px; flex: 1; margin: 0 auto; border: 1px solid var(--line); border-radius: 24px; background: var(--surface); box-shadow: 0 10px 40px #0a2b5b08; }
.auth-mobile-brand { display: none; }
.auth-welcome { display: flex; flex-direction: column; min-width: 0; padding: 40px clamp(30px, 4vw, 64px) 30px; border-radius: 23px 0 0 23px; background: radial-gradient(ellipse at 90% 0, #ff8a0014, transparent 60%), var(--navy-gradient); color: var(--on-dark); }
.auth-welcome .brand-logo { width: 232px; }
.auth-welcome-copy { width: 100%; max-width: 440px; margin: auto; padding: 44px 0; }
.auth-welcome h1 { margin: 0 0 20px; font-size: clamp(36px, 4.1vw, 58px); line-height: 1.12; letter-spacing: -1.9px; font-weight: 650; color: var(--on-dark); }
.auth-welcome-copy > p { margin: 0; color: var(--muted-on-dark); font-size: 15px; line-height: 1.8; }
.auth-welcome-footer { margin: 0; color: var(--muted-on-dark); font-size: 12px; }
.auth-archive { margin-top: 42px; padding: 20px 18px 8px; border: 1px solid #ffd7b03d; border-radius: 18px; background: linear-gradient(145deg, #fff3e10e, #fff3e104); box-shadow: 0 12px 28px #061c3d26; }
.auth-archive-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.auth-archive-top > span:first-child { display: flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 600; }
.auth-archive-top .ui-icon { width: 19px; height: 19px; color: var(--cofer-gold); }
.auth-archive-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--brand-gradient); }
.auth-archive-row { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-top: 1px solid #ffd7b024; }
.auth-archive-row > span:nth-child(2) { min-width: 0; flex: 1; }
.auth-archive-row strong, .auth-archive-row small { display: block; }
.auth-archive-row strong { font-size: 12px; font-weight: 550; }
.auth-archive-row small { margin-top: 3px; color: var(--muted-on-dark); font-size: 10px; line-height: 1.5; }
.auth-archive-icon { display: grid; place-items: center; width: 36px; height: 40px; flex: 0 0 36px; border-radius: 8px; background: #ffd7b014; color: var(--cofer-peach); }
.auth-archive-icon .ui-icon { width: 20px; height: 20px; }
.auth-archive-row > .ui-icon { width: 15px; height: 15px; color: var(--cofer-gold); }
.auth-access { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 26px; min-width: 0; padding: 44px clamp(28px, 4vw, 64px) 26px; }
.auth-card { width: 100%; max-width: 390px; margin: auto 0; }
.auth-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; margin-bottom: 32px; padding: 5px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); }
.auth-tabs button { min-width: 0; min-height: 40px; padding: 8px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 600; }
.auth-tabs button[aria-selected="true"] { border-color: var(--warm-border); background: linear-gradient(120deg, var(--cofer-sand), var(--surface)); color: var(--ink); box-shadow: 0 2px 5px #0a2b5b0b; }
.auth-tabs button:not([aria-selected="true"]):hover { color: var(--ink); }
.auth-panel[hidden], .auth-page [hidden] { display: none; }
.auth-panel h2 { margin: 0 0 10px; color: var(--ink); font-size: 28px; line-height: 1.25; letter-spacing: -.9px; font-weight: 650; }
.auth-panel h2:focus { outline: none; }
.auth-description { margin: 0 0 25px; color: var(--muted); font-size: 13px; line-height: 1.75; }
.auth-description strong { display: inline-block; max-width: 100%; margin-top: 4px; color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }
.auth-field { min-width: 0; margin-bottom: 17px; }
.auth-field label { display: block; margin-bottom: 7px; color: var(--ink); font-size: 12px; font-weight: 600; }
.auth-label-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: -4px 0 3px; }
.auth-label-row label { margin: 0; }
.auth-inline-link { min-height: 28px; padding: 4px 0 4px 6px; border: 0; border-radius: 4px; background: transparent; color: var(--link); font-size: 11px; font-weight: 600; }
.auth-inline-link:hover { text-decoration: underline; }
.auth-field input { display: block; width: 100%; min-width: 0; max-width: 100%; height: 48px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); color: var(--ink); font: inherit; font-size: 14px; line-height: 1.5; transition: border-color .15s, box-shadow .15s; }
.auth-field input::placeholder { color: var(--muted); opacity: 1; }
.auth-field input:hover { border-color: var(--cofer-peach); }
.auth-field input:focus { border-color: var(--focus); outline: 2px solid var(--focus); outline-offset: 1px; background: var(--surface); box-shadow: 0 0 0 4px var(--focus-halo); }
.auth-field input[aria-invalid="true"] { border-color: var(--danger); background: var(--danger-soft); box-shadow: 0 0 0 1px var(--danger); }
.auth-field input[aria-invalid="true"]:focus { outline-color: var(--danger); box-shadow: 0 0 0 4px #a13d3514; }
.auth-field-error { margin: 8px 0 0; padding: 7px 10px; border-left: 2px solid var(--danger); border-radius: 0 7px 7px 0; background: var(--danger-soft); color: var(--danger); font-size: 11px; line-height: 1.5; overflow-wrap: anywhere; }
.auth-password { position: relative; min-width: 0; }
.auth-password input { padding-right: 77px; }
.auth-password button { position: absolute; right: 4px; top: 4px; height: 40px; min-width: 64px; padding: 4px 9px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: 11px; font-weight: 600; }
.auth-password button:hover { background: var(--cofer-sand); color: var(--link); }
.auth-field-hint { margin: 7px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.auth-field-hint.is-error { color: var(--danger); }
.auth-field-hint.is-valid { color: var(--success); }
.auth-password-guidance { margin-top: 10px; padding: 10px 12px; border: 1px solid var(--warm-border); border-radius: 9px; background: linear-gradient(120deg, var(--cofer-sand), var(--surface-soft)); color: var(--muted); font-size: 11px; line-height: 1.55; }
.auth-password-guidance p { margin: 4px 0 0; }
.auth-password-guidance .auth-password-guidance-title { margin: 0 0 5px; color: var(--ink); }
.auth-password-guidance-title .ui-icon { width: 14px; height: 14px; margin-right: 6px; }
.auth-password-guidance-title strong { font-size: 11px; font-weight: 650; }
.auth-password-guidance-title span { color: var(--muted); }
.auth-password-feedback { margin: 8px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; overflow-wrap: anywhere; }
.auth-password-feedback.is-valid { color: var(--success); }
.auth-submit { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 48px; margin-top: 24px; padding: 12px 16px; border: 1px solid var(--cofer-orange); border-radius: 10px; background: var(--brand-gradient); color: var(--cofer-navy); font-size: 13px; font-weight: 600; box-shadow: 0 4px 10px #ff8a001a; }
.auth-submit:hover { border-color: var(--cofer-orange); background: var(--brand-gradient-hover); }
.auth-submit .ui-icon { width: 18px; height: 18px; }
.auth-page button:disabled { opacity: .6; cursor: not-allowed; }
.auth-submit[aria-busy="true"] { cursor: wait; }
.auth-submit[aria-busy="true"] .ui-icon { visibility: hidden; }
.auth-submit[aria-busy="true"]::after { content: ''; width: 16px; height: 16px; border: 2px solid #0a2b5b50; border-top-color: var(--cofer-navy); border-radius: 50%; animation: auth-spin .8s linear infinite; }
.auth-switch, .auth-help { margin: 22px 0 0; text-align: center; color: var(--muted); font-size: 11px; line-height: 1.7; }
.auth-switch button, .auth-text-button { display: inline-block; min-height: 36px; padding: 5px 2px; border: 0; border-radius: 4px; background: transparent; color: var(--link); font-size: 12px; font-weight: 600; }
.auth-switch button:hover, .auth-text-button:hover { text-decoration: underline; }
.auth-error { margin: 14px 0 0; padding: 11px 12px; border: 1px solid #f0d4d1; border-radius: 9px; background: var(--danger-soft); color: var(--danger); font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.auth-status { margin: 14px 0 0; padding: 10px 12px; border: 1px solid #cbe1db; border-radius: 9px; background: var(--success-soft); color: var(--success); font-size: 12px; line-height: 1.6; }
.auth-footer { margin: 0; color: var(--muted); font-size: 10px; text-align: center; }
.auth-code-icon { display: grid; place-items: center; width: 50px; height: 50px; margin-bottom: 19px; border: 1px solid var(--warm-border); border-radius: 14px; background: linear-gradient(145deg, var(--cofer-sand), var(--cofer-peach)); color: var(--cofer-navy); }
.auth-code-icon svg { width: 26px; height: 26px; }
.auth-field .auth-code-input { height: 60px; padding-left: 24px; padding-right: 16px; text-align: center; font-size: 28px; font-weight: 600; letter-spacing: 8px; font-variant-numeric: tabular-nums; }
.auth-field .auth-code-input::placeholder { color: #a8a29a; }
.auth-resend { margin-top: 23px; text-align: center; }
.auth-resend p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.7; }
.auth-change-email { display: block; min-height: 36px; margin: 10px auto 0; padding: 6px; border: 0; border-radius: 4px; background: transparent; color: var(--muted); font-size: 11px; }
.auth-change-email:hover { color: var(--link); text-decoration: underline; }
#resume-verification { display: block; margin: 8px auto 0; }
#resume-verification[hidden] { display: none; }
.auth-resume { display: block; margin: 8px auto 0; }
@keyframes auth-spin { to { transform: rotate(360deg); } }
@media (min-width: 761px) and (max-height: 760px) {
  .auth-page { padding: 16px; }
  .auth-welcome { padding-top: 25px; padding-bottom: 24px; }
  .auth-welcome-copy { padding: 24px 0; }
  .auth-welcome h1 { font-size: 42px; }
  .auth-archive { margin-top: 26px; }
  .auth-access { padding-top: 28px; padding-bottom: 20px; gap: 20px; }
  .auth-tabs { margin-bottom: 24px; }
}
@media (max-width: 760px) {
  .auth-page { padding: 20px 20px max(20px, env(safe-area-inset-bottom)); align-items: center; justify-content: center; gap: 18px; }
  .auth-mobile-brand { display: inline-flex; flex: 0 0 auto; }
  .auth-mobile-brand .brand-logo { width: 156px; }
  .auth-shell { display: block; flex: 0 0 auto; width: 100%; max-width: 420px; border-radius: 20px; box-shadow: 0 8px 30px #0a2b5b06; }
  .auth-welcome { display: none; }
  .auth-access { padding: 24px 22px 20px; gap: 22px; }
  .auth-tabs { margin-bottom: 24px; }
  .auth-panel h2 { font-size: 25px; }
  .auth-description { margin-bottom: 21px; font-size: 12px; }
  .auth-field { margin-bottom: 15px; }
  .auth-field input { font-size: 16px; }
  .auth-field input::placeholder { font-size: 13px; }
  .auth-footer { font-size: 9px; }
  .auth-help { margin-top: 18px; }
}
@media (max-width: 360px) {
  .auth-page { padding-left: 14px; padding-right: 14px; }
  .auth-access { padding-left: 18px; padding-right: 18px; }
  .auth-panel h2 { font-size: 23px; }
}
@media (max-width: 760px) and (max-height: 700px) {
  .auth-page { padding-top: 12px; padding-bottom: max(12px, env(safe-area-inset-bottom)); gap: 10px; }
  .auth-mobile-brand .brand-logo { width: 128px; }
  .auth-access { padding-top: 18px; padding-bottom: 16px; gap: 14px; }
  .auth-tabs { margin-bottom: 18px; }
  .auth-tabs button { min-height: 36px; }
  .auth-panel h2 { font-size: 23px; margin-bottom: 7px; }
  .auth-description { margin-bottom: 16px; }
  .auth-field { margin-bottom: 12px; }
  .auth-field input { height: 44px; }
  .auth-password button { height: 36px; }
  .auth-submit { margin-top: 18px; min-height: 44px; }
  .auth-help, .auth-switch { margin-top: 14px; }
  .auth-footer { display: none; }
  .auth-code-icon { width: 42px; height: 42px; margin-bottom: 14px; }
  .auth-resend { margin-top: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .auth-page *, .auth-page *::after { animation: none !important; transition: none !important; }
}
