:root {
    --auth-navy: #071a43;
    --auth-copy: #536889;
    --auth-teal: #049a80;
    --auth-teal-dark: #047765;
    --auth-line: #cfdeea;
    --auth-soft: #f3fafb;
    --auth-white: #ffffff;
    --auth-danger: #b42318;
}

* { box-sizing: border-box; }

html,
body { min-height: 100%; }

body.portal-auth-page {
    margin: 0;
    color: var(--auth-navy);
    background: #f5fbfd;
    font-family: "Inter", "Segoe UI", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

button,
input { font: inherit; }

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

.portal-auth-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 50.5% 49.5%;
}

.auth-role-admin .portal-auth-shell {
    grid-template-columns: 49% 51%;
}

.portal-showcase {
    min-width: 0;
    min-height: 100vh;
    position: relative;
    overflow: hidden;
    background-position: left top;
    background-repeat: no-repeat;
    background-size: auto 100%;
}

.auth-role-admin .portal-showcase { background-image: url("../images/auth/admin-auth-reference.png"); }
.auth-role-teacher .portal-showcase { background-image: url("../images/auth/teacher-auth-reference.png"); }
.auth-role-student .portal-showcase { background-image: url("../images/auth/student-auth-reference.png"); }
.auth-role-parent .portal-showcase { background-image: url("../images/auth/parent-auth-reference.png"); }

.showcase-home {
    width: 250px;
    height: 145px;
    position: absolute;
    left: 5.5%;
    top: 4%;
    z-index: 2;
    border-radius: 18px;
}

.showcase-home:focus-visible {
    outline: 3px solid var(--auth-teal);
    outline-offset: 5px;
}

.portal-access {
    min-width: 0;
    min-height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 82px clamp(32px, 3vw, 66px) 70px;
    background:
        radial-gradient(circle at 90% 6%, rgba(211, 240, 248, .7), transparent 34%),
        linear-gradient(145deg, #fbfdff, #f2f9fc);
}

.portal-motto {
    position: absolute;
    right: 6.5%;
    top: 2.6%;
    margin: 0;
    color: #113d71;
    font-family: "Caveat", cursive;
    font-size: clamp(19px, 1.45vw, 27px);
    font-weight: 600;
    line-height: .84;
    text-align: left;
    transform: rotate(-5deg);
}

.portal-motto::after {
    content: "";
    width: 88%;
    height: 3px;
    display: block;
    margin: 8px 0 0 auto;
    border-radius: 99px;
    background: #08a285;
    transform: rotate(-5deg);
}

.auth-role-admin .portal-motto {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--auth-navy);
    font-family: "Inter", sans-serif;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.35;
    transform: none;
}

.auth-role-admin .portal-motto::before {
    content: "\f3ed";
    color: var(--auth-teal);
    font: 900 27px/1 "Font Awesome 6 Free";
}

.auth-role-admin .portal-motto::after { display: none; }

.auth-role-admin .portal-motto span {
    color: var(--auth-copy);
    font-size: 10px;
    font-weight: 400;
}

.portal-login-card {
    width: min(515px, 100%);
    padding: clamp(34px, 3.1vw, 46px) clamp(32px, 3vw, 42px);
    border: 1px solid rgba(211, 225, 234, .9);
    border-radius: 24px;
    background: rgba(255, 255, 255, .95);
    box-shadow: 0 24px 70px rgba(30, 78, 107, .09);
    backdrop-filter: blur(14px);
}

.auth-role-admin .portal-login-card {
    width: min(585px, 100%);
}

.admin-lock {
    width: 60px;
    height: 60px;
    display: grid;
    place-items: center;
    margin-bottom: 15px;
    border: 1px solid #c7ede4;
    border-radius: 16px;
    color: var(--auth-teal);
    background: linear-gradient(145deg, #effcf8, #d9f5ed);
    font-size: 22px;
}

.auth-heading h1 {
    margin: 0;
    color: var(--auth-navy);
    font-size: clamp(34px, 2.7vw, 44px);
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -.045em;
}

.auth-heading p {
    margin: 8px 0 28px;
    color: var(--auth-copy);
    font-size: 15px;
}

.auth-field { margin-top: 18px; }

.auth-field label {
    display: block;
    margin-bottom: 8px;
    color: var(--auth-navy);
    font-size: 12px;
    font-weight: 700;
}

.auth-control {
    min-height: 54px;
    display: flex;
    align-items: center;
    border: 1px solid var(--auth-line);
    border-radius: 10px;
    background: #fbfdff;
    transition: border-color .18s ease, box-shadow .18s ease;
}

.auth-control:focus-within {
    border-color: var(--auth-teal);
    box-shadow: 0 0 0 4px rgba(4, 154, 128, .11);
}

.auth-control > i {
    width: 48px;
    flex: 0 0 48px;
    color: #45678e;
    text-align: center;
}

.auth-control input {
    width: 100%;
    min-width: 0;
    height: 52px;
    padding: 0 10px 0 0;
    border: 0;
    outline: 0;
    color: var(--auth-navy);
    background: transparent;
    font-size: 14px;
}

.auth-control input::placeholder { color: #8ca0bd; }

.password-toggle {
    width: 48px;
    height: 52px;
    flex: 0 0 48px;
    border: 0;
    color: #45678e;
    background: transparent;
    cursor: pointer;
}

.auth-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-top: 18px;
    font-size: 12px;
}

.remember-choice {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.remember-choice input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
}

.choice-box {
    width: 19px;
    height: 19px;
    display: grid;
    place-items: center;
    border: 1px solid #a9bbca;
    border-radius: 4px;
    color: transparent;
    background: white;
    font-size: 10px;
}

.remember-choice input:checked + .choice-box {
    border-color: var(--auth-teal);
    color: white;
    background: var(--auth-teal);
}

.remember-choice input:focus-visible + .choice-box {
    outline: 3px solid rgba(4, 154, 128, .2);
    outline-offset: 2px;
}

.forgot-password {
    color: var(--auth-teal-dark);
    font-weight: 600;
    text-underline-offset: 3px;
}

.portal-submit {
    width: 100%;
    min-height: 60px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 24px;
    padding: 0 68px;
    border: 0;
    border-radius: 999px;
    color: white;
    background: linear-gradient(135deg, #13b591, #07836d);
    box-shadow: 0 13px 28px rgba(7, 131, 109, .22);
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease;
}

.portal-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 17px 34px rgba(7, 131, 109, .28);
}

.submit-icon {
    width: 46px;
    height: 46px;
    position: absolute;
    right: 7px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: var(--auth-teal);
    background: white;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 24px 0 16px;
    color: #7689a4;
    font-size: 10px;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    height: 1px;
    flex: 1;
    background: var(--auth-line);
}

.auth-help {
    margin: 0;
    color: var(--auth-copy);
    font-size: 12px;
    text-align: center;
}

.auth-help span {
    color: var(--auth-teal-dark);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.auth-assurance {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    margin-top: 25px;
    padding: 12px 13px;
    border: 1px solid #e3edf2;
    border-radius: 12px;
    background: linear-gradient(105deg, #f1faf9, #f7fbfd);
}

.auth-assurance-single { grid-template-columns: 1fr; }

.assurance-item {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.assurance-secondary {
    padding-left: 13px;
    border-left: 1px solid #d5e3e8;
}

.assurance-icon {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    color: #08a076;
    background: #ddf5eb;
    font-size: 16px;
}

.assurance-item p {
    margin: 0;
    color: var(--auth-copy);
    font-size: 8px;
    line-height: 1.45;
}

.assurance-item strong {
    color: var(--auth-navy);
    font-size: 9px;
}

.auth-messages { margin-bottom: 16px; }

.auth-message {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid #f0c8c3;
    border-radius: 9px;
    color: var(--auth-danger);
    background: #fff3f2;
    font-size: 11px;
    line-height: 1.4;
}

.auth-message + .auth-message { margin-top: 7px; }

.portal-auth-footer {
    position: absolute;
    right: 6.5%;
    bottom: 4.6%;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #657b9a;
    font-size: 10px;
}

.portal-auth-footer i {
    width: 1px;
    height: 13px;
    background: #aab9c8;
}

@media (max-width: 1180px) {
    .portal-auth-shell { grid-template-columns: 50% 50%; }
    .auth-role-admin .portal-auth-shell { grid-template-columns: 49% 51%; }
    .portal-showcase { background-size: auto 100%; }
    .portal-access { padding-inline: 28px; }
}

@media (max-width: 900px) {
    .portal-auth-shell { display: block; }
    .auth-role-admin .portal-auth-shell { display: block; }

    .portal-showcase {
        min-height: 520px;
        background-size: auto 100%;
    }

    .portal-access {
        min-height: auto;
        padding: 76px 22px 80px;
    }

    .portal-motto { top: 22px; }
}

@media (max-width: 560px) {
    .portal-showcase { min-height: 390px; }
    .showcase-home { width: 155px; height: 90px; }

    .portal-access { padding: 65px 13px 72px; }

    .portal-login-card {
        padding: 28px 20px;
        border-radius: 20px;
    }

    .auth-heading h1 { font-size: 33px; }
    .auth-heading p { font-size: 13px; }
    .auth-options { font-size: 11px; }

    .auth-assurance {
        grid-template-columns: 1fr;
        gap: 11px;
    }

    .assurance-secondary {
        padding: 11px 0 0;
        border-top: 1px solid #d5e3e8;
        border-left: 0;
    }

    .portal-auth-footer {
        right: 50%;
        bottom: 24px;
        transform: translateX(50%);
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition-duration: .01ms !important; }
}
