/*
 * Halaman publik panel sekolah: pilih peran (landing) dan semua halaman masuk.
 * Gaya mengikuti halaman masuk Admin Pusat: panel biru #40A2F5 bergaris kisi
 * putih tipis di kiri, form bersih di kanan; di HP panel biru jadi header ringkas.
 */
:root {
    --ssp: #40A2F5;
    --ssp-dark: #1f7fd6;
    --ssp-deep: #0b3a66;
    --ssp-soft: #e8f3fe;
    --ink: #0f172a;
    --muted: #64748b;
    --line: #e2e8f0;
    --page: #f4f8fd;
}

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

html,
body {
    height: 100%;
}

body {
    margin: 0;
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--ink);
    background: var(--page);
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--ssp-dark);
}

h1,
h2,
h3,
p {
    margin: 0;
}

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

/* ---------- Panel brand (kiri) ---------- */
.brand-panel {
    position: relative;
    overflow: hidden;
    background-color: var(--ssp);
    background-image:
        linear-gradient(rgba(255, 255, 255, .16) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .16) 1px, transparent 1px);
    background-size: 56px 56px;
    color: #fff;
    padding: 48px 56px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 40px;
}

.brand-top {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-top img {
    flex: 0 0 56px;
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: #fff;
    padding: 4px;
    object-fit: contain;
}

.brand-top .name {
    font-weight: 800;
    font-size: 1.05rem;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.brand-top .name small {
    display: block;
    font-weight: 600;
    font-size: .8rem;
    opacity: .92;
}

.brand-body h1 {
    font-size: clamp(2rem, 3.2vw, 2.9rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -.02em;
    margin: 0 0 16px;
}

.brand-body .lead-text {
    font-size: 1.05rem;
    max-width: 470px;
    margin: 0 0 28px;
    opacity: .96;
}

.feature-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 12px;
    max-width: 470px;
}

.feature-list li {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #fff;
    color: var(--ink);
    border-radius: 14px;
    padding: 12px 16px;
    font-weight: 600;
    font-size: .95rem;
    line-height: 1.35;
    box-shadow: 0 8px 20px rgba(11, 58, 102, .12);
}

.feature-list li a {
    font-weight: 700;
}

.feature-list .ico {
    flex: 0 0 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--ssp-soft);
    color: var(--ssp-dark);
    display: grid;
    place-items: center;
    font-size: 1rem;
}

.feature-list small {
    display: block;
    font-weight: 500;
    color: var(--muted);
    font-size: .82rem;
    margin-top: 2px;
}

.brand-foot {
    font-size: .82rem;
    opacity: .92;
}

/* ---------- Panel form (kanan) ---------- */
.form-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
}

.form-card {
    width: 100%;
    max-width: 420px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-weight: 700;
    font-size: .875rem;
    text-decoration: none;
    padding: 6px 0;
    margin-bottom: 22px;
}

.back-link:hover,
.back-link:focus-visible {
    color: var(--ssp-dark);
}

.badge-area {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--ssp-soft);
    color: var(--ssp-dark);
    font-weight: 700;
    font-size: .8rem;
    padding: 6px 12px;
    border-radius: 999px;
    margin-bottom: 16px;
}

.form-card h2 {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -.01em;
    line-height: 1.2;
    margin: 0 0 6px;
}

.form-card .sub {
    color: var(--muted);
    margin: 0 0 26px;
}

.field {
    margin-bottom: 18px;
}

.field label {
    display: block;
    font-weight: 700;
    font-size: .875rem;
    margin-bottom: 8px;
}

.field .hint {
    margin-top: 6px;
    font-size: .8rem;
    color: var(--muted);
}

.input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrap .lead-ico {
    position: absolute;
    left: 16px;
    color: #94a3b8;
    pointer-events: none;
    z-index: 1;
}

.input-wrap input,
.input-wrap select {
    width: 100%;
    height: 52px;
    border: 1.5px solid var(--line);
    border-radius: 14px;
    padding: 0 48px 0 46px;
    font-size: 1rem;
    font-family: inherit;
    background: #fff;
    color: var(--ink);
    transition: border-color .2s, box-shadow .2s;
}

.input-wrap select {
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.input-wrap select:invalid,
.input-wrap select.is-empty {
    color: #94a3b8;
}

.input-wrap select option {
    color: var(--ink);
}

.input-wrap .select-caret {
    position: absolute;
    right: 18px;
    color: var(--muted);
    pointer-events: none;
    font-size: .85rem;
}

.input-wrap input::placeholder {
    color: #94a3b8;
}

.input-wrap input:focus,
.input-wrap select:focus {
    outline: none;
    border-color: var(--ssp);
    box-shadow: 0 0 0 4px rgba(64, 162, 245, .18);
}

.input-wrap input[aria-invalid="true"],
.input-wrap select[aria-invalid="true"] {
    border-color: #f87171;
}

.input-wrap input[disabled],
.input-wrap select[disabled] {
    background: #f8fafc;
}

.toggle-pass {
    position: absolute;
    right: 8px;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 1rem;
}

.toggle-pass:hover,
.toggle-pass:focus-visible {
    background: #f1f5f9;
    color: var(--ink);
    outline: none;
}

.caps-warning {
    display: none;
    margin-top: 8px;
    font-size: .82rem;
    font-weight: 600;
    color: #b45309;
}

.caps-warning.show {
    display: block;
}

.form-alert {
    display: none;
    align-items: flex-start;
    gap: 10px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: .9rem;
    font-weight: 600;
    margin-bottom: 18px;
}

.form-alert i {
    margin-top: 3px;
}

.form-alert.show {
    display: flex;
}

.btn-submit {
    width: 100%;
    height: 52px;
    border: 0;
    border-radius: 14px;
    background: var(--ssp);
    color: #fff;
    font-weight: 800;
    font-size: 1rem;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 6px;
    cursor: pointer;
    transition: background .2s, transform .1s;
}

.btn-submit:hover {
    background: var(--ssp-dark);
}

.btn-submit:active {
    transform: translateY(1px);
}

.btn-submit:focus-visible {
    outline: 3px solid rgba(64, 162, 245, .45);
    outline-offset: 2px;
}

.btn-submit[disabled],
.btn-submit.loading {
    opacity: .8;
    cursor: wait;
}

.btn-submit .spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255, 255, 255, .45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: ssp-spin .8s linear infinite;
}

.btn-submit.loading .spinner {
    display: inline-block;
}

.btn-submit.loading .arrow {
    display: none;
}

@keyframes ssp-spin {
    to {
        transform: rotate(360deg);
    }
}

.note {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-top: 22px;
    padding: 12px 14px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid var(--line);
    color: var(--muted);
    font-size: .85rem;
}

.note i {
    color: var(--ssp-dark);
    margin-top: 3px;
}

.extra-links {
    list-style: none;
    padding: 0;
    margin: 16px 0 0;
    display: grid;
    gap: 10px;
}

.extra-links a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1.5px solid var(--line);
    border-radius: 12px;
    background: #fff;
    color: var(--ink);
    font-weight: 700;
    font-size: .9rem;
    text-decoration: none;
    transition: border-color .2s;
}

.extra-links a:hover,
.extra-links a:focus-visible {
    border-color: var(--ssp);
    outline: none;
}

.extra-links a .ico {
    color: var(--ssp-dark);
    width: 18px;
    text-align: center;
}

.extra-links a small {
    display: block;
    font-weight: 500;
    color: var(--muted);
    font-size: .8rem;
}

.extra-links a .go {
    margin-left: auto;
    color: var(--muted);
    font-size: .8rem;
}

.copyright {
    margin-top: 28px;
    text-align: center;
    font-size: .78rem;
    color: #94a3b8;
}

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

/* ---------- Pilih peran (landing) ---------- */
.auth-landing {
    grid-template-columns: minmax(340px, 440px) minmax(0, 1fr);
}

/* Isi panel biru landing; panelnya sendiri yang dibuat tetap (lihat blok desktop di bawah). */
.auth-landing .brand-panel {
    display: block;
    padding: 0;
}

.brand-sticky {
    min-height: 100%;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 32px;
}

.brand-panel .feature-list a {
    color: var(--ssp-dark);
    text-underline-offset: 3px;
}

.auth-landing .brand-body h1 {
    font-size: clamp(2rem, 2.8vw, 2.6rem);
}

.social {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.social a {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, .18);
    color: #fff;
    text-decoration: none;
}

.social a:hover,
.social a:focus-visible {
    background: rgba(255, 255, 255, .32);
    outline: none;
}

.social-light {
    justify-content: center;
}

.social-light a {
    background: var(--ssp-soft);
    color: var(--ssp-dark);
}

.social-light a:hover,
.social-light a:focus-visible {
    background: #d4e9fd;
}

.gallery {
    padding: 48px 48px 40px;
    max-width: 1080px;
    width: 100%;
}

.gallery-head h2 {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -.01em;
    margin: 0 0 6px;
}

.gallery-head p {
    color: var(--muted);
    margin: 0 0 8px;
}

.role-group {
    margin-top: 28px;
}

.role-group h3 {
    font-size: .8rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 0 0 12px;
}

.role-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 14px;
}

.role-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: 100%;
    padding: 18px;
    background: #fff;
    border: 1.5px solid var(--line);
    border-radius: 16px;
    color: var(--ink);
    text-decoration: none;
    transition: border-color .2s, box-shadow .2s, transform .15s;
}

.role-card:hover,
.role-card:focus-visible {
    border-color: var(--ssp);
    box-shadow: 0 10px 24px rgba(11, 58, 102, .10);
    transform: translateY(-2px);
    outline: none;
}

.role-card:focus-visible {
    box-shadow: 0 0 0 4px rgba(64, 162, 245, .25);
}

.role-card .top {
    display: flex;
    align-items: center;
    gap: 12px;
}

.role-card .ico {
    flex: 0 0 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--ssp-soft);
    color: var(--ssp-dark);
    display: grid;
    place-items: center;
    font-size: 1.1rem;
}

.role-card .title {
    font-weight: 800;
    font-size: 1.02rem;
    line-height: 1.25;
}

.role-card .go {
    margin-left: auto;
    color: var(--ssp-dark);
    font-size: .9rem;
    transition: transform .15s;
}

.role-card:hover .go {
    transform: translateX(3px);
}

.role-card .desc {
    color: var(--muted);
    font-size: .875rem;
    line-height: 1.45;
    flex: 1 1 auto;
}

.role-card .key {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f1f5f9;
    color: #334155;
    font-weight: 700;
    font-size: .76rem;
    padding: 5px 10px;
    border-radius: 999px;
}

.role-card .key i {
    color: var(--muted);
}

.help-block {
    margin-top: 32px;
}

.help-block .feature-list {
    max-width: none;
}

.only-mobile {
    display: none;
}

.gallery .copyright {
    text-align: left;
}

/* ---------- Desktop: panel biru tetap, kolom kanan yang bergulir ---------- */
@media (min-width: 992px) {
    /*
     * Panel kiri menempel setinggi layar (sticky terhadap halaman), jadi saat
     * galeri peran / form di kanan lebih tinggi dari layar hanya kolom kanan
     * yang ikut bergulir. Di layar pendek isi panel bergulir sendiri supaya
     * tidak terpotong. Sticky dipasang di panelnya langsung: overflow:hidden
     * pada panel membuat sticky di elemen anak tidak pernah aktif.
     */
    .brand-panel {
        position: sticky;
        top: 0;
        align-self: start;
        height: 100vh;
        height: 100dvh;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        scrollbar-width: thin;
        scrollbar-color: rgba(255, 255, 255, .5) transparent;
    }
}

/* Layar desktop pendek (mis. 1366x650): rapatkan jarak vertikal panel biru. */
@media (min-width: 992px) and (max-height: 760px) {
    .brand-panel {
        padding-top: 32px;
        padding-bottom: 32px;
        gap: 28px;
    }

    .brand-sticky {
        padding-top: 28px;
        padding-bottom: 28px;
        gap: 24px;
    }
}

/* ---------- HP / tablet ---------- */
@media (max-width: 991.98px) {
    .auth,
    .auth-landing {
        grid-template-columns: 1fr;
    }

    .brand-panel,
    .brand-sticky {
        position: relative;
        min-height: 0;
        padding: 24px 16px 28px;
        gap: 20px;
    }

    .auth-landing .brand-panel {
        padding: 0;
    }

    .brand-top img {
        flex-basis: 48px;
        width: 48px;
        height: 48px;
        border-radius: 12px;
    }

    .brand-body h1,
    .auth-landing .brand-body h1 {
        font-size: 1.65rem;
        margin-bottom: 8px;
    }

    .brand-body .lead-text {
        font-size: .95rem;
        margin-bottom: 0;
    }

    .brand-panel .feature-list,
    .brand-foot {
        display: none;
    }

    .form-panel {
        padding: 24px 16px 40px;
        align-items: flex-start;
    }

    .form-card {
        max-width: 520px;
        margin: 0 auto;
    }

    .form-card h2 {
        font-size: 1.5rem;
    }

    .back-link {
        margin-bottom: 14px;
    }

    .gallery {
        padding: 24px 16px 40px;
    }

    .gallery-head h2 {
        font-size: 1.4rem;
    }

    .role-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .role-card {
        padding: 14px 16px;
        gap: 8px;
    }

    .only-mobile {
        display: block;
    }

    .only-desktop {
        display: none;
    }

    .help-block .feature-list {
        display: grid;
    }

    .help-block .feature-list li {
        box-shadow: none;
        border: 1.5px solid var(--line);
    }

    .gallery .copyright {
        text-align: center;
    }
}

@media (min-width: 600px) and (max-width: 991.98px) {
    .role-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

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