/* Student login and sign-up pages. Loaded only on /login and /register. */

:root {
    --auth-brand: #f3993f;
    --auth-brand-deep: #e07f1d;
    --auth-ink: #17130f;
    --auth-ink-soft: #2b2019;
    --auth-paper: #fff8f0;
    --auth-card: #ffffff;
    --auth-field: #fffdfa;
    --auth-muted: #6b645c;
    --auth-border: #eadfd3;
    --auth-danger: #c2410c;
    --auth-success: #15803d;
}

html[data-theme="dark"] {
    --auth-paper: #120f0c;
    --auth-card: #1c1713;
    --auth-field: #241d18;
    --auth-muted: #b9b1a6;
    --auth-border: #3a302a;
    --auth-ink: #fff8f0;
}

.auth-page {
    min-height: calc(100vh - 140px);
    padding: 48px 16px 64px;
    background:
        radial-gradient(900px 500px at 10% -10%, rgba(243, 153, 63, 0.18), transparent 60%),
        radial-gradient(700px 400px at 100% 110%, rgba(243, 153, 63, 0.12), transparent 60%),
        var(--auth-paper);
    color: var(--auth-ink);
}

.auth-shell {
    max-width: 1040px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.02fr 1fr;
    background: var(--auth-card);
    border: 1px solid var(--auth-border);
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(23, 19, 15, 0.12);
}

/* ---- Hero (left) ---- */
.auth-hero {
    position: relative;
    padding: 48px;
    color: #fff8f0;
    background: linear-gradient(150deg, #17130f 0%, #2b2019 55%, #5a3416 100%);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 32px;
    overflow: hidden;
}

.auth-hero::after {
    content: "";
    position: absolute;
    width: 320px;
    height: 320px;
    right: -120px;
    bottom: -120px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(243, 153, 63, 0.45), transparent 70%);
    pointer-events: none;
}

.auth-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: #fff8f0;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.05rem;
    position: relative;
    z-index: 1;
}

.auth-brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: var(--auth-brand);
    color: var(--auth-ink);
    font-size: 1.2rem;
}

.auth-hero-copy { position: relative; z-index: 1; }

.auth-kicker {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--auth-brand);
    margin-bottom: 14px;
}

.auth-hero h2 {
    font-size: 2.1rem;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin: 0 0 14px;
}

.auth-hero-copy > p {
    color: rgba(255, 248, 240, 0.78);
    margin: 0;
    line-height: 1.6;
}

.auth-features {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 16px;
    position: relative;
    z-index: 1;
}

.auth-features li {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.auth-feature-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: rgba(243, 153, 63, 0.18);
    color: var(--auth-brand);
    font-size: 1.05rem;
}

.auth-features strong { display: block; font-size: 0.98rem; }
.auth-features span { display: block; color: rgba(255, 248, 240, 0.7); font-size: 0.9rem; line-height: 1.45; }

/* ---- Form panel (right) ---- */
.auth-panel {
    padding: 48px 44px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    padding: 4px;
    border-radius: 14px;
    background: var(--auth-field);
    border: 1px solid var(--auth-border);
    margin-bottom: 28px;
}

.auth-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    text-align: center;
    padding: 10px 12px;
    border-radius: 11px;
    font-weight: 600;
    color: var(--auth-muted);
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.auth-tab:hover { color: var(--auth-ink); }

.auth-tab.is-active {
    background: var(--auth-ink);
    color: #fff8f0;
}

html[data-theme="dark"] .auth-tab.is-active { background: var(--auth-brand); color: var(--auth-ink); }

.auth-title {
    font-size: 1.7rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0 0 6px;
}

.auth-subtitle {
    color: var(--auth-muted);
    margin: 0 0 24px;
    line-height: 1.55;
}

.auth-alert {
    border-radius: 14px;
    padding: 12px 14px;
    font-size: 0.92rem;
    margin-bottom: 18px;
    line-height: 1.45;
}

.auth-alert-error { background: #fef2f2; color: var(--auth-danger); border: 1px solid #fecaca; }
.auth-alert-success { background: #f0fdf4; color: var(--auth-success); border: 1px solid #bbf7d0; }
html[data-theme="dark"] .auth-alert-error { background: rgba(194, 65, 12, 0.14); border-color: rgba(194, 65, 12, 0.4); color: #fdba74; }
html[data-theme="dark"] .auth-alert-success { background: rgba(21, 128, 61, 0.14); border-color: rgba(21, 128, 61, 0.4); color: #86efac; }

/* Google */
.auth-google { display: flex; flex-direction: column; align-items: center; }
.auth-google-button { width: 100%; min-height: 50px; display: flex; justify-content: center; }
.auth-google-button > div { margin: 0 auto; }
.auth-google-note { font-size: 0.8rem; color: var(--auth-muted); margin-top: 8px; text-align: center; }
.auth-google-fallback {
    width: 100%;
    height: 52px;
    border-radius: 14px;
    border: 1.5px solid var(--auth-border);
    background: var(--auth-field);
    color: var(--auth-ink);
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 24px 0;
    color: var(--auth-muted);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--auth-border);
}

/* Fields */
.auth-field { margin-bottom: 18px; }

.auth-label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.auth-input-wrap { position: relative; }

.auth-input-wrap > .auth-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--auth-muted);
    pointer-events: none;
}

.auth-input {
    width: 100%;
    height: 52px;
    border-radius: 14px;
    border: 1.5px solid var(--auth-border);
    background: var(--auth-field);
    color: var(--auth-ink);
    padding: 0 16px 0 46px;
    font-size: 1rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.auth-input::placeholder { color: #a39a90; }

.auth-input:focus {
    outline: none;
    border-color: var(--auth-brand);
    box-shadow: 0 0 0 4px rgba(243, 153, 63, 0.2);
}

.auth-input.is-invalid { border-color: var(--auth-danger); }

.auth-input-wrap.has-toggle .auth-input { padding-right: 52px; }

.auth-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border: 0;
    background: transparent;
    color: var(--auth-muted);
    border-radius: 10px;
    display: grid;
    place-items: center;
}

.auth-toggle:hover { color: var(--auth-ink); background: rgba(23, 19, 15, 0.05); }

.auth-error {
    color: var(--auth-danger);
    font-size: 0.85rem;
    margin-top: 6px;
}

.auth-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin: -4px 0 22px;
    font-size: 0.9rem;
}

.auth-link { color: var(--auth-brand-deep); font-weight: 600; text-decoration: none; }
.auth-link:hover { text-decoration: underline; }

.auth-submit {
    width: 100%;
    height: 54px;
    border: 0;
    border-radius: 14px;
    background: var(--auth-ink);
    color: #fff8f0;
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.12s, background 0.15s;
}

.auth-submit:hover { background: var(--auth-ink-soft); }
.auth-submit:active { transform: translateY(1px); }
.auth-submit:disabled { opacity: 0.6; cursor: not-allowed; }
html[data-theme="dark"] .auth-submit { background: var(--auth-brand); color: var(--auth-ink); }
html[data-theme="dark"] .auth-submit:hover { background: var(--auth-brand-deep); }

/* Password strength (sign-up) */
.auth-strength { display: flex; gap: 6px; margin-top: 10px; }
.auth-strength span { flex: 1; height: 5px; border-radius: 99px; background: var(--auth-border); transition: background 0.2s; }
.auth-strength-text { font-size: 0.8rem; color: var(--auth-muted); margin-top: 6px; min-height: 1.1em; }

.auth-terms { font-size: 0.82rem; color: var(--auth-muted); text-align: center; margin: 18px 0 0; line-height: 1.5; }

.auth-trust {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 26px;
    font-size: 0.82rem;
    color: var(--auth-muted);
}

/* ---- Responsive ---- */
@media (max-width: 880px) {
    .auth-shell { grid-template-columns: 1fr; border-radius: 22px; }
    .auth-hero { display: none; }
    .auth-page { padding: 24px 12px 48px; }
}

@media (max-width: 480px) {
    .auth-panel { padding: 32px 20px; }
    .auth-title { font-size: 1.5rem; }
}

@media (prefers-reduced-motion: reduce) {
    .auth-input, .auth-submit, .auth-tab { transition: none; }
}
