:root {
    --auth-navy: #081b35;
    --auth-blue: #123d6b;
    --auth-gold: #d4af37;
    --auth-surface: #f4f6f9;
    --auth-muted: #66758a;
    --auth-border: #dce3eb;
    --auth-danger: #b42318;
    --auth-success: #176b45;
}

.auth-page-body {
    min-height: 100vh;
    display: block;
    background: var(--auth-surface);
}

.auth-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(360px, 1.05fr) minmax(480px, .95fr);
}

.auth-visual {
    min-height: 100vh;
    position: relative;
    overflow: hidden;
    padding: 42px clamp(34px, 6vw, 92px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: #fff;
    background:
        linear-gradient(135deg, rgba(5, 20, 43, .94), rgba(13, 54, 94, .76)),
        url("assets/media/school-hero.webp") center / cover no-repeat;
}

.auth-visual::before,
.auth-visual::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .13);
    pointer-events: none;
}

.auth-visual::before {
    width: 440px;
    height: 440px;
    left: -180px;
    bottom: -170px;
}

.auth-visual::after {
    width: 280px;
    height: 280px;
    right: -130px;
    top: 15%;
}

.auth-back {
    position: relative;
    z-index: 2;
    align-self: flex-start;
    color: rgba(255, 255, 255, .86);
    text-decoration: none;
    font-weight: 600;
    transition: .2s ease;
}

.auth-back:hover {
    color: #fff;
    transform: translateX(-4px);
}

.auth-visual-content {
    position: relative;
    z-index: 2;
    max-width: 650px;
}

.auth-kicker {
    margin: 0 0 18px;
    color: #f1cc58;
    font-weight: 800;
    letter-spacing: .18em;
    text-transform: uppercase;
}

.auth-anniversary {
    position: absolute;
    top: -190px;
    right: -20px;
    color: rgba(255, 255, 255, .08);
    font-size: clamp(16rem, 34vw, 34rem);
    line-height: .8;
    font-weight: 800;
    pointer-events: none;
}

.auth-visual h1 {
    position: relative;
    margin: 0 0 24px;
    font-size: clamp(2.6rem, 5vw, 5.1rem);
    line-height: .98;
    letter-spacing: -.05em;
}

.auth-visual-content > p:last-child {
    max-width: 560px;
    margin: 0;
    color: rgba(255, 255, 255, .78);
    font-size: 1.05rem;
    line-height: 1.75;
}

.auth-visual-footer {
    position: relative;
    z-index: 2;
    color: rgba(255, 255, 255, .58);
    font-size: .9rem;
}

.auth-panel {
    min-height: 100vh;
    padding: 42px clamp(28px, 6vw, 88px);
    display: grid;
    place-items: center;
}

.auth-card {
    width: min(100%, 500px);
}

.auth-heading {
    margin-bottom: 28px;
}

.auth-heading-label {
    margin: 0 0 10px;
    color: var(--auth-gold);
    font-weight: 800;
    font-size: .78rem;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.auth-heading h2,
.account-card h2 {
    margin: 0;
    color: var(--auth-navy);
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.05;
    letter-spacing: -.04em;
}

.auth-heading > p:last-child {
    margin: 13px 0 0;
    color: var(--auth-muted);
    line-height: 1.6;
}

.auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin-bottom: 26px;
    padding: 5px;
    border-radius: 14px;
    background: #e9edf2;
}

.auth-tab {
    min-height: 46px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #647386;
    font-weight: 700;
    cursor: pointer;
    transition: .2s ease;
}

.auth-tab.is-active {
    background: #fff;
    color: var(--auth-navy);
    box-shadow: 0 8px 22px rgba(11, 31, 58, .08);
}

.auth-alert {
    margin: 0 0 18px;
    padding: 13px 15px;
    border-radius: 11px;
    font-size: .92rem;
    line-height: 1.45;
}

.auth-alert.is-error {
    color: var(--auth-danger);
    background: #fef0ef;
    border: 1px solid #f4c7c3;
}

.auth-alert.is-success {
    color: var(--auth-success);
    background: #edf9f3;
    border: 1px solid #bce4cf;
}

.auth-form[hidden] {
    display: none !important;
}

.auth-form:not([hidden]) {
    display: grid;
    gap: 17px;
    animation: auth-form-in .22s ease;
}

@keyframes auth-form-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-field {
    display: grid;
    gap: 8px;
}

.auth-field > span:first-child,
.auth-class-field legend {
    color: #243a55;
    font-size: .9rem;
    font-weight: 700;
}

.auth-class-field {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.auth-class-field legend {
    margin-bottom: 8px;
    padding: 0;
}

.class-selects {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 140px;
    gap: 10px;
}

.class-selects label {
    min-width: 0;
}

.auth-field input,
.auth-field select {
    width: 100%;
    min-height: 52px;
    padding: 0 15px;
    border: 1px solid var(--auth-border);
    border-radius: 12px;
    outline: none;
    color: var(--auth-navy);
    background: #fff;
    transition: .2s ease;
}

.auth-field select {
    appearance: none;
    cursor: pointer;
    background-image:
        linear-gradient(45deg, transparent 50%, #66758a 50%),
        linear-gradient(135deg, #66758a 50%, transparent 50%);
    background-position:
        calc(100% - 18px) 22px,
        calc(100% - 13px) 22px;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    padding-right: 38px;
}

.auth-field input:focus,
.auth-field select:focus {
    border-color: #5d7da2;
    box-shadow: 0 0 0 4px rgba(22, 59, 103, .09);
}

.auth-field input.is-invalid,
.auth-field select.is-invalid {
    border-color: #d92d20;
    box-shadow: 0 0 0 4px rgba(217, 45, 32, .07);
}

.password-input {
    position: relative;
    display: block;
}

.password-input input {
    padding-right: 92px;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    padding: 5px;
    color: #66758a;
    background: transparent;
    font-size: .82rem;
    font-weight: 700;
    cursor: pointer;
}

.field-error {
    min-height: 0;
    color: var(--auth-danger);
    font-size: .78rem;
    line-height: 1.35;
}

.auth-consent {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    color: var(--auth-muted);
    font-size: .85rem;
    line-height: 1.45;
    cursor: pointer;
}

.auth-consent input {
    width: 17px;
    height: 17px;
    margin: 2px 0 0;
    accent-color: var(--auth-blue);
}

.consent-error {
    margin-top: -12px;
}

.auth-submit {
    width: 100%;
    min-height: 54px;
    margin-top: 4px;
    padding: 0 18px;
    border: 0;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #fff;
    background: var(--auth-navy);
    text-decoration: none;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 14px 30px rgba(8, 27, 53, .18);
    transition: .2s ease;
}

.auth-submit:hover {
    transform: translateY(-2px);
    background: #102f57;
    box-shadow: 0 18px 34px rgba(8, 27, 53, .23);
}

.auth-submit:disabled {
    opacity: .65;
    cursor: wait;
    transform: none;
}

.auth-secondary-link {
    border: 0;
    padding: 2px;
    color: var(--auth-blue);
    background: transparent;
    font-weight: 700;
    cursor: pointer;
}

.auth-demo-note {
    margin: 24px 0 0;
    color: #8995a5;
    font-size: .78rem;
    line-height: 1.5;
    text-align: center;
}

.account-card {
    text-align: center;
}

.account-avatar {
    width: 88px;
    height: 88px;
    margin: 24px auto 20px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(135deg, var(--auth-blue), var(--auth-navy));
    font-size: 2.2rem;
    font-weight: 800;
    box-shadow: 0 16px 34px rgba(8, 27, 53, .2);
}

.account-email {
    margin: 10px 0 28px;
    color: var(--auth-muted);
}

.account-details {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 24px;
    text-align: left;
}

.account-details > div {
    padding: 16px;
    border: 1px solid var(--auth-border);
    border-radius: 12px;
    background: #fff;
}

.account-details span,
.account-details strong {
    display: block;
}

.account-details span {
    margin-bottom: 6px;
    color: var(--auth-muted);
    font-size: .75rem;
}

.account-details strong {
    color: var(--auth-navy);
    font-size: .9rem;
}

.account-actions {
    display: grid;
    gap: 12px;
}

.account-primary {
    margin: 0;
}

.account-link,
.account-logout {
    min-height: 46px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    font-weight: 700;
}


.account-link[hidden] {
    display: none !important;
}

.account-link {
    border: 1px solid var(--auth-border);
    color: var(--auth-blue);
    background: #fff;
    text-decoration: none;
}

.account-logout {
    border: 0;
    color: var(--auth-danger);
    background: transparent;
    cursor: pointer;
}

.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;
}

@media (max-width: 960px) {
    .auth-page {
        grid-template-columns: 1fr;
    }

    .auth-visual {
        min-height: 390px;
        padding: 28px 7vw 44px;
    }

    .auth-anniversary {
        top: -90px;
        right: 0;
        font-size: 20rem;
    }

    .auth-visual h1 {
        max-width: 650px;
        font-size: clamp(2.7rem, 9vw, 5rem);
    }

    .auth-panel {
        min-height: auto;
        padding: 58px 24px 72px;
    }
}

@media (max-width: 560px) {
    .auth-visual {
        min-height: 340px;
    }

    .auth-visual-content > p:last-child,
    .auth-visual-footer {
        display: none;
    }

    .auth-panel {
        padding-left: 18px;
        padding-right: 18px;
    }

    .class-selects {
        grid-template-columns: minmax(0, 1fr) 110px;
    }

    .account-details {
        grid-template-columns: 1fr;
    }
}

/* Registration role selector */
.auth-role-field {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.auth-role-field legend {
    margin-bottom: 8px;
    padding: 0;
    color: #243a55;
    font-size: .9rem;
    font-weight: 700;
}

.role-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.role-option {
    position: relative;
    min-width: 0;
    cursor: pointer;
}

.role-option input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.role-option-content {
    min-height: 76px;
    padding: 14px 15px;
    border: 1px solid var(--auth-border);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    background: #fff;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease, transform .18s ease;
}

.role-option-content strong,
.role-option-content small {
    display: block;
}

.role-option-content strong {
    color: var(--auth-navy);
    font-size: .93rem;
}

.role-option-content small {
    color: var(--auth-muted);
    font-size: .75rem;
    line-height: 1.3;
}

.role-option:hover .role-option-content {
    border-color: #aab8c8;
    transform: translateY(-1px);
}

.role-option input:focus-visible + .role-option-content {
    box-shadow: 0 0 0 4px rgba(22, 59, 103, .11);
}

.role-option input:checked + .role-option-content {
    border-color: var(--auth-blue);
    background: #f5f8fc;
    box-shadow: inset 0 0 0 1px var(--auth-blue), 0 8px 18px rgba(8, 27, 53, .07);
}

.role-option input:checked + .role-option-content::before {
    content: "✓";
    position: absolute;
    top: 10px;
    right: 11px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #fff;
    background: var(--auth-blue);
    font-size: .72rem;
    font-weight: 800;
}

/* Four profile facts fit better as a compact 2x2 grid. */
.account-details {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 560px) {
    .role-options {
        grid-template-columns: 1fr;
    }

    .role-option-content {
        min-height: 66px;
    }
}

@media (max-width: 560px) {
    .account-details {
        grid-template-columns: 1fr;
    }
}
