@import url("./product_system.css");
/* Authentication behavior and account presentation shared by all entry pages. */
html[data-auth-state="checking"] body, html[data-auth-state="locked"] body { visibility: hidden !important; pointer-events: none !important; }
/* Only the sanitized public recovery body can be displayed while Auth stays locked. */
html[data-auth-state="locked"] body[data-admin-public-recovery="true"] { visibility: visible !important; pointer-events: auto !important; }
html[data-auth-state="logout-pending"] body { visibility: visible !important; pointer-events: auto !important; }
html[data-auth-state="logout-pending"] body > :not(#authLogoutScreen) { display: none !important; }
.auth-logout-screen { position: fixed; inset: 0; z-index: 2147483647; overflow: auto; display: grid; place-items: center; padding: 24px; background: var(--workspace-paper); color: var(--auth-ink); font: 16px/1.6 var(--font-ui); }
.auth-logout-screen .auth-card { width: min(100%, 440px); }
.auth-page { min-height: 100dvh; display: grid; align-items: center; padding: 48px 32px; }
.auth-card { width: min(100%, 480px); padding: 40px; border: 1px solid var(--line); border-radius: var(--radius-surface); background: var(--panel); }
.auth-brand { display: flex; align-items: center; gap: 12px; color: var(--ink); font-size: 19px; font-weight: 650; letter-spacing: -.02em; }
.auth-card h1 { font-size: 30px; font-weight: 650; line-height: 1.3; letter-spacing: -.03em; margin: 0 0 12px; }
.auth-card p, .auth-dialog p { color: var(--workspace-muted); }
.auth-form { display: grid; gap: 16px; }
.auth-form label { display: grid; gap: 6px; font-weight: 600; }
.auth-form input { box-sizing: border-box; width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--field-line); border-radius: 8px; font: inherit; background: #fff; color: var(--auth-ink); }
.auth-form input:focus-visible, .auth-button:focus-visible, .auth-account summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.auth-form .auth-error { min-height: 1.6em; margin: 0; color: var(--bad); font-weight: 400; }
.auth-note { font-size: 14px; }
.auth-account { position: relative; margin: 0; min-width: 0; color: var(--auth-ink); z-index: 50; }
.auth-account > summary { display: flex; align-items: center; gap: 10px; min-height: 46px; max-width: 280px; padding: 6px 12px 6px 6px; border: 1px solid var(--workspace-line); border-radius: 999px; background: #fff; cursor: pointer; list-style: none; font-size: 14px; font-weight: 650; }
.auth-account > summary::-webkit-details-marker { display: none; }
.auth-account > summary:hover, .auth-account[open] > summary { background: var(--accent-soft); border-color: var(--line); }
#authAccountName { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auth-avatar { flex: 0 0 32px; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: var(--auth-green); color: white; font-size: 13px; }
.auth-chevron { margin-left: auto; color: var(--workspace-muted); }
.auth-account[open] .auth-chevron { transform: rotate(180deg); }
.auth-account-panel { position: absolute; right: 0; top: calc(100% + 10px); width: 306px; max-width: calc(100vw - 32px); max-height: min(720px, calc(100dvh - 96px)); overflow-y: auto; overscroll-behavior: contain; padding: 12px; border: 1px solid var(--workspace-line); border-radius: 12px; background: #fff; box-shadow: var(--shadow-overlay); }
.auth-account .auth-account-role { margin: 2px 10px 8px; color: var(--workspace-muted); font-size: 13px; font-weight: 650; letter-spacing: .06em; }
.auth-profile { display: grid; gap: 4px; padding: 12px; margin-bottom: 8px; border-radius: 10px; background: var(--bg); overflow-wrap: anywhere; }
.auth-profile small { color: var(--workspace-muted); font-size: 13px; }
#studentPill { font-size: 15px; font-weight: 650; overflow-wrap: anywhere; }
.auth-account-actions { display: grid; gap: 2px; }
.auth-account-actions .auth-button, .auth-account-actions a { display: block; min-height: 44px; padding: 10px 12px; border: 0; border-radius: 9px; background: transparent; color: var(--auth-ink); font: inherit; font-size: 14px; font-weight: 600; text-align: left; text-decoration: none; overflow-wrap: anywhere; cursor: pointer; }
.auth-account-actions span { display: block; margin-top: 3px; color: var(--workspace-muted); font-size: 13px; font-weight: 400; }
.auth-account-actions b { font-weight: inherit; }
.auth-account-actions .auth-button:hover, .auth-account-actions a:hover { background: var(--bg); }
.auth-account-actions a:focus-visible { outline: 3px solid var(--accent); outline-offset: -1px; }
.auth-account-security { border-top: 1px solid var(--workspace-line); padding-top: 8px; margin-top: 8px; }
.auth-account-security .auth-signout { color: var(--bad); }
.auth-interface-language { display: grid; gap: 4px; margin: 12px 0; min-width: 0; }
.auth-interface-language label { font-size: .82rem; color: var(--workspace-muted); }
.auth-interface-language select { width: 100%; max-width: 100%; min-height: 44px; padding: 6px 8px; border: 1px solid var(--workspace-line); border-radius: 8px; background: #fff; color: var(--auth-ink); font: inherit; }
.auth-interface-language select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.auth-interface-language [role="status"]:not(:empty) { color: var(--bad); font-size: .82rem; }
.auth-account .auth-account-help { margin: 8px 10px 14px; color: var(--workspace-muted); font-size: 13px; line-height: 1.65; }
.auth-account .auth-error { margin: 8px; font-size: 13px; color: var(--bad); overflow-wrap: anywhere; }
.auth-account .auth-error:empty { display: none; }
.auth-dialog { width: min(420px, calc(100% - 40px)); max-height: 85vh; max-height: 85dvh; overflow: auto; overscroll-behavior: contain; box-sizing: border-box; border: 1px solid var(--workspace-line); border-radius: 12px; padding: 28px; color: var(--auth-ink); overflow-wrap: anywhere; }
.auth-dialog::backdrop { background: #10182888; }
.auth-dialog h2 { margin-top: 0; }
.auth-actions { display: flex; gap: 10px; flex-wrap: wrap; }
/* Intrinsic field widths and long feedback must stay inside standalone cards. */
.auth-card, .auth-form, .auth-form label { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
.auth-logout-screen { grid-template-columns: minmax(0, 1fr); }
.auth-page { min-height: 100dvh; }
.auth-logout-screen, .auth-account-panel, .auth-button { box-sizing: border-box; }
.auth-form input { min-width: 0; max-width: 100%; }
.auth-dialog :is(input, button) { scroll-margin-block: 12px; }
.auth-dialog [hidden] { display: none !important; }
.auth-password-methods { margin-bottom: 4px; }
.auth-password-methods .auth-button { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.auth-password-proof select { box-sizing: border-box; width: 100%; min-width: 0; min-height: 44px; padding: 10px 12px; border: 1px solid var(--field-line); border-radius: 8px; background: var(--panel); color: var(--auth-ink); font: inherit; }
.auth-password-proof select:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

/* Login is a calm reading introduction beside a complete authentication form. */
.auth-layout { width: min(100%, 1040px); margin: auto; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 480px); gap: 80px; align-items: center; }
.auth-introduction { min-width: 0; padding-block: 24px; }
.auth-brand-mark { display: grid; place-items: center; width: 44px; height: 48px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--accent); font: 32px Georgia, serif; }
.auth-studio { margin: 48px 0 16px; color: var(--muted); font-size: 13px; letter-spacing: .08em; }
.auth-introduction h2 { max-width: 12em; margin: 0; font-size: clamp(32px, 3.4vw, 44px); line-height: 1.3; font-weight: 550; letter-spacing: -.035em; overflow-wrap: anywhere; }
.auth-story { max-width: 32em; margin: 24px 0 0; color: var(--muted); font-size: 17px; line-height: 1.9; }
.auth-introduction .auth-interface-language { max-width: 240px; margin-top: 40px; }
.auth-card > p { font-size: 15px; margin: 0 0 24px; }
.auth-method-heading { margin: 24px 0 16px; font-size: 16px; font-weight: 650; }
.auth-card .auth-note { margin: 24px 0 0; padding-top: 20px; border-top: 1px solid var(--line); font-size: 13px; line-height: 1.7; }
.auth-card .auth-form { gap: 16px; }
.auth-card .auth-form .auth-error:empty { min-height: 0; }
.auth-card .auth-form .auth-error:not(:empty) { border-left: 3px solid var(--bad); padding: 8px 12px; background: var(--bad-soft); }
.auth-form input { min-height: 48px; }
.auth-form label { font-size: 15px; }
.auth-page .enrollment-section, .auth-dialog .enrollment-section { background: var(--bg); border-color: var(--line); color: var(--ink); border-radius: 8px; padding: 16px; }
.auth-page .enrollment-status, .auth-dialog .enrollment-status { color: var(--muted); }
.auth-page .enrollment-tabs button[aria-pressed=true], .auth-dialog .enrollment-tabs button[aria-pressed=true] { background: var(--accent); border-color: var(--accent); color: #fff; }
.auth-page .enrollment-divider { color: var(--muted); }
.auth-dialog .auth-form label { min-width: 0; }
@media (max-width: 900px) {
  .auth-layout { gap: 32px; grid-template-columns: minmax(0, 1fr) minmax(0, 440px); }
  .auth-card { padding: 32px; }
}
@media (max-width: 700px) {
  .auth-page { padding: 24px 16px 40px; }
  .auth-layout { max-width: 480px; grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .auth-introduction { display: grid; grid-template-columns: minmax(0, 1fr) minmax(120px, .75fr); gap: 12px; padding: 0; align-items: center; }
  .auth-brand { font-size: 16px; gap: 8px; }
  .auth-brand-mark { width: 32px; height: 38px; flex-shrink: 0; font-size: 25px; }
  .auth-introduction .auth-interface-language { margin: 0; }
  .auth-studio, .auth-introduction h2, .auth-story { display: none; }
  .auth-card { width: 100%; padding: 28px 24px; }
  .auth-card h1 { font-size: 28px; }
}
@media (max-width: 480px) {
  .auth-account > summary { max-width: 180px; }
  .auth-account-panel { position: fixed; top: 72px; right: 12px; width: 306px; max-width: calc(100vw - 24px); max-height: calc(100dvh - 88px); }
  .auth-card { padding: 24px; }
  .auth-dialog { padding: 20px; }
  .auth-dialog .auth-actions { flex-direction: column; }
  .auth-dialog .auth-actions button { width: 100%; }
}
@media (max-width: 360px) {
  .auth-introduction { grid-template-columns: minmax(0, 1fr); }
  .auth-introduction .auth-interface-language { max-width: none; }
  .auth-card { padding: 24px 16px; }
}
