:root {
    --campus-navy: #073b73;
    --campus-blue: #1266a8;
    --campus-red: #d71920;
    --campus-ink: #102749;
    --campus-muted: #60728f;
    --campus-border: #cfdbef;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body.auth-portal {
    min-height: 100%;
    margin: 0;
}

body.auth-portal {
    background: #eaf1ff;
    color: var(--campus-ink);
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

.auth-shell {
    display: grid;
    grid-template-columns: minmax(0, 57fr) minmax(0, 43fr);
    min-height: 100vh;
}

.auth-branding {
    position: sticky;
    top: 0;
    align-self: start;
    min-width: 0;
    height: 100vh;
    overflow: hidden;
    background: #c8dcfb;
}

.auth-branding-art {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.auth-branding-copy {
    position: absolute;
    top: 22%;
    left: 50%;
    z-index: 1;
    display: flex;
    width: min(86%, 620px);
    min-height: 25%;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 14px clamp(16px, 2.2vw, 26px);
    border: 1px solid rgba(255, 255, 255, .9);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 16px 36px rgba(7, 59, 115, .14);
    text-align: center;
    transform: translateX(-50%);
}

.auth-branding-copy h2 {
    margin: 0;
    color: var(--campus-navy);
    font-size: clamp(20px, 2.2vw, 29px);
    font-weight: 750;
    letter-spacing: -.03em;
    line-height: 1.12;
}

.auth-branding-copy h2 span {
    color: var(--campus-red);
}

.auth-branding-copy p {
    margin: 8px 0 0;
    color: var(--campus-muted);
    font-size: clamp(12px, 1.05vw, 15px);
    line-height: 1.4;
}

.auth-branding-accessible,
.auth-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.auth-panel {
    display: flex;
    min-width: 0;
    min-height: calc(100vh - 60px);
    align-items: center;
    justify-content: center;
    margin: 30px 40px 30px 0;
    padding: 36px clamp(28px, 4vw, 58px);
    border: 1px solid rgba(255, 255, 255, .85);
    border-radius: 22px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 18px 48px rgba(32, 67, 117, .17);
}

.auth-content {
    width: 100%;
    max-width: 445px;
    animation: auth-enter .4s ease-out both;
}

.auth-logo {
    display: block;
    width: min(100%, 550px);
    max-height: 100px;
    margin: 0 auto 25px;
    object-fit: contain;
}

.auth-heading {
    margin-bottom: 25px;
    text-align: center;
}

.auth-heading h1 {
    margin: 0 0 8px;
    color: #111b31;
    font-size: clamp(25px, 2.1vw, 29px);
    font-weight: 750;
    letter-spacing: -.035em;
    line-height: 1.2;
}

.auth-heading p {
    margin: 0;
    color: #172b4c;
    font-size: 14px;
    line-height: 1.55;
}

.auth-form {
    width: 100%;
}

.auth-field {
    margin-bottom: 15px;
}

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

.auth-input-wrap > .auth-input-icon {
    position: absolute;
    top: 50%;
    left: 19px;
    z-index: 1;
    color: var(--campus-navy);
    font-size: 17px;
    pointer-events: none;
    transform: translateY(-50%);
}

.auth-input {
    display: block;
    width: 100%;
    height: 56px;
    padding: 0 50px 0 61px;
    border: 1px solid var(--campus-border);
    border-radius: 14px;
    outline: none;
    background: #fbfcff;
    color: var(--campus-ink);
    font: inherit;
    font-size: 15px;
    transition: border-color .18s ease, box-shadow .18s ease;
}

.auth-input::placeholder {
    color: #667b9e;
    opacity: 1;
}

.auth-input:focus {
    border-color: var(--campus-blue);
    box-shadow: 0 0 0 4px rgba(18, 102, 168, .12);
}

.auth-input.is-invalid {
    border-color: #dc3545;
}

.auth-input-toggle {
    position: absolute;
    top: 50%;
    right: 13px;
    display: inline-flex;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #7487a6;
    cursor: pointer;
    transform: translateY(-50%);
}

.auth-input-toggle:hover,
.auth-input-toggle:focus {
    background: #edf3fd;
    color: var(--campus-navy);
    outline: 2px solid rgba(18, 102, 168, .28);
}

.auth-field-error {
    display: block;
    margin-top: 7px;
    color: #bd2433;
    font-size: 13px;
}

.auth-error,
.auth-success {
    margin-bottom: 18px;
    padding: 12px 14px;
    border: 1px solid #f2c5ca;
    border-radius: 10px;
    background: #fff4f5;
    color: #a51f2b;
    font-size: 13px;
}

.auth-success {
    border-color: #cce8d7;
    background: #f0faf4;
    color: #22623c;
}

.auth-options {
    display: flex;
    min-height: 24px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 2px 0 23px;
    font-size: 13px;
}

.auth-remember {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: #263b5b;
    cursor: pointer;
}

.auth-remember input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--campus-blue);
}

.auth-link {
    color: #0864cc;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

.auth-link:hover,
.auth-link:focus {
    color: var(--campus-navy);
    text-decoration: underline;
}

.auth-submit {
    display: flex;
    width: 100%;
    min-height: 56px;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(105deg, #073b73, #063879);
    box-shadow: 0 8px 18px rgba(7, 59, 115, .12);
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    transition: box-shadow .18s ease, transform .18s ease;
}

.auth-submit:hover {
    box-shadow: 0 12px 23px rgba(7, 59, 115, .2);
    transform: translateY(-1px);
}

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

.auth-submit:focus {
    outline: 3px solid rgba(18, 102, 168, .3);
    outline-offset: 3px;
}

.auth-security {
    display: flex;
    min-height: 72px;
    align-items: center;
    gap: 16px;
    margin-top: 21px;
    padding: 13px 18px;
    border-radius: 14px;
    background: linear-gradient(100deg, #e5eeff, #eaf1ff);
    color: #14294b;
    font-size: 13px;
    line-height: 1.4;
}

.auth-security-icon {
    display: inline-flex;
    width: 56px;
    height: 48px;
    flex: 0 0 56px;
    align-items: center;
    justify-content: center;
    border-right: 1px solid #7d96bb;
    color: #1266c5;
    font-size: 32px;
}

.auth-footer {
    margin-top: 21px;
    padding-top: 15px;
    border-top: 1px solid #e0e7f2;
    color: #24395a;
    font-size: 11px;
    text-align: center;
}

.auth-return-link {
    margin: 16px 0 0;
    font-size: 13px;
    text-align: center;
}

.auth-return-link a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--campus-blue);
    font-weight: 650;
    text-decoration: none;
}

.auth-return-link a:hover,
.auth-return-link a:focus {
    color: var(--campus-navy);
    text-decoration: underline;
}

.auth-code-input {
    padding-left: 32px;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: .35em;
    text-align: center;
}

.auth-code-instructions {
    margin: -7px 0 24px;
    color: var(--campus-muted);
    font-size: 13px;
    line-height: 1.55;
    text-align: center;
}

.auth-code-instructions strong {
    color: var(--campus-navy);
    overflow-wrap: anywhere;
}

.auth-resend-form {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 10px;
    margin-top: 12px;
}

.auth-logout-form {
    margin-top: 8px;
}

.auth-secondary-action {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 0;
    padding: 7px 0;
    border: 0;
    background: transparent;
    color: var(--campus-blue);
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 650;
}

.auth-secondary-action:hover,
.auth-secondary-action:focus {
    color: var(--campus-navy);
    text-decoration: underline;
}

.auth-secondary-action:disabled {
    color: #8a98a9;
    cursor: not-allowed;
    text-decoration: none;
}

.auth-secondary-action:focus {
    outline: 2px solid rgba(18, 102, 168, .28);
    outline-offset: 3px;
}

.auth-resend-countdown {
    color: var(--campus-muted);
    font-size: 12px;
}

.auth-logout-action {
    color: #65768a;
}

@keyframes auth-enter {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 1100px) {
    .auth-shell {
        grid-template-columns: minmax(0, 1fr);
    }

    .auth-branding {
        position: relative;
        top: auto;
        height: min(72vw, 560px);
        min-height: 280px;
        align-self: auto;
    }

    .auth-branding::before {
        position: absolute;
        inset: -24px;
        z-index: 0;
        background: url("../auth/campussphere-brand-panel.webp") center / cover no-repeat;
        content: "";
        filter: blur(20px);
        opacity: .55;
    }

    .auth-branding-art {
        z-index: 1;
        object-fit: contain;
    }

    .auth-panel {
        min-height: 0;
        margin: 20px;
        padding: 38px clamp(22px, 7vw, 58px);
    }

    .auth-content {
        max-width: 460px;
    }
}

@media (max-width: 560px) {
    .auth-branding {
        height: min(78vw, 360px);
        min-height: 245px;
    }

    .auth-branding-copy {
        top: 20%;
        min-height: 24%;
    }

    .auth-branding-copy h2 {
        font-size: clamp(18px, 5vw, 24px);
    }

    .auth-branding-copy p {
        font-size: 12px;
    }

    .auth-panel {
        margin: 14px;
        padding: 28px 20px;
        border-radius: 18px;
    }

    .auth-logo {
        width: min(100%, 310px);
        max-height: 62px;
        margin-bottom: 24px;
    }

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

    .auth-heading h1 {
        font-size: 25px;
    }

    .auth-input:not(.auth-code-input) {
        font-size: 16px;
    }

    .auth-options {
        align-items: flex-start;
        font-size: 12px;
    }

    .auth-link {
        font-size: 12px;
    }

    .auth-security {
        gap: 12px;
        padding: 12px;
        font-size: 12px;
    }

    .auth-security-icon {
        width: 48px;
        flex-basis: 48px;
        font-size: 28px;
    }
}

@media (max-width: 360px) {
    .auth-panel {
        margin: 10px;
        padding: 25px 16px;
    }

    .auth-options {
        gap: 8px;
        font-size: 11px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}
