/* Define global application structure and the two primary page shells. */
* { box-sizing: border-box; }
html { color-scheme: light; }
body { margin: 0; color: var(--ink); background: var(--page); font-family: var(--font-body); }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
svg { width: 1.2em; height: 1.2em; stroke-width: 1.9; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3, strong { font-family: var(--font-display); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 34%, transparent); outline-offset: 2px; }

.auth-shell { display: grid; grid-template-columns: minmax(480px, 40%) 1fr; min-height: 100vh; }
.auth-brand-panel { display: flex; flex-direction: column; justify-content: space-between; min-height: 100vh; padding: 64px 60px; color: var(--brand-ink); background: var(--brand-soft); }
.auth-brand { display: inline-flex; gap: 12px; align-items: center; width: max-content; font: 700 20px var(--font-display); }
.auth-brand > span, .brand-mark { display: inline-grid; width: 42px; height: 42px; place-items: center; color: var(--brand-ink); background: var(--yellow); border-radius: var(--radius); }
.auth-message { display: grid; gap: 22px; }
.auth-message h1 { max-width: 490px; font-size: 45px; line-height: 1.2; letter-spacing: 0; }
.auth-message p { color: #56477f; font-size: 15px; }
.auth-preview { display: grid; gap: 14px; padding: 22px; background: #fefcff8f; border: 1px solid #fefcffc4; border-radius: var(--radius); }
.auth-preview > div { display: flex; justify-content: space-between; align-items: center; }
.auth-preview > div small { color: #65578a; }
.auth-preview > p { display: flex; gap: 12px; align-items: center; font-size: 13px; }
.auth-preview > p > svg { flex: 0 0 auto; }
.auth-preview > p span { display: grid; gap: 2px; }
.auth-preview > p small { color: #65578a; font-size: 10px; }
.register-preview { justify-items: start; max-width: 440px; }
.register-preview > svg { width: 30px; height: 30px; }
.register-preview p { color: #56477f; line-height: 1.6; }
.auth-form-panel { display: grid; min-height: 100vh; padding: 50px; place-items: center; background: #faf8fd; }
.auth-form-wrap { width: min(420px, 100%); }
.auth-form-wrap h2 { font-size: 34px; }
.auth-form-wrap > p { margin-top: 8px; color: var(--ink-soft); }
.auth-form { display: grid; gap: 10px; margin-top: 28px; }
.auth-form label { display: grid; gap: 8px; margin-top: 6px; color: #3b3e45; font-size: 13px; font-weight: 700; }
.auth-form input, .auth-form select { width: 100%; height: 50px; padding: 0 15px; color: var(--ink); background: var(--surface); border: 1px solid #d9d5e2; border-radius: var(--radius); }
.auth-form input:focus, .auth-form select:focus { border-color: var(--brand); }
.field-error { color: var(--danger); font-size: 12px; }
.primary-button { display: inline-flex; justify-content: center; align-items: center; gap: 8px; height: 50px; margin-top: 10px; color: var(--brand-ink); font-weight: 800; background: var(--brand); border: 0; border-radius: var(--radius); cursor: pointer; }
.primary-button:hover { filter: saturate(1.08) brightness(.98); }
.auth-switch { margin-top: 18px !important; text-align: center; font-size: 13px; }
.auth-switch a { color: #6d50c8; font-weight: 800; }

.app-shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; display: flex; flex-direction: column; justify-content: space-between; height: 100vh; padding: 28px 20px; background: var(--surface); border-right: 1px solid var(--border); }
.brand { display: flex; gap: 10px; align-items: center; padding: 0 8px; font: 700 17px var(--font-display); }
.brand-mark { width: 36px; height: 36px; }
.sidebar-nav { display: grid; gap: 7px; margin-top: 34px; }
.nav-link { display: flex; gap: 12px; align-items: center; min-height: 46px; padding: 0 14px; color: #59606a; border-radius: var(--radius); font-size: 14px; }
.nav-link:hover:not(.is-disabled) { background: var(--surface-soft); }
.nav-link.is-active { color: #6d50c8; background: var(--brand-pale); font-weight: 800; }
.nav-link.is-disabled { cursor: default; opacity: .5; }
.student-panel { display: flex; gap: 10px; align-items: center; padding: 12px 10px; background: var(--surface-soft); border-radius: var(--radius); }
.student-avatar { display: grid; flex: 0 0 auto; width: 38px; height: 38px; place-items: center; color: #5c2e25; background: var(--coral); border-radius: var(--radius); font-weight: 800; }
.student-copy { display: grid; flex: 1; gap: 2px; min-width: 0; }
.student-copy strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; }
.student-copy small { color: var(--ink-muted); font-size: 11px; }
.icon-button { display: grid; width: 34px; height: 34px; padding: 0; place-items: center; color: var(--ink-soft); background: transparent; border: 0; border-radius: var(--radius); cursor: pointer; }
.icon-button:hover { background: #e7e3ed; }
.app-main { min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; min-height: var(--topbar); padding: 0 40px; background: var(--surface); border-bottom: 1px solid var(--border); }
.topbar h1 { font-size: 24px; line-height: 1.2; }
.topbar p { margin-top: 5px; color: var(--ink-soft); font-size: 12px; }
.date-badge { display: inline-flex; gap: 8px; align-items: center; padding: 10px 14px; color: var(--brand-ink); background: var(--brand-pale); border-radius: var(--radius); font-size: 12px; font-weight: 800; }
.page-content { display: grid; gap: 22px; padding: 28px 40px 36px; }
.mobile-nav { display: none; }
.app-status { position: fixed; right: 20px; bottom: 20px; z-index: 20; max-width: min(360px, calc(100vw - 40px)); padding: 11px 14px; color: var(--surface); background: var(--brand-ink); border-radius: var(--radius); opacity: 0; transform: translateY(10px); pointer-events: none; transition: opacity .2s ease, transform .2s ease; }
.app-status.is-visible { opacity: 1; transform: translateY(0); }
.app-status.is-error { background: var(--danger); }
