:root {
    color-scheme: light;
    --navy: #0c2845;
    --blue: #087eae;
    --blue-dark: #066b96;
    --muted: #607792;
    --line: #cad9e8;
    --orange: #f28b22;
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

body {
    min-height: 100vh;
    margin: 0;
    padding: calc(28px + env(safe-area-inset-top)) 18px calc(28px + env(safe-area-inset-bottom));
    display: grid;
    place-items: center;
    color: var(--navy);
    background: radial-gradient(circle at 12% 12%, #dff5fc 0, transparent 35%), #f4f8fb;
    font-family: Arial, Helvetica, sans-serif;
}

.login-card {
    width: min(100%, 540px);
    padding: 42px 38px;
    border: 1px solid #dbe5ee;
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 22px 55px rgba(12, 40, 69, .15);
}

.logo {
    display: block;
    width: min(250px, 70%);
    margin: 0 auto 28px;
}

.eyebrow {
    color: var(--blue);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .11em;
    text-align: center;
    text-transform: uppercase;
}

h1 {
    margin: 8px 0 10px;
    font-size: clamp(28px, 6vw, 38px);
    line-height: 1.08;
    text-align: center;
}

.intro {
    max-width: 440px;
    margin: 0 auto 28px;
    color: var(--muted);
    line-height: 1.55;
    text-align: center;
}

.message {
    margin: 0 0 20px;
    padding: 14px 16px;
    border-radius: 12px;
    line-height: 1.45;
}

.message.error {
    border: 1px solid #f1c2c7;
    color: #8a2430;
    background: #fff1f1;
}

.message.status {
    border: 1px solid #b9e5d4;
    color: #176447;
    background: #eaf8f2;
}

label {
    display: block;
    margin: 0 0 8px;
    font-size: 14px;
    font-weight: 700;
}

input[type="email"],
input[type="password"] {
    width: 100%;
    min-height: 52px;
    margin: 0 0 16px;
    padding: 13px 15px;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--navy);
    background: #fbfdff;
    font-size: 16px;
}

input:focus,
button:focus-visible,
a:focus-visible {
    outline: 3px solid rgba(8, 126, 174, .22);
    outline-offset: 3px;
}

button[type="submit"] {
    width: 100%;
    min-height: 52px;
    margin-top: 2px;
    border: 0;
    border-radius: 12px;
    color: #fff;
    background: var(--blue);
    box-shadow: 0 9px 20px rgba(8, 126, 174, .23);
    cursor: pointer;
    font-size: 16px;
    font-weight: 800;
}

button[type="submit"]:hover {
    background: var(--blue-dark);
}

button:disabled {
    cursor: wait;
    opacity: .68;
}

.account-links,
.resource-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-align: center;
}

.account-links {
    margin-top: 20px;
}

.account-links a {
    color: var(--blue);
    font-weight: 800;
    text-decoration: none;
}

.account-links a:hover,
.resource-links a:hover,
.text-button:hover {
    text-decoration: underline;
}

fieldset {
    min-width: 0;
    margin: 0 0 16px;
    padding: 0;
    border: 0;
}

.district-options {
    display: grid;
    gap: 10px;
}

.district-option {
    display: flex;
    min-height: 54px;
    margin: 0;
    padding: 14px 15px;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fbfdff;
    cursor: pointer;
    font-size: 16px;
}

.district-option:has(input:checked) {
    border-color: var(--blue);
    background: #edf8fc;
    box-shadow: 0 0 0 2px rgba(8, 126, 174, .12);
}

.district-option input {
    width: 20px;
    height: 20px;
    margin: 0;
    accent-color: var(--blue);
}

.text-button {
    min-height: 44px;
    padding: 0;
    border: 0;
    color: var(--blue);
    background: transparent;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
}

.back-button {
    margin: -14px 0 8px;
}

.security {
    margin: 24px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
    text-align: center;
}

.resource-links {
    margin-top: 14px;
    font-size: 13px;
}

.resource-links a {
    color: var(--muted);
    font-weight: 700;
    text-decoration: none;
}

.accent {
    width: 56px;
    height: 3px;
    margin: 22px auto 0;
    border-radius: 4px;
    background: var(--orange);
}

.loading-overlay {
    position: fixed;
    z-index: 1000;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(244, 248, 251, .82);
    backdrop-filter: blur(5px);
}

.loading-card {
    display: flex;
    min-width: 190px;
    padding: 18px 22px;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border: 1px solid #dbe5ee;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 16px 38px rgba(12, 40, 69, .18);
    font-weight: 800;
}

.spinner {
    width: 22px;
    height: 22px;
    border: 3px solid #cfe6f0;
    border-top-color: var(--blue);
    border-radius: 50%;
    animation: spin .75s linear infinite;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 520px) {
    body {
        padding-right: 12px;
        padding-left: 12px;
    }

    .login-card {
        padding: 32px 22px;
        border-radius: 20px;
    }

    .back-button {
        margin-top: -8px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .spinner {
        animation-duration: 1.5s;
    }
}
