:root {
    --login-maroon: #800000;
    --login-maroon-dark: #5f0000;
    --login-gold: #ffdf00;
    --login-goldenrod: #daa520;
    --login-ink: #1f1620;
    --login-muted: #555555;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Poppins", sans-serif;
    background:
        radial-gradient(
            circle at 10% 8%,
            rgba(255, 223, 0, 0.2) 0%,
            rgba(255, 223, 0, 0) 25%
        ),
        radial-gradient(
            circle at 88% 12%,
            rgba(218, 165, 32, 0.2) 0%,
            rgba(218, 165, 32, 0) 25%
        ),
        linear-gradient(rgba(19, 10, 11, 0.68), rgba(19, 10, 11, 0.68)),
        url("../assets/images/PUPT-picture.jpg") center/cover no-repeat;
}

.login-page {
    width: 100%;
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.2rem;
}

.login-card {
    width: min(100%, 460px);
    background: linear-gradient(
        175deg,
        rgba(255, 255, 255, 0.97) 0%,
        rgba(255, 248, 228, 0.97) 100%
    );
    border-radius: 1.25rem;
    padding: 2rem 1.65rem 1.45rem;
    border: 1px solid rgba(128, 0, 0, 0.14);
    box-shadow: 0 28px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
    max-height: calc(100svh - 2rem);
    overflow-y: auto;
}

.login-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 6px;
    background: linear-gradient(
        90deg,
        var(--login-maroon) 0%,
        var(--login-goldenrod) 45%,
        var(--login-maroon-dark) 100%
    );
}

.login-card .logo {
    width: 90px;
    height: 90px;
    object-fit: contain;
    display: block;
    margin: 0 auto 0.75rem;
    background: #fff;
    border-radius: 999px;
    border: 3px solid rgba(128, 0, 0, 0.15);
    padding: 0.32rem;
}

.module-chip {
    margin: 0 auto 0.6rem;
    width: fit-content;
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--login-maroon);
    background: rgba(128, 0, 0, 0.1);
    border-radius: 999px;
    padding: 0.35rem 0.72rem;
}

.login-card h2 {
    text-align: center;
    color: var(--login-maroon);
    font-weight: 800;
    margin-bottom: 0.4rem;
}

.subtitle {
    text-align: center;
    color: var(--login-muted);
    margin-bottom: 1.2rem;
}

.login-card .form-label {
    color: #555555;
    font-weight: 600;
}

.login-card .form-control {
    border: 1px solid rgba(128, 0, 0, 0.2);
    border-radius: 0.72rem;
    min-height: 46px;
    font-size: 0.96rem;
}

.login-card .form-control:focus {
    border-color: rgba(128, 0, 0, 0.45);
    box-shadow: 0 0 0 0.2rem rgba(128, 0, 0, 0.12);
}

.password-wrapper {
    position: relative;
}

.password-wrapper input {
    padding-right: 46px;
}

.toggle-password {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    color: #555555;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.login-btn {
    border: none !important;
    min-height: 48px;
    border-radius: 0.78rem;
    font-size: 0.98rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #fff;
    background: linear-gradient(
        135deg,
        var(--login-maroon) 0%,
        var(--login-maroon-dark) 100%
    ) !important;
    box-shadow: 0 12px 22px rgba(128, 0, 0, 0.22);
    padding-inline: 1rem;
}

.login-btn:hover {
    color: #fff;
    filter: none;
    background: linear-gradient(135deg, #b8860b 0%, #9c7109 100%) !important;
    border-color: #b8860b;
    box-shadow: 0 12px 22px rgba(184, 134, 11, 0.28);
}

.login-error {
    border-radius: 0.72rem;
    border: 1px solid rgba(128, 0, 0, 0.2);
    background: #fff5f5;
    color: #5f0000;
    font-size: 0.9rem;
    padding: 0.6rem 0.72rem;
    margin-bottom: 1rem;
}

.login-success {
    border-radius: 0.72rem;
    border: 1px solid rgba(21, 87, 36, 0.2);
    background: #f1f8f2;
    color: #155724;
    font-size: 0.9rem;
    padding: 0.6rem 0.72rem;
    margin-bottom: 1rem;
}

.login-success i {
    margin-right: 0.35rem;
}

.login-error i {
    margin-right: 0.35rem;
}

.footer-links {
    margin-top: 1rem;
    display: flex;
    justify-content: space-between;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.footer-links a {
    text-decoration: none;
    color: #555555;
    font-size: 0.86rem;
    font-weight: 600;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    padding: 0.12rem 0;
}

.footer-links a:hover {
    color: var(--login-maroon);
}

@media (max-width: 576px) {
    .login-page {
        padding: 0.85rem;
        align-items: flex-start;
    }

    .login-card {
        padding: 1.45rem 1rem 1rem;
        border-radius: 1rem;
        max-height: calc(100svh - 1.7rem);
    }

    .login-card .logo {
        width: 76px;
        height: 76px;
    }

    .module-chip {
        font-size: 0.66rem;
        letter-spacing: 0.08em;
        padding: 0.3rem 0.52rem;
    }

    .login-card h2 {
        font-size: 1.45rem;
    }

    .subtitle {
        font-size: 0.88rem;
        margin-bottom: 0.9rem;
    }

    .login-card .form-label {
        font-size: 0.9rem;
    }

    .login-card .form-control {
        min-height: 44px;
    }

    .footer-links {
        margin-top: 0.85rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.28rem;
    }

    .footer-links a {
        font-size: 0.74rem;
    }
}

@media (max-width: 380px) {
    .login-page {
        padding: 0.6rem;
    }

    .login-card {
        padding: 1.2rem 0.85rem 0.85rem;
    }

    .login-card h2 {
        font-size: 1.3rem;
    }

    .login-btn {
        min-height: 44px;
        font-size: 0.9rem;
    }
}

@media (max-height: 740px) {
    .login-page {
        align-items: flex-start;
        padding-top: 0.85rem;
        padding-bottom: 0.85rem;
    }

    .login-card {
        max-height: calc(100svh - 1.7rem);
    }
}

/* Shared authentication surface for sign-in, recovery, and verification flows. */
:root {
    --login-maroon: #800000;
    --login-maroon-dark: #5f0000;
    --login-gold: #ffdf00;
    --login-goldenrod: #daa520;
    --login-ink: #1f1620;
    --login-muted: #555555;
}

body {
    overflow: auto;
    background:
        linear-gradient(120deg, rgba(60, 0, 0, 0.9), rgba(128, 0, 0, 0.67)),
        url("../assets/images/PUPT-picture.jpg") center/cover fixed;
}

.login-page {
    position: relative;
    isolation: isolate;
    padding: 2rem 1rem;
}

.login-page::before,
.login-page::after {
    position: fixed;
    z-index: -1;
    width: 23rem;
    height: 23rem;
    content: "";
    pointer-events: none;
    border-radius: 50%;
}

.login-page::before {
    top: -10rem;
    right: -8rem;
    background: radial-gradient(
        circle,
        rgba(255, 223, 0, 0.34),
        transparent 68%
    );
}

.login-page::after {
    bottom: -12rem;
    left: -9rem;
    background: radial-gradient(circle, rgba(128, 0, 0, 0.33), transparent 68%);
}

.login-card {
    width: min(100%, 490px);
    max-height: none;
    padding: clamp(1.6rem, 4vw, 2.5rem);
    overflow: visible;
    background: rgba(249, 246, 242, 0.97);
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 1.6rem;
    box-shadow: 0 28px 70px rgba(16, 4, 6, 0.4);
}

.login-card::before {
    top: 0;
    right: 0;
    left: 0;
    height: 6px;
    background: linear-gradient(
        90deg,
        var(--login-maroon-dark),
        var(--login-gold),
        var(--login-maroon)
    );
}

.login-card .logo {
    width: 82px;
    height: 82px;
    padding: 0.28rem;
    margin-bottom: 0.9rem;
    border: 0;
    border-radius: 1.1rem;
    box-shadow: 0 10px 22px rgba(128, 0, 0, 0.16);
}

.module-chip {
    margin-bottom: 0.65rem;
    color: var(--login-maroon);
    font-size: 0.66rem;
    letter-spacing: 0.12em;
    background: #fff3cd;
    border: 1px solid rgba(218, 165, 32, 0.25);
}

.login-card h2 {
    margin-bottom: 0.45rem;
    color: var(--login-maroon-dark);
    font-size: clamp(1.5rem, 4vw, 1.85rem);
    letter-spacing: -0.03em;
}

.subtitle {
    max-width: 360px;
    margin-right: auto;
    margin-left: auto;
    font-size: 0.88rem;
    line-height: 1.55;
}

.login-card .form-label {
    margin-bottom: 0.42rem;
    color: #555555;
    font-size: 0.84rem;
}

.login-card .form-control {
    min-height: 50px;
    padding: 0.7rem 0.85rem;
    color: var(--login-ink);
    background: #fff;
    border: 1px solid rgba(128, 0, 0, 0.16);
    border-radius: 0.8rem;
    box-shadow: inset 0 1px 2px rgba(128, 0, 0, 0.03);
}

.login-card .form-control::placeholder {
    color: #888888;
}

.login-card .form-control:focus {
    border-color: rgba(128, 0, 0, 0.56);
    box-shadow: 0 0 0 0.22rem rgba(128, 0, 0, 0.12);
}

.toggle-password {
    color: var(--login-maroon);
}

.toggle-password:hover,
.toggle-password:focus-visible {
    color: var(--login-maroon-dark);
    background: #fff3cd;
}

.login-card .btn {
    min-height: 48px;
    padding: 0.65rem 1rem;
    border-radius: 0.8rem;
    font-size: 0.9rem;
    font-weight: 700;
    transition:
        transform 180ms ease,
        box-shadow 180ms ease,
        background-color 180ms ease;
}

.login-card .btn:hover {
    transform: translateY(-2px);
}

.login-card .btn:focus-visible,
.toggle-password:focus-visible,
.footer-links a:focus-visible {
    outline: 3px solid rgba(255, 223, 0, 0.82);
    outline-offset: 3px;
}

.login-card .login-btn,
.login-card .btn-success {
    color: #fff;
    background: linear-gradient(
        135deg,
        var(--login-maroon),
        var(--login-maroon-dark)
    ) !important;
    border-color: var(--login-maroon-dark) !important;
    box-shadow: 0 12px 20px rgba(128, 0, 0, 0.22);
}

.login-card .btn-outline-success,
.login-card .btn-outline-primary,
.login-card .btn-outline-secondary {
    color: var(--login-maroon);
    background: #fff;
    border-color: rgba(128, 0, 0, 0.25);
}

.login-card .btn-outline-success:hover,
.login-card .btn-outline-primary:hover,
.login-card .btn-outline-secondary:hover {
    color: #fff;
    background: var(--login-maroon);
    border-color: var(--login-maroon);
}

.login-card .btn-outline-danger {
    color: #8b252d;
    border-color: rgba(139, 37, 45, 0.35);
}

.login-card .alert {
    border-radius: 0.85rem;
    font-size: 0.84rem;
    line-height: 1.5;
}

.login-card .alert-warning {
    color: #68450d;
    background: #fff8e5;
    border-color: #f0d993;
}

.login-error {
    border-color: rgba(139, 37, 45, 0.24);
    background: #fff2f2;
    color: #7b1e26;
}

.login-success {
    border-color: rgba(21, 87, 36, 0.24);
    background: #f1f8f2;
    color: #155724;
}

.footer-links {
    padding-top: 0.35rem;
    border-top: 1px solid rgba(128, 0, 0, 0.1);
}

.footer-links a {
    color: #555555;
}

.footer-links a:hover {
    color: var(--login-maroon);
}

@media (max-width: 576px) {
    .login-page {
        padding: 1rem 0.75rem;
    }
    .login-card {
        max-height: none;
        padding: 1.5rem 1.1rem;
        border-radius: 1.25rem;
    }
    .login-card .logo {
        width: 70px;
        height: 70px;
        border-radius: 0.9rem;
    }
    .module-chip {
        font-size: 0.52rem;
    }
    .login-card .btn,
    .login-card .form-control {
        min-height: 46px;
    }
}

.login-card .login-input-group {
    overflow: hidden;
    border: 1px solid rgba(128, 0, 0, 0.16);
    border-radius: 0.8rem;
    box-shadow: inset 0 1px 2px rgba(128, 0, 0, 0.03);
}

.login-card .login-input-group:focus-within {
    border-color: rgba(128, 0, 0, 0.56);
    box-shadow: 0 0 0 0.22rem rgba(128, 0, 0, 0.12);
}

.login-card .login-input-group .input-group-text {
    padding: 0.7rem 0.25rem 0.7rem 0.85rem;
    color: var(--login-maroon);
    background: #fff;
    border: 0;
}

.login-card .login-input-group .form-control {
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.login-card .login-input-group .form-control:focus {
    box-shadow: none;
}

.password-wrapper .password-input-icon {
    position: absolute;
    z-index: 1;
    top: 50%;
    left: 0.85rem;
    color: var(--login-maroon);
    pointer-events: none;
    transform: translateY(-50%);
}

.password-wrapper input {
    padding-left: 2.5rem;
}

/* System-logo.png already includes its own rounded white field. */
.login-card .logo {
    width: 88px;
    height: 88px;
    padding: 0;
    background: transparent;
    border-radius: 1rem;
    box-shadow: none;
}

.password-policy {
    margin: -0.15rem 0 1.25rem;
    padding: 0.85rem;
    color: #555555;
    background: #fff8e5;
    border: 1px solid #f0d993;
    border-radius: 0.85rem;
}

.password-policy-heading {
    display: flex;
    gap: 0.45rem;
    align-items: center;
    margin-bottom: 0.45rem;
    color: var(--login-maroon-dark);
}

.password-policy-heading i {
    color: #daa520;
}

.password-policy h3 {
    margin: 0;
    font-size: 0.82rem;
    font-weight: 700;
}

.password-policy ul {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.3rem 0.65rem;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 0.72rem;
}

.password-policy li {
    display: flex;
    gap: 0.35rem;
    align-items: center;
}

.password-policy li i {
    color: #9d8e74;
}

.password-policy li.is-met {
    color: #256c45;
}

.password-policy li.is-met i {
    color: #27804c;
}

#resetPasswordSubmit:disabled {
    cursor: not-allowed;
    opacity: 0.55;
    box-shadow: none;
    transform: none;
}

@media (max-width: 576px) {
    .login-card .logo {
        width: 72px;
        height: 72px;
        border-radius: 0.85rem;
    }

    .password-policy ul {
        grid-template-columns: 1fr;
    }
}

.password-policy-preview {
    margin: 0 0 1.25rem;
}

.password-policy-preview p {
    margin: 0;
    font-size: 0.72rem;
    line-height: 1.5;
}

/* Shared portal layout for every authentication route. */
.auth-portal-page {
    min-height: 100vh;
    min-height: 100svh;
    display: grid;
    place-items: center;
    padding: 2rem;
    background:
        linear-gradient(115deg, rgba(60, 0, 0, 0.84), rgba(128, 0, 0, 0.58)),
        url("../assets/images/PUPT-picture.jpg") center/cover fixed;
}

.auth-portal-shell {
    display: grid;
    grid-template-columns: minmax(360px, 0.96fr) minmax(390px, 1.04fr);
    width: min(100% - 2rem, 1040px);
    min-height: min(620px, calc(100svh - 4rem));
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 1.8rem;
    box-shadow: 0 30px 80px rgba(16, 4, 6, 0.46);
    animation: none;
}

.auth-portal-brand {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(2rem, 5vw, 4rem);
    color: #fff;
    background:
        linear-gradient(145deg, rgba(95, 0, 0, 0.96), rgba(128, 0, 0, 0.86)),
        url("../assets/images/PUPT-picture.jpg") center/cover;
}

.auth-brand-heading {
    display: flex;
    gap: 1.2rem;
    align-items: center;
    margin-bottom: 2rem;
}

.auth-brand-mark {
    display: block;
    width: 100px;
    flex: 0 0 auto;
    transition: transform 220ms ease;
}

.auth-brand-mark:hover {
    transform: translateY(-4px) rotate(-2deg);
}
.auth-brand-mark img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 1rem;
}
.auth-brand-campus {
    margin: 0 0 0.45rem;
    color: #ffdf00;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.auth-portal-brand h1 {
    margin: 0;
    color: #fff;
    font-size: clamp(2.2rem, 4vw, 3.5rem);
    font-weight: 800;
    letter-spacing: -0.06em;
    line-height: 0.95;
}
.auth-brand-system {
    margin: 0.55rem 0 0;
    color: rgba(255, 255, 255, 0.85);
    font-size: 1rem;
    font-weight: 600;
}
.auth-brand-description {
    max-width: 400px;
    margin: 0 0 1.4rem;
    color: rgba(255, 255, 255, 0.83);
    font-size: 1rem;
    line-height: 1.7;
}

.auth-brand-highlights {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.auth-brand-highlights span {
    display: inline-flex;
    gap: 0.38rem;
    align-items: center;
    padding: 0.38rem 0.66rem;
    color: #fff7dd;
    font-size: 0.72rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.11);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
}

.auth-brand-highlights i {
    color: #ffdf00;
}

.auth-brand-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.2rem 0.45rem;
    align-items: center;
    margin-top: 1.3rem;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.7rem;
    text-align: center;
}

.auth-brand-footer a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    color: inherit;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    transition: color 220ms ease;
}

.auth-brand-footer a:hover {
    color: #ffdf00;
}

.auth-brand-separator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0.7rem;
}

.auth-portal-content {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    padding: clamp(1.5rem, 4vw, 3.5rem);
    background:
        radial-gradient(
            circle at 100% 0,
            rgba(255, 223, 0, 0.25),
            transparent 32%
        ),
        #f9f6f2;
    animation: auth-content-enter 520ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.auth-content-card {
    width: 100%;
    max-width: none;
    min-height: 0;
    height: auto;
}

.auth-content-card .module-chip {
    margin: 0 0 0.7rem;
}
.auth-content-card h2 {
    margin-top: 0;
    text-align: left;
}
.auth-content-card .subtitle {
    margin: 0 0 1.5rem;
    text-align: left;
}
.auth-content-card .footer-links {
    justify-content: space-between;
}
.auth-content-card .login-card {
    width: 100%;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}
.auth-content-card .login-card::before {
    display: none;
}
.auth-content-card .login-card .logo {
    display: none;
}

@keyframes auth-content-enter {
    from {
        opacity: 0;
        transform: translateX(22px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@media (max-width: 850px) {
    .auth-portal-page {
        padding: 1rem;
    }
    .auth-portal-shell {
        grid-template-columns: 1fr;
        width: min(100% - 1.5rem, 560px);
        min-height: 0;
        border-radius: 1.35rem;
    }
    .auth-portal-brand {
        padding: 1.5rem;
    }
    .auth-brand-heading {
        gap: 0.9rem;
        margin-bottom: 1rem;
    }
    .auth-brand-mark {
        width: 72px;
    }
    .auth-portal-brand h1 {
        font-size: 2rem;
    }
    .auth-brand-system {
        margin: 0.4rem 0 0;
        font-size: 0.85rem;
    }
    .auth-brand-description {
        display: none;
    }
    .auth-brand-highlights,
    .auth-brand-footer {
        display: none;
    }
    .auth-portal-content {
        padding: 1.5rem;
    }
    .auth-content-card {
        max-width: 500px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-portal-shell,
    .auth-content-card,
    .auth-brand-mark {
        animation: none;
        transition: none;
    }
}

/* The identity panel stays fixed; only the white content panel transitions. */
.auth-portal-shell {
    transform: translateZ(0);
}

.auth-portal-brand {
    position: relative;
    overflow: hidden;
}

.auth-portal-brand::after {
    position: absolute;
    inset: auto -12% -34% auto;
    width: 16rem;
    height: 16rem;
    content: "";
    pointer-events: none;
    background: radial-gradient(
        circle,
        rgba(255, 223, 0, 0.2),
        transparent 68%
    );
    border-radius: 50%;
}

.auth-portal-content {
    overflow: hidden auto;
}

.auth-content-card {
    position: relative;
    padding: clamp(1.35rem, 3vw, 2rem);
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(128, 0, 0, 0.1);
    border-radius: 1.35rem;
    box-shadow: 0 18px 42px rgba(95, 0, 0, 0.1);
    transition:
        transform 300ms ease,
        box-shadow 300ms ease,
        opacity 180ms ease;
}

.auth-content-card::before {
    position: absolute;
    top: 0;
    right: 1.4rem;
    width: 3.4rem;
    height: 0.27rem;
    content: "";
    background: linear-gradient(90deg, var(--login-gold), var(--login-maroon));
    border-radius: 0 0 999px 999px;
}

.auth-content-card[data-portal="student"]::before {
    background: linear-gradient(90deg, #ffdf00, #daa520);
}
.auth-content-card[data-portal="security"]::before {
    background: linear-gradient(90deg, #800000, #daa520);
}
.auth-content-card[data-portal="admin"]::before {
    background: linear-gradient(90deg, #5f0000, #ffdf00);
}
.auth-content-card[data-portal="mfa"]::before {
    background: linear-gradient(90deg, #51217f, #8f6ed5);
}
.auth-content-card[data-portal="recovery"]::before {
    background: linear-gradient(90deg, #daa520, #ffdf00);
}

.auth-content-card .module-chip {
    box-shadow: 0 6px 15px rgba(128, 0, 0, 0.08);
}
.auth-content-card .btn,
.auth-content-card a,
.auth-content-card .form-control {
    transition:
        transform 220ms ease,
        box-shadow 220ms ease,
        border-color 220ms ease,
        background-color 220ms ease,
        color 220ms ease;
}
.auth-content-card .btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 24px rgba(95, 0, 0, 0.18);
}
.auth-content-card .footer-links a:hover {
    transform: translateX(3px);
}
.auth-content-card .footer-links a:first-child:hover {
    transform: translateX(-3px);
}

html.is-navigating .auth-portal-content {
    animation: none;
    opacity: 1;
    transform: none;
    transition: none;
}

/* Pause decorative motion during SPA swaps so the card transition stays smooth. */
html.is-navigating .auth-ambient-orb,
html.is-navigating .auth-brand-mark,
html.is-navigating .auth-brand-mark::before,
html.is-navigating .auth-brand-mark::after {
    animation-play-state: paused;
}

@media (prefers-reduced-motion: reduce) {
    .auth-portal-shell,
    .auth-content-card,
    .auth-content-card.is-leaving {
        animation: none;
        transition: none;
    }
}

/* Stable SPA auth shell refinements. */
.auth-portal-shell {
    grid-template-columns: minmax(340px, 0.98fr) minmax(360px, 1.02fr);
    width: min(100% - 2.5rem, 980px);
    min-height: min(600px, calc(100svh - 4.5rem));
}

.auth-portal-brand {
    padding: clamp(2.6rem, 5.8vw, 4.7rem) clamp(2rem, 4.6vw, 3.6rem);
}

.auth-brand-heading {
    gap: 1.05rem;
    margin-bottom: 2.3rem;
}

.auth-brand-mark {
    width: 86px;
    transition: none;
}

.auth-brand-mark:hover {
    transform: none;
}

.auth-brand-campus {
    font-size: 0.66rem;
}

.auth-portal-brand h1 {
    font-size: clamp(2rem, 3.4vw, 3.1rem);
}

.auth-brand-system {
    margin-top: 0.5rem;
    font-size: 0.94rem;
}

.auth-brand-description {
    max-width: 360px;
    margin: 0 0 1.65rem;
    font-size: 0.9rem;
}

.auth-brand-highlights {
    margin-bottom: 0.65rem;
}

.auth-brand-highlights span {
    font-size: 0.68rem;
}

.auth-brand-footer {
    margin-top: 1.45rem;
    font-size: 0.66rem;
}

.auth-brand-version {
    margin-top: 1rem;
}

.auth-portal-content {
    padding: clamp(1.2rem, 3.2vw, 3rem);
}

.auth-content-card {
    width: min(100%, 398px);
    min-height: 520px;
    max-height: 560px;
    overflow: hidden auto;
}

.auth-content-card.is-entering {
    animation: auth-card-enter 300ms cubic-bezier(0.22, 1, 0.36, 1) both;
    will-change: opacity, transform;
}

.auth-content-card.is-leaving {
    opacity: 0;
    transform: translateX(10px) scale(0.985);
    transition:
        opacity 170ms ease-out,
        transform 170ms ease-out;
}

.auth-portal-shell.is-swapping .auth-content-card {
    opacity: 0;
    transform: translateX(10px) scale(0.985);
    transition:
        opacity 170ms ease-out,
        transform 170ms ease-out;
}

@keyframes auth-card-enter {
    from {
        opacity: 0;
        transform: translateX(18px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

.portal-buttons {
    display: grid;
    gap: 0.78rem;
}

.portal-btn {
    display: flex;
    gap: 0.8rem;
    align-items: center;
    padding: 0.82rem 0.9rem;
    color: #1f1620;
    text-decoration: none;
    background: #fff;
    border: 1px solid rgba(128, 0, 0, 0.14);
    border-radius: 0.96rem;
    box-shadow: 0 10px 20px rgba(128, 0, 0, 0.08);
    transition:
        transform 180ms ease-in-out,
        box-shadow 180ms ease-in-out,
        border-color 180ms ease-in-out;
}

.portal-btn:hover,
.portal-btn:focus-visible {
    color: #1f1620;
    border-color: rgba(128, 0, 0, 0.35);
    box-shadow: 0 14px 26px rgba(128, 0, 0, 0.14);
    transform: translateY(-2px);
}

.portal-icon {
    display: grid;
    flex: 0 0 auto;
    width: 2rem;
    height: 2rem;
    place-items: center;
    color: #800000;
    background: #fff3cd;
    border-radius: 0.72rem;
}

.portal-copy {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    gap: 0.1rem;
    min-width: 0;
}

.portal-copy strong {
    font-size: 0.9rem;
}

.portal-copy small {
    color: #555555;
    font-size: 0.75rem;
}

.portal-arrow {
    font-size: 0.92rem;
    color: #800000;
}

.totp-qr-code svg,
.totp-qr-code img {
    display: block;
    width: 220px;
    height: 220px;
}

@media (max-width: 850px) {
    .auth-content-card {
        width: min(100%, 430px);
        min-height: 0;
        max-height: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-portal-shell.is-swapping .auth-content-card,
    .auth-content-card.is-entering,
    .auth-content-card.is-leaving,
    .portal-btn {
        animation: none !important;
        transition: none !important;
    }
}

/* Modern auth shell refresh for all login modules. */
.auth-portal-page {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    background:
        linear-gradient(120deg, rgba(60, 0, 0, 0.82), rgba(128, 0, 0, 0.56)),
        url("../assets/images/PUPT-picture.jpg") center/cover fixed;
}

.auth-ambient-layer {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.auth-ambient-orb {
    position: absolute;
    border-radius: 50%;
    opacity: 0.48;
    animation: auth-orb-float 14s ease-in-out infinite;
}

.auth-ambient-orb.orb-one {
    top: -8rem;
    left: -4rem;
    width: 22rem;
    height: 22rem;
    background: radial-gradient(
        circle,
        rgba(255, 223, 0, 0.55),
        transparent 68%
    );
}

.auth-ambient-orb.orb-two {
    right: -9rem;
    bottom: -8rem;
    width: 25rem;
    height: 25rem;
    background: radial-gradient(circle, rgba(128, 0, 0, 0.5), transparent 68%);
    animation-delay: -5s;
}

.auth-ambient-orb.orb-three {
    top: 42%;
    right: 22%;
    width: 14rem;
    height: 14rem;
    background: radial-gradient(
        circle,
        rgba(255, 255, 255, 0.3),
        transparent 68%
    );
    animation-delay: -8s;
}

.auth-portal-shell {
    position: relative;
    z-index: 1;
    border: 1px solid rgba(255, 255, 255, 0.34);
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(9px);
    box-shadow: 0 36px 90px rgba(14, 5, 8, 0.52);
}

.auth-portal-brand {
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(152deg, rgba(95, 0, 0, 0.93), rgba(128, 0, 0, 0.84)),
        radial-gradient(
            circle at 90% 12%,
            rgba(255, 255, 255, 0.22),
            transparent 42%
        );
}

.auth-brand-heading {
    position: relative;
    z-index: 2;
}

.auth-brand-mark {
    transform-style: preserve-3d;
    transition: transform 200ms ease-out;
    animation: auth-logo-float 6s ease-in-out infinite;
}

.auth-brand-mark img {
    border-radius: 1.1rem;
    box-shadow: 0 18px 34px rgba(18, 4, 7, 0.42);
}

.auth-brand-mark::before {
    content: "";
    position: absolute;
    inset: -0.3rem;
    border-radius: 1.25rem;
    border: 1px solid rgba(255, 223, 0, 0.42);
    opacity: 0.8;
    animation: auth-logo-ring-rotate 10s linear infinite;
}

.auth-brand-mark::after {
    content: "";
    position: absolute;
    inset: -0.12rem;
    border-radius: 1.12rem;
    border: 1px dashed rgba(255, 255, 255, 0.34);
    animation: auth-logo-ring-rotate 14s linear infinite reverse;
}

.auth-brand-metrics {
    display: grid;
    justify-items: center;
    gap: 0.38rem;
    margin: 0 0 0.82rem;
}

.auth-brand-metrics span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.38rem;
    min-width: 68%;
    max-width: 92%;
    padding: 0.33rem 0.64rem;
    color: #fff6dd;
    font-size: 0.64rem;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.08);
    border-radius: 0.72rem;
}

.auth-brand-metrics i {
    color: #ffdf00;
    flex-shrink: 0;
}

.auth-portal-content {
    background:
        radial-gradient(
            circle at 100% 0,
            rgba(255, 223, 0, 0.28),
            transparent 36%
        ),
        radial-gradient(
            circle at 0 100%,
            rgba(128, 0, 0, 0.16),
            transparent 40%
        ),
        rgba(249, 246, 242, 0.97);
}

.auth-content-card {
    background: linear-gradient(
        165deg,
        rgba(255, 255, 255, 0.8),
        rgba(249, 246, 242, 0.66)
    );
    border: 1px solid rgba(128, 0, 0, 0.14);
    border-radius: 1.45rem;
    box-shadow: 0 20px 44px rgba(95, 0, 0, 0.15);
}

.auth-content-card .form-control,
.auth-content-card .login-input-group,
.auth-content-card .password-wrapper .form-control {
    background: rgba(255, 255, 255, 0.9);
}

.auth-content-card .form-control {
    border-color: rgba(128, 0, 0, 0.22);
}

.auth-content-card .form-control:focus {
    border-color: rgba(128, 0, 0, 0.5);
    box-shadow: 0 0 0 0.22rem rgba(128, 0, 0, 0.11);
}

.auth-module-note {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0 0 1.1rem;
    padding: 0.48rem 0.78rem;
    color: #5f0000;
    font-size: 0.76rem;
    font-weight: 600;
    background: rgba(128, 0, 0, 0.08);
    border: 1px solid rgba(128, 0, 0, 0.14);
    border-radius: 0.7rem;
}

.auth-module-note i {
    color: #800000;
}

.auth-login-form {
    display: grid;
    gap: 0.15rem;
}

.auth-login-form .login-btn {
    margin-top: 0.25rem;
}

.auth-login-trust {
    display: inline-flex;
    align-items: flex-start;
    gap: 0.45rem;
    color: #555555;
    font-size: 0.73rem;
    line-height: 1.45;
}

.auth-login-trust i {
    margin-top: 0.06rem;
    color: #800000;
}

.portal-buttons {
    gap: 0.68rem;
}

.portal-btn {
    padding: 0.72rem 0.82rem;
    background: linear-gradient(
        158deg,
        rgba(255, 255, 255, 0.97),
        rgba(249, 246, 242, 0.93)
    );
    border: 1px solid rgba(128, 0, 0, 0.18);
}

.portal-btn:hover,
.portal-btn:focus-visible {
    border-color: rgba(128, 0, 0, 0.45);
}

@keyframes auth-logo-float {
    0%,
    100% {
        transform: translate3d(0, 0, 0) rotate(0deg);
    }
    50% {
        transform: translate3d(0, -4px, 0) rotate(-1.5deg);
    }
}

@keyframes auth-logo-ring-rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes auth-orb-float {
    0%,
    100% {
        transform: translate3d(0, 0, 0) scale(1);
    }
    50% {
        transform: translate3d(0, -16px, 0) scale(1.03);
    }
}

@media (max-width: 850px) {
    .auth-brand-metrics {
        display: none;
    }

    .auth-ambient-orb.orb-three {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-ambient-orb,
    .auth-brand-mark,
    .auth-brand-mark::before,
    .auth-brand-mark::after {
        animation: none !important;
    }
}

/* Responsive fit and cross-browser stability overrides for all auth modules. */
.auth-portal-page {
    min-height: 100dvh;
    padding: clamp(0.7rem, 2.4vw, 1.5rem);
    overflow-x: hidden;
    overflow-y: auto;
}

.auth-portal-shell {
    width: min(100%, 1020px);
    grid-template-columns: minmax(300px, 0.95fr) minmax(320px, 1.05fr);
    min-height: min(560px, calc(100dvh - 1.8rem));
    max-height: none;
}

.auth-portal-brand,
.auth-portal-content {
    min-height: 0;
}

.auth-portal-brand {
    padding: clamp(1.45rem, 3.3vw, 2.5rem) clamp(1.2rem, 2.6vw, 2.1rem);
}

.auth-brand-heading {
    margin-bottom: 1.25rem;
}

.auth-portal-brand h1 {
    font-size: clamp(1.85rem, 3.1vw, 2.7rem);
}

.auth-brand-description {
    margin-bottom: 1rem;
    font-size: 0.86rem;
    line-height: 1.55;
}

.auth-brand-footer {
    margin-top: 0.85rem;
}

.auth-brand-version {
    margin-top: 0.7rem;
}

.auth-portal-content {
    padding: clamp(0.95rem, 2.4vw, 1.8rem);
    overflow: hidden;
    align-items: center;
    justify-content: center;
}

.auth-content-card {
    width: 100%;
    min-height: 0;
    height: auto;
    max-width: none;
    max-height: none;
    overflow: visible;
    padding: clamp(0.85rem, 1.95vw, 1.35rem);
}

.auth-content-card .subtitle {
    margin-bottom: 0.95rem;
}

.auth-content-card .footer-links {
    margin-top: 0.82rem;
    gap: 0.45rem 0.7rem;
}

.auth-module-note {
    font-size: 0.73rem;
    line-height: 1.4;
}

.auth-login-trust {
    font-size: 0.7rem;
}

.auth-content-card .form-control,
.auth-content-card .login-btn {
    min-height: 44px;
}

.auth-content-card .btn,
.auth-content-card a,
.auth-content-card .form-control,
.auth-brand-mark,
.portal-btn {
    transition-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}

.auth-content-card.is-entering {
    animation: auth-card-enter 300ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.auth-content-card.is-leaving,
.auth-portal-shell.is-swapping .auth-content-card {
    opacity: 0;
    transform: translateX(10px) scale(0.985);
    transition:
        opacity 170ms ease-out,
        transform 170ms ease-out;
}

@media (max-width: 1024px) {
    .auth-portal-shell {
        width: min(100%, 960px);
        grid-template-columns: minmax(280px, 0.9fr) minmax(320px, 1.1fr);
    }
}

@media (max-width: 850px) {
    .auth-portal-page {
        padding: 0.8rem;
    }

    .auth-portal-shell {
        grid-template-columns: 1fr;
        min-height: auto;
        max-height: none;
        border-radius: 1.05rem;
    }

    .auth-portal-brand {
        padding: 1.35rem 1rem 1.1rem;
    }

    .auth-brand-heading {
        padding-top: 0.4rem;
        margin-bottom: 0.75rem;
    }

    .auth-brand-mark {
        width: 72px;
    }

    .auth-brand-campus {
        margin-bottom: 0.25rem;
    }

    .auth-brand-system {
        margin-top: 0.28rem;
    }

    .auth-brand-description {
        display: block;
        margin-bottom: 0.62rem;
        font-size: 0.8rem;
    }

    .auth-brand-highlights {
        gap: 0.38rem;
        margin-bottom: 0;
    }

    .auth-brand-highlights span {
        font-size: 0.64rem;
    }

    .auth-brand-footer {
        display: flex;
        margin-top: 0.7rem;
        font-size: 0.62rem;
        row-gap: 0.15rem;
    }

    .auth-brand-version {
        display: none;
    }

    .auth-portal-content {
        padding: 0.95rem;
    }

    .auth-content-card {
        width: 100%;
        max-width: 100%;
    }
}

@media (max-width: 576px) {
    .auth-portal-page {
        padding: 0.5rem;
    }

    .auth-portal-shell {
        border-radius: 1rem;
    }

    .auth-content-card {
        border-radius: 1rem;
        padding: 0.95rem 0.85rem;
    }

    .auth-content-card .module-chip {
        margin-bottom: 0.5rem;
    }

    .auth-content-card h2 {
        font-size: 1.3rem;
    }

    .auth-module-note {
        display: flex;
        width: 100%;
    }

    .auth-content-card .footer-links {
        align-items: flex-start;
    }

    .portal-btn {
        padding: 0.72rem 0.74rem;
    }
}

@media (max-height: 760px) and (min-width: 851px) {
    .auth-portal-page {
        place-items: stretch center;
    }

    .auth-portal-shell {
        margin: auto 0;
        min-height: auto;
    }
    .auth-brand-description {
        display: block;
        margin-bottom: 0.62rem;
        font-size: 0.74rem;
        line-height: 1.42;
    }

    .auth-brand-highlights {
        display: flex;
        gap: 0.28rem;
        margin-bottom: 0;
    }

    .auth-brand-highlights span {
        padding: 0.22rem 0.42rem;
        font-size: 0.55rem;
    }

    .auth-brand-version {
        display: inline-flex;
    }

    .auth-brand-footer {
        display: flex;
        margin-top: 0.6rem;
        font-size: 0.62rem;
    }
}

@supports not (backdrop-filter: blur(1px)) {
    .auth-portal-shell {
        background: rgba(255, 255, 255, 0.12);
    }

    .auth-portal-content {
        background: rgba(249, 246, 242, 0.95);
    }
}

/* Desktop auth tuning - fills most of the available viewport */
@media (min-width: 851px) {
    .auth-portal-shell {
        width: min(100% - 3rem, 1120px);
        min-height: min(660px, calc(100dvh - 3rem));
        grid-template-columns: minmax(360px, 0.95fr) minmax(420px, 1.05fr);
    }

    .auth-portal-brand {
        padding: clamp(2rem, 4vw, 3rem) clamp(1.6rem, 3vw, 2.4rem);
    }

    .auth-brand-heading {
        gap: 1rem;
        margin-bottom: 1.6rem;
    }

    .auth-brand-mark {
        width: 72px;
    }

    .auth-brand-campus {
        font-size: 0.68rem;
        margin-bottom: 0.32rem;
    }

    .auth-portal-brand h1 {
        font-size: clamp(1.9rem, 3vw, 2.6rem);
    }

    .auth-brand-system {
        margin-top: 0.4rem;
        font-size: 0.96rem;
    }

    .auth-brand-description {
        max-width: 320px;
        margin-bottom: 1.2rem;
        font-size: 0.88rem;
        line-height: 1.6;
    }

    .auth-brand-highlights {
        gap: 0.45rem;
        margin-bottom: 0.4rem;
    }

    .auth-brand-highlights span {
        padding: 0.3rem 0.5rem;
        font-size: 0.62rem;
        border-radius: 999px;
    }

    .auth-brand-footer {
        margin-top: 0.9rem;
        gap: 0.2rem 0.4rem;
        font-size: 0.62rem;
    }

    .auth-brand-footer a {
        min-height: 24px;
    }

    .auth-brand-version {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        align-self: center;
        margin: 0.6rem auto 0;
        padding: 0.2rem 0.5rem;
        color: #fff2d2;
        font-size: 0.56rem;
        font-weight: 700;
        letter-spacing: 0.03em;
        background: rgba(255, 255, 255, 0.08);
        border: 1px solid rgba(255, 255, 255, 0.16);
        border-radius: 999px;
    }

    .auth-portal-content {
        padding: clamp(1.4rem, 3vw, 2.6rem);
        align-items: center;
        justify-content: center;
    }

    .auth-content-card {
        width: 100%;
        min-height: 0;
        height: auto;
        max-width: 480px;
        padding: clamp(1.2rem, 2.4vw, 2rem);
        border-radius: 1.25rem;
    }

    .auth-content-card h2 {
        font-size: clamp(1.5rem, 2.2vw, 2rem);
    }

    .auth-content-card .subtitle {
        margin-bottom: 1.1rem;
        font-size: 0.86rem;
    }

    .auth-content-card .form-control,
    .auth-content-card .login-btn {
        min-height: 50px;
    }

    .auth-login-form {
        gap: 0.35rem;
    }

    .portal-buttons {
        gap: 0.9rem;
    }

    .portal-btn {
        padding: 0.85rem 1rem;
        border-radius: 1rem;
    }

    .portal-icon {
        width: 2.1rem;
        height: 2.1rem;
        border-radius: 0.7rem;
    }

    .portal-copy strong {
        font-size: 0.9rem;
    }

    .portal-copy small {
        font-size: 0.74rem;
    }
}

/* Elevated aesthetic for literal admin/security login pages */
.auth-content-card[data-portal="admin"],
.auth-content-card[data-portal="security"] {
    position: relative;
    background:
        radial-gradient(
            circle at 100% 0,
            rgba(255, 223, 0, 0.2),
            transparent 38%
        ),
        linear-gradient(
            165deg,
            rgba(255, 255, 255, 0.93),
            rgba(249, 246, 242, 0.86)
        );
    border: 1px solid rgba(128, 0, 0, 0.18);
    box-shadow: 0 18px 40px rgba(95, 0, 0, 0.15);
}

.auth-content-card[data-portal="admin"]::after,
.auth-content-card[data-portal="security"]::after {
    content: "";
    position: absolute;
    inset: auto 1rem 0.7rem 1rem;
    height: 0.7rem;
    pointer-events: none;
    background: radial-gradient(
        circle at center,
        rgba(128, 0, 0, 0.16),
        transparent 72%
    );
}

.auth-content-card[data-portal="admin"] .module-chip,
.auth-content-card[data-portal="security"] .module-chip {
    border: 1px solid rgba(255, 223, 0, 0.55);
    background: linear-gradient(
        160deg,
        rgba(255, 243, 205, 0.92),
        rgba(255, 223, 0, 0.36)
    );
    color: #800000;
    box-shadow: 0 8px 16px rgba(128, 0, 0, 0.12);
}

.auth-content-card[data-portal="admin"] .auth-login-form,
.auth-content-card[data-portal="security"] .auth-login-form {
    position: relative;
    gap: 0.35rem;
    padding: 0.64rem;
    background: rgba(255, 255, 255, 0.58);
    border: 1px solid rgba(128, 0, 0, 0.1);
    border-radius: 0.95rem;
}

.auth-content-card[data-portal="admin"] .form-label,
.auth-content-card[data-portal="security"] .form-label {
    margin-bottom: 0.45rem;
    color: #1f1620;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.auth-content-card[data-portal="admin"] .login-input-group,
.auth-content-card[data-portal="security"] .login-input-group {
    border: 1px solid rgba(128, 0, 0, 0.24);
    border-radius: 0.86rem;
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.96),
        rgba(249, 246, 242, 0.96)
    );
    box-shadow: inset 0 1px 2px rgba(128, 0, 0, 0.08);
}

.auth-content-card[data-portal="admin"] .login-input-group:focus-within,
.auth-content-card[data-portal="security"] .login-input-group:focus-within {
    border-color: rgba(128, 0, 0, 0.58);
    box-shadow: 0 0 0 0.18rem rgba(128, 0, 0, 0.13);
}

.auth-content-card[data-portal="admin"] .password-wrapper .form-control,
.auth-content-card[data-portal="security"] .password-wrapper .form-control {
    border: 1px solid rgba(128, 0, 0, 0.22);
    border-radius: 0.86rem;
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.98),
        rgba(249, 246, 242, 0.98)
    );
}

.auth-content-card[data-portal="admin"] .password-wrapper .form-control:focus,
.auth-content-card[data-portal="security"]
    .password-wrapper
    .form-control:focus {
    border-color: rgba(128, 0, 0, 0.58);
    box-shadow: 0 0 0 0.18rem rgba(128, 0, 0, 0.13);
}

.auth-content-card[data-portal="admin"] .password-input-icon,
.auth-content-card[data-portal="security"] .password-input-icon,
.auth-content-card[data-portal="admin"] .toggle-password,
.auth-content-card[data-portal="security"] .toggle-password {
    color: #800000;
}

.auth-content-card[data-portal="admin"] .login-btn,
.auth-content-card[data-portal="security"] .login-btn {
    margin-top: 0.45rem;
    border-radius: 0.98rem;
    background: linear-gradient(
        135deg,
        #800000 0%,
        #a31515 58%,
        #5f0000 100%
    ) !important;
    box-shadow: 0 16px 26px rgba(128, 0, 0, 0.3);
    letter-spacing: 0.02em;
}

.auth-content-card[data-portal="admin"] .login-btn:hover,
.auth-content-card[data-portal="security"] .login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 30px rgba(128, 0, 0, 0.33);
}

/* Remember me (30-day trusted device) row for the Administrator and Security
   login forms. The checkbox label is interactive text (it can toggle the box),
   so it keeps the maroon accent and the same typographic rhythm as the rest of
   the auth card. */
.auth-content-card[data-portal="admin"] .remember-row,
.auth-content-card[data-portal="security"] .remember-row {
    margin: 0.4rem 0.1rem 0.35rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.auth-content-card[data-portal="admin"] .remember-check,
.auth-content-card[data-portal="security"] .remember-check {
    margin-bottom: 0;
    min-height: auto;
}

.auth-content-card[data-portal="admin"] .remember-check .form-check-input,
.auth-content-card[data-portal="security"] .remember-check .form-check-input {
    border-color: rgba(128, 0, 0, 0.4);
    cursor: pointer;
}

.auth-content-card[data-portal="admin"]
    .remember-check
    .form-check-input:checked,
.auth-content-card[data-portal="security"]
    .remember-check
    .form-check-input:checked {
    background-color: #800000;
    border-color: #800000;
}

.auth-content-card[data-portal="admin"] .remember-check .form-check-input:focus,
.auth-content-card[data-portal="security"]
    .remember-check
    .form-check-input:focus {
    border-color: rgba(128, 0, 0, 0.58);
    box-shadow: 0 0 0 0.18rem rgba(128, 0, 0, 0.13);
}

.auth-content-card[data-portal="admin"] .remember-label,
.auth-content-card[data-portal="security"] .remember-label {
    color: #3a2a2a;
    font-weight: 600;
    font-size: 0.86rem;
    cursor: pointer;
    user-select: none;
}

.auth-content-card[data-portal="admin"] .remember-label:hover,
.auth-content-card[data-portal="security"] .remember-label:hover {
    color: #800000;
}

.auth-content-card[data-portal="admin"] .footer-links,
.auth-content-card[data-portal="security"] .footer-links {
    padding-top: 0.55rem;
    border-top: 1px solid rgba(128, 0, 0, 0.14);
}

.auth-content-card[data-portal="admin"] .footer-links a,
.auth-content-card[data-portal="security"] .footer-links a {
    color: #5f0000;
    font-weight: 700;
}

.auth-content-card[data-portal="admin"] .footer-links a:hover,
.auth-content-card[data-portal="security"] .footer-links a:hover {
    color: #800000;
}

/* "Forgot Password?" always sits on the far right of the footer, on the
   same line as the "← Back" link — even on narrow/phone widths. */
.auth-content-card[data-portal="admin"] .footer-links,
.auth-content-card[data-portal="security"] .footer-links {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.auth-content-card[data-portal="admin"] .footer-links a,
.auth-content-card[data-portal="security"] .footer-links a {
    white-space: nowrap;
}

.auth-content-card[data-portal="admin"] .footer-links a:first-child,
.auth-content-card[data-portal="security"] .footer-links a:first-child {
    margin-right: 1rem;
}

.auth-content-card[data-portal="admin"] .footer-links a:last-child,
.auth-content-card[data-portal="security"] .footer-links a:last-child {
    margin-left: auto;
    text-align: right;
}

@media (max-width: 850px) {
    .auth-content-card[data-portal="admin"] .auth-login-form,
    .auth-content-card[data-portal="security"] .auth-login-form {
        padding: 0.5rem;
    }
}

/* ============================================================
   Consistent login button color across every auth module.
   The Bootstrap .btn-success green is overridden everywhere so
   student/admin/security/recovery/MFA all render the maroon-gold
   brand button.
   ============================================================ */
.auth-portal-content .login-btn,
.auth-content-card .login-btn,
.auth-content-card .btn-success.login-btn,
.auth-portal-page .btn-success.login-btn {
    color: #ffffff !important;
    background: linear-gradient(
        135deg,
        var(--login-maroon) 0%,
        var(--login-maroon-dark) 100%
    ) !important;
    border: 1px solid var(--login-maroon-dark) !important;
    box-shadow: 0 12px 20px rgba(128, 0, 0, 0.22);
}

.auth-portal-content .login-btn:hover,
.auth-content-card .login-btn:hover,
.auth-content-card .btn-success.login-btn:hover,
.auth-portal-page .btn-success.login-btn:hover {
    color: #fff !important;
    filter: none;
    background: linear-gradient(135deg, #b8860b 0%, #9c7109 100%) !important;
    border-color: #b8860b !important;
    transform: translateY(-2px);
    box-shadow: 0 16px 26px rgba(184, 134, 11, 0.32);
}

/* ============================================================
   Auth-portal Bootstrap modals (e.g. Confirm Student Number /
   Update Information on the IDP linking flow).
   Relocated to <body> by JS so they escape the shell's
   isolation/backdrop-filter stacking context. Theme matches the
   system maroon/gold UI.
   ============================================================ */
.auth-modal .modal-content {
    border: 1px solid rgba(128, 0, 0, 0.16);
    border-radius: 1.1rem;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(16, 4, 6, 0.35);
}

.auth-modal .modal-header {
    background: linear-gradient(120deg, #800000 0%, #5f0000 62%, #daa520 180%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    padding: 1rem 1.25rem;
}

.auth-modal .modal-header .modal-title {
    color: #fff;
    font-weight: 800;
    font-size: 1.05rem;
    display: inline-flex;
    align-items: center;
}

.auth-modal .modal-header .modal-title i {
    color: #ffdf00;
}

.auth-modal .modal-header .btn-close {
    filter: invert(1) grayscale(1) brightness(200%);
    opacity: 0.85;
}

.auth-modal .modal-body {
    background: linear-gradient(180deg, #fffefa 0%, #fff7e3 100%);
    color: #1f1620;
}

.auth-modal .modal-body .form-label {
    color: #5f0000;
    font-weight: 600;
}

.auth-modal .modal-body .form-control,
.auth-modal .modal-body .form-select {
    border: 1px solid rgba(128, 0, 0, 0.22);
    border-radius: 0.7rem;
    min-height: 44px;
}

.auth-modal .modal-body .form-control:focus,
.auth-modal .modal-body .form-select:focus {
    border-color: rgba(128, 0, 0, 0.5);
    box-shadow: 0 0 0 0.2rem rgba(128, 0, 0, 0.11);
}

.auth-modal .modal-footer {
    background: #fffdf6;
    border-top: 1px solid rgba(128, 0, 0, 0.12);
    gap: 0.5rem;
}

.auth-modal .modal-footer .btn {
    border-radius: 0.72rem;
    font-weight: 600;
}

.auth-modal .modal-footer .btn-outline-secondary {
    color: #5f0000;
    border-color: rgba(128, 0, 0, 0.28);
}

.auth-modal .modal-footer .btn-outline-secondary:hover {
    color: #fff;
    background: #5f0000;
    border-color: #5f0000;
}

.auth-modal .modal-footer .portal-btn,
.auth-modal .modal-footer .btn-success {
    color: #fff;
    background: linear-gradient(135deg, #800000 0%, #5f0000 100%);
    border: 1px solid #5f0000;
}

.auth-modal .modal-footer .portal-btn:hover,
.auth-modal .modal-footer .btn-success:hover {
    background: linear-gradient(135deg, #b8860b 0%, #9c7109 100%);
    border-color: #b8860b;
}

.auth-modal .modal-backdrop.show {
    opacity: 0.55;
}
