/* ============================================================
   Auth Pages (Login, Verify Code)
   ============================================================ */

body.auth-body {
    background: #fff;
}

.auth-page-transition {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    pointer-events: none;
    opacity: 1;
    transition: opacity .2s ease;
}

.auth-page-transition .auth-transition-logo {
    opacity: 1;
    transform: scale(1);
    transition: opacity .18s ease, transform .18s ease;
}

body.auth-ready .auth-page-transition {
    opacity: 0;
}

body.auth-ready .auth-page-transition .auth-transition-logo {
    opacity: 0;
    transform: scale(.96);
}

body.auth-transition-out .auth-page-transition {
    opacity: 1;
    transition-duration: .18s;
}

body.auth-transition-out .auth-page-transition .auth-transition-logo {
    opacity: 1;
    transform: scale(1);
}

.auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #ffffff 0%, var(--ea-bg) 100%);
    padding: 24px;
    gap: 18px;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity .42s ease, transform .42s cubic-bezier(.2, .8, .2, 1);
}

body.auth-ready .auth-page {
    opacity: 1;
    transform: translateY(0);
}

body.auth-transition-out .auth-page {
    opacity: 0;
    transform: translateY(-8px);
    transition-duration: .16s;
}

.auth-card {
    background: var(--ea-white);
    border: 1px solid var(--ea-border);
    border-radius: var(--radius);
    box-shadow: 0 10px 30px rgba(11,30,73,.08);
    width: 100%;
    max-width: 480px;
    overflow: hidden;
}

/* Dark blue header bar with EA logo */
.auth-card-topbar {
    background: linear-gradient(90deg, var(--ea-primary) 0%, var(--ea-accent) 60%, #2647a5 100%);
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0 28px;
}
.auth-card-logo {
    height: 60px;
    max-width: 360px;
    width: auto;
    display: block;
}

.auth-card-body {
    padding: 28px;
}

/* Legacy .auth-logo kept for any other uses */
.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}
.auth-logo img {
    height: 56px;
    margin: 0 auto;
}
.auth-logo h1 {
    font-size: 1.4rem;
    color: var(--ea-primary);
    margin-top: 12px;
}

.auth-title {
    font-size: clamp(1.2rem, 2.4vw, 1.5rem);
    font-weight: 700;
    color: var(--ea-primary);
    text-align: center;
    margin: 4px 0 6px;
}

.auth-subtitle {
    text-align: center;
    color: var(--ea-muted);
    font-size: 0.92rem;
    margin: 0 0 22px;
}

/* Segment toggle — removed, single-field login */

.auth-code-input {
    text-align: center;
    font-size: 2rem;
    letter-spacing: 12px;
    font-weight: 700;
    padding: 14px;
    font-family: var(--font-mono);
}

.auth-timer {
    text-align: center;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--ea-primary);
    margin: 16px 0;
}
.auth-timer.expired {
    color: var(--ea-error);
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--ea-border);
}
.auth-footer p {
    font-size: 0.85rem;
    color: var(--ea-muted);
    margin-bottom: 4px;
}
.auth-footer a {
    color: var(--ea-accent);
    font-weight: 600;
}

.auth-resend {
    text-align: center;
    margin-top: 16px;
}
.auth-resend a {
    font-size: 0.85rem;
    color: var(--ea-accent);
}

.auth-help {
    text-align: center;
    font-size: 0.82rem;
    color: var(--ea-muted);
    margin-top: 12px;
}

/* Support contact block under login form */
.auth-support {
    text-align: center;
    font-size: 0.85rem;
    color: var(--ea-muted);
    line-height: 1.55;
    margin: 18px 0 4px;
}
.auth-support a {
    color: var(--ea-primary);
    text-decoration: none;
}
.auth-support a:hover {
    text-decoration: underline;
}

/* Footer line below the auth card */
.auth-school-footer {
    text-align: center;
    font-size: 0.85rem;
    color: var(--ea-muted);
    margin: 4px 0 0;
}
.auth-school-footer a {
    color: var(--ea-primary);
    font-weight: 600;
    text-decoration: none;
}
.auth-school-footer a:hover {
    text-decoration: underline;
}

.auth-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 20px;
}

/* Language switch on auth pages */
.auth-lang {
    position: fixed;
    top: 16px;
    right: 16px;
    display: flex;
    gap: 8px;
}
.auth-lang a {
    color: var(--ea-muted);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: color var(--transition);
}
.auth-lang a:hover, .auth-lang a.active {
    color: var(--ea-primary);
}

/* reCAPTCHA — hide Google's own badge in favour of our own notice.
   This is allowed by Google provided the notice below is visible. */
.grecaptcha-badge { visibility: hidden !important; }

.recaptcha-notice {
    max-width: 480px;
    margin: 0 auto;
    font-size: 0.78rem;
    line-height: 1.45;
    color: var(--ea-muted);
    text-align: center;
    opacity: 0.85;
}
.recaptcha-notice a {
    color: var(--ea-muted);
    text-decoration: underline;
}
.recaptcha-notice a:hover {
    color: var(--ea-primary);
}

@media (prefers-reduced-motion: reduce) {
    .auth-page,
    .auth-page-transition,
    body.auth-transition-out .auth-page,
    body.auth-transition-out .auth-page-transition {
        transition: none;
        transform: none;
    }
}

@media (max-width: 480px) {
    .auth-card-topbar { height: 84px; padding: 0 16px; }
    .auth-card-logo { height: 48px; }
    .auth-card-body { padding: 22px 18px; }
    .auth-title { font-size: 1.2rem; }
    .auth-code-input { font-size: 1.6rem; letter-spacing: 8px; }
}
