/* ==========================================================================
   Halaman masuk portal: siswa, guru, dan administrator.
   Memakai token warna dari site.css agar tetap satu keluarga visual.
   ========================================================================== */

.auth-body {
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--paper-2);
    color: var(--ink);
    font-family: var(--sans);
}

.auth-shell {
    display: grid;
    grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
    min-height: 100vh;
    min-height: 100dvh;
}

/* Panel identitas sekolah ------------------------------------------------ */
.auth-aside {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: clamp(20px, 3vw, 40px);
    background: var(--forest-900);
    color: #E8F3ED;
    overflow: hidden;
}

.auth-aside::before {
    content: "";
    position: absolute;
    inset: auto -120px -160px auto;
    width: 380px;
    height: 380px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    pointer-events: none;
}

.auth-aside::after {
    content: "";
    position: absolute;
    inset: auto -40px -220px auto;
    width: 380px;
    height: 380px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    pointer-events: none;
}

.auth-brand {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 14px;
    color: #FFFFFF;
    text-decoration: none;
}

.auth-brand:hover {
    color: #FFFFFF;
}

.auth-brand .brand-mark {
    display: grid;
    place-items: center;
    flex: none;
    width: 46px;
    height: 46px;
    color: #FFFFFF;
}

.auth-brand .brand-mark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.auth-brand .brand-mark svg {
    width: 29px;
    height: 29px;
}

.auth-brand strong {
    display: block;
    font-family: var(--display);
    font-size: 1.02rem;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -0.01em;
}

.auth-brand small {
    display: block;
    margin-top: 2px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.75rem;
    font-weight: 500;
}

.auth-aside-main {
    position: relative;
    z-index: 1;
    max-width: 36ch;
    margin: auto 0;
}

.auth-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--accent-soft);
    font-size: 0.8125rem;
    font-weight: 600;
}

.auth-kicker::before {
    content: "";
    width: 22px;
    height: 1px;
    background: currentColor;
}

.auth-aside-main h2 {
    margin-top: 12px;
    color: #FFFFFF;
    font-size: clamp(1.6rem, 2.6vw, 2.2rem);
    font-weight: 600;
    line-height: 1.12;
}

.auth-aside-main > p {
    margin-top: 12px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.88rem;
    line-height: 1.6;
}

.auth-points {
    display: grid;
    gap: 8px;
    margin: 18px 0 0;
    padding: 0;
    list-style: none;
}

.auth-points li {
    display: flex;
    gap: 9px;
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.82rem;
    line-height: 1.55;
}

.auth-points li::before {
    content: "";
    flex: none;
    width: 6px;
    height: 6px;
    margin-top: 0.55em;
    border-radius: 50%;
    background: var(--accent);
}

.auth-aside-foot {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 10px;
    margin-top: auto;
}

.auth-utility {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    font-size: 0.76rem;
}

.auth-utility a {
    color: rgba(255, 255, 255, 0.68);
    text-decoration: none;
}

.auth-utility a:hover {
    color: #FFFFFF;
    text-decoration: underline;
}

.auth-copy {
    color: rgba(255, 255, 255, 0.42);
    font-size: 0.7rem;
}

/* Panel formulir --------------------------------------------------------- */
.auth-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: clamp(18px, 3.2vw, 40px) clamp(16px, 3vw, 40px);
}

.auth-card {
    width: 100%;
    max-width: 420px;
    padding: clamp(20px, 3vw, 30px);
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.auth-back {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 14px;
    color: var(--muted);
    font-size: 0.78rem;
    text-decoration: none;
}

.auth-back:hover {
    color: var(--forest-900);
}

.auth-back svg {
    width: 15px;
    height: 15px;
}

.auth-card-kicker {
    display: block;
    color: var(--forest-700);
    font-size: 0.71rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.auth-card h1 {
    margin-top: 7px;
    font-size: clamp(1.5rem, 2.4vw, 1.8rem);
}

.auth-lead {
    margin-top: 8px;
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.55;
}

.auth-alert {
    display: flex;
    gap: 9px;
    margin-top: 14px;
    padding: 10px 12px;
    background: #FEF3F2;
    border: 1px solid #F3C6C2;
    border-left: 3px solid var(--danger);
    border-radius: var(--radius-sm);
    color: #8F1D14;
    font-size: 0.8rem;
    line-height: 1.5;
}

.auth-alert svg {
    flex: none;
    width: 18px;
    height: 18px;
    margin-top: 1px;
    color: var(--danger);
}

.auth-form {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}

.auth-field label {
    display: block;
    margin-bottom: 4px;
    font-size: 0.76rem;
    font-weight: 700;
}

.auth-control {
    position: relative;
}

.auth-field input {
    width: 100%;
    padding: 10px 12px;
    background: var(--paper);
    border: 1.5px solid var(--line-strong);
    border-radius: 9px;
    font-size: 0.95rem;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.auth-field input::placeholder {
    color: #98A2B3;
}

.auth-field input:focus {
    outline: none;
    background: var(--white);
    border-color: var(--forest-700);
    box-shadow: 0 0 0 4px rgba(10, 103, 73, 0.12);
}

.auth-field input[aria-invalid="true"] {
    background: #FFFCFC;
    border-color: var(--danger);
}

.auth-password input {
    padding-right: 48px;
}

.auth-toggle {
    position: absolute;
    top: 50%;
    right: 5px;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    transform: translateY(-50%);
    background: transparent;
    border: 0;
    border-radius: 8px;
    color: var(--muted);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.auth-toggle:hover {
    background: var(--forest-50);
    color: var(--forest-800);
}

.auth-toggle:focus-visible {
    outline: 2px solid var(--forest-700);
    outline-offset: 2px;
}

.auth-toggle svg {
    width: 19px;
    height: 19px;
}

.auth-toggle .eye-off {
    display: none;
}

.auth-toggle.is-visible .eye-open {
    display: none;
}

.auth-toggle.is-visible .eye-off {
    display: block;
}

.auth-submit {
    justify-content: center;
    width: 100%;
    min-height: 42px;
    margin-top: 2px;
}

.auth-help {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    margin-top: 2px;
    color: var(--forest-800);
    font-size: 0.78rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
}

.auth-help:hover {
    color: var(--forest-950);
    text-decoration: underline;
}

.auth-help svg {
    width: 14px;
    height: 14px;
    flex: none;
}

.auth-switch {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.8rem;
    text-align: center;
}

.auth-switch a {
    color: var(--forest-800);
    font-weight: 600;
}

/* Responsif -------------------------------------------------------------- */
@media (max-width: 900px) {
    .auth-shell {
        grid-template-columns: 1fr;
        grid-template-rows: auto minmax(0, 1fr);
        min-height: 100vh;
        min-height: 100dvh;
    }

    .auth-aside {
        gap: 0;
        padding: 12px 16px;
    }

    /* Pada ponsel, tautan utilitas dan hak cipta disembunyikan agar
       area atas ringkas dan tidak memenuhi layar. */
    .auth-aside-foot {
        display: none;
    }

    .auth-aside-main,
    .auth-lead {
        display: none;
    }

    .auth-main {
        padding: 12px 14px 18px;
    }

    .auth-card {
        padding: 18px 16px;
    }

    .auth-switch {
        margin-top: 12px;
        padding-top: 10px;
    }
}

@media (max-width: 560px) {
    .auth-aside {
        padding: 10px 14px;
    }

    .auth-brand .brand-mark {
        width: 40px;
        height: 40px;
    }

    .auth-brand strong {
        font-size: 0.95rem;
    }

    .auth-main {
        padding: 10px 12px 14px;
    }

    .auth-card {
        padding: 16px 14px 18px;
        border-radius: var(--radius);
    }

    .auth-back {
        margin-bottom: 10px;
    }

    .auth-form {
        gap: 10px;
        margin-top: 12px;
    }

    .auth-field input {
        padding: 9px 11px;
    }
}

@media (max-width: 380px) {
    .auth-card {
        padding: 14px 12px 16px;
    }

    .auth-brand .brand-mark {
        width: 38px;
        height: 38px;
    }
}

/* Layar pendek: rapatkan agar halaman masuk pas satu layar ----------------- */
@media (min-width: 901px) and (max-height: 820px) {
    .auth-aside {
        gap: 20px;
        padding-block: 28px;
    }

    .auth-aside-main h2 {
        font-size: clamp(1.6rem, 2.4vw, 2.1rem);
    }

    .auth-aside-main > p {
        margin-top: 10px;
        font-size: 0.86rem;
        line-height: 1.55;
    }

    .auth-points {
        gap: 7px;
        margin-top: 14px;
    }

    .auth-points li {
        font-size: 0.8rem;
        line-height: 1.5;
    }

    .auth-aside-foot {
        gap: 8px;
    }

    .auth-main {
        padding-block: 24px;
    }

    .auth-card {
        padding: 24px 32px;
    }

    .auth-back {
        margin-bottom: 12px;
    }

    .auth-lead {
        margin-top: 6px;
    }

    .auth-form {
        gap: 12px;
        margin-top: 14px;
    }

    .auth-switch {
        margin-top: 14px;
        padding-top: 14px;
    }
}

@media (min-width: 901px) and (max-height: 700px) {
    .auth-aside {
        gap: 16px;
        padding-block: 18px;
    }

    .auth-points {
        display: none;
    }

    .auth-main {
        padding-block: 14px;
    }

    .auth-card {
        padding: 18px 24px;
    }

    .auth-form {
        gap: 10px;
        margin-top: 12px;
    }

    .auth-switch {
        margin-top: 12px;
        padding-top: 10px;
    }
}

@media (max-width: 900px) and (max-height: 900px) {
    .auth-aside {
        padding: 10px 16px 12px;
    }

    .auth-aside-main {
        margin-top: 8px;
    }

    .auth-aside-main h2 {
        font-size: clamp(1.2rem, 4.2vw, 1.45rem);
    }

    .auth-main {
        padding: 10px 12px 12px;
    }

    .auth-card {
        padding: 14px 16px 16px;
    }

    .auth-back {
        margin-bottom: 12px;
    }

    .auth-form {
        gap: 10px;
        margin-top: 14px;
    }

    .auth-switch {
        margin-top: 10px;
        padding-top: 12px;
    }
}

@media (max-width: 900px) and (max-height: 700px) {
    .auth-aside-main,
    .auth-lead {
        display: none;
    }

    .auth-card {
        padding: 12px 14px 14px;
    }

    .auth-form {
        gap: 9px;
        margin-top: 10px;
    }

    .auth-switch {
        margin-top: 10px;
        padding-top: 10px;
    }
}

@media (min-width: 901px) and (max-height: 560px) {
    .auth-aside {
        gap: 14px;
        padding-block: 14px;
    }

    .auth-aside-main h2 {
        font-size: 1.55rem;
    }

    .auth-aside-main > p {
        display: none;
    }

    .auth-main {
        padding-block: 10px;
    }

    .auth-card {
        padding: 12px 22px;
    }

    .auth-form {
        gap: 8px;
    }

    .auth-switch {
        margin-top: 10px;
        padding-top: 8px;
    }
}

@media (max-width: 900px) and (max-height: 520px) {
    .auth-aside {
        padding: 8px 12px;
    }

    .auth-main {
        padding: 8px 10px 10px;
    }

    .auth-card {
        padding: 12px 12px 14px;
    }

    .auth-back {
        display: none;
    }

    .auth-card h1 {
        font-size: 1.3rem;
    }

    .auth-form {
        gap: 8px;
        margin-top: 10px;
    }

    .auth-field input {
        padding: 8px 10px;
    }

    .auth-switch {
        margin-top: 8px;
        padding-top: 8px;
    }
}
