/* Portal login — mobile-first; desktop di breakpoint 992px+ */

.auth-portal-page {
    position: relative;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.auth-portal-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.auth-portal-bg__orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.45;
}

.auth-portal-bg__orb--1 {
    width: min(420px, 70vw);
    height: min(420px, 70vw);
    top: -12%;
    right: -8%;
    background: rgba(255, 255, 255, 0.22);
}

.auth-portal-bg__orb--2 {
    width: min(360px, 60vw);
    height: min(360px, 60vw);
    bottom: -10%;
    left: -12%;
    background: rgba(45, 212, 191, 0.25);
}

.auth-portal-bg__grid {
    position: absolute;
    inset: 0;
    opacity: 0.12;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.35) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.35) 1px, transparent 1px);
    background-size: 28px 28px;
    mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 20%, transparent 75%);
}

/* Pembungkus tengah — skala mengikuti lebar layar PC */
.auth-portal-viewport {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-inline: clamp(0.5rem, 2.5vw, 1.25rem);
    box-sizing: border-box;
}

.auth-portal-shell {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: clamp(1rem, 3vw, 1.5rem);
    min-height: 0;
}

/* === HP / ponsel (tetap seperti semula, < 992px) === */
.auth-portal-shell--narrow {
    max-width: 100%;
}

@media (min-width: 576px) and (max-width: 991.98px) {
    .auth-portal-shell--narrow {
        max-width: min(440px, 94vw);
        margin-inline: auto;
    }
}

/* Halaman pilih peran — mobile/tablet: satu kolom vertikal, lebar penuh */
.auth-portal-shell--wide {
    width: 100%;
    max-width: 100%;
    margin-inline: auto;
}

@media (min-width: 576px) and (max-width: 991.98px) {
    .auth-portal-shell--wide {
        max-width: min(520px, 94vw);
    }
}

@media (max-width: 991.98px) {
    .auth-portal-shell--wide .auth-portal-hero {
        text-align: center;
    }

    .auth-portal-shell--wide .auth-portal-headline {
        margin-inline: auto;
        text-align: center;
    }

    .auth-portal-shell--wide .auth-portal-formal-body {
        font-size: 0.8rem;
        max-height: 12rem;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Hero — mobile */
.auth-portal-hero {
    text-align: center;
    color: #fff;
    flex-shrink: 0;
}

.auth-portal-hero .logo-ring {
    margin: 0 auto clamp(0.65rem, 2vw, 0.85rem);
}

.auth-portal-hero .logo-ring--fallback {
    width: clamp(72px, 18vw, 92px);
    height: clamp(72px, 18vw, 92px);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    border: 2px solid rgba(255, 255, 255, 0.38);
    backdrop-filter: blur(6px);
}

.auth-portal-hero .logo-fallback {
    font-weight: 800;
    font-size: clamp(1.1rem, 4vw, 1.4rem);
    letter-spacing: 0.06em;
}

.auth-portal-hero .kicker {
    font-size: clamp(0.62rem, 2vw, 0.68rem);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    opacity: 0.88;
    margin-bottom: 0.4rem;
    font-weight: 600;
}

/* Kop — logo + identitas + alamat */
.auth-portal-kop {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: clamp(0.65rem, 3vw, 1rem);
    width: min(100%, 32rem);
    margin: 0 auto 0.85rem;
    padding: 0.65rem 0.75rem;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(8px);
}

.auth-portal-kop__logo {
    flex-shrink: 0;
}

.auth-portal-kop__logo .logo-ring:not(.logo-ring--fallback),
.auth-portal-kop__logo .logo-ring--round,
.auth-portal-hero .logo-ring:not(.logo-ring--fallback),
.auth-portal-hero .logo-ring--round {
    margin: 0;
    width: clamp(68px, 17vw, 84px);
    height: clamp(68px, 17vw, 84px);
    min-width: clamp(68px, 17vw, 84px);
    min-height: clamp(68px, 17vw, 84px);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    aspect-ratio: 1 / 1;
    background: #fff;
    border: 1px solid rgba(255, 255, 255, 0.55);
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.18);
    overflow: hidden;
    flex-shrink: 0;
    padding: 2px;
    isolation: isolate;
}

.auth-portal-kop__logo .logo-ring img,
.auth-portal-kop__logo .auth-portal-logo-img,
.auth-portal-hero .logo-ring img,
.auth-portal-hero .logo-ring--round img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    object-fit: cover;
    object-position: center center;
    padding: 0;
    margin: 0;
    border-radius: 50%;
    background: #fff;
    filter: none;
}

.auth-portal-kop__logo .logo-ring--fallback {
    width: clamp(68px, 17vw, 84px);
    height: clamp(68px, 17vw, 84px);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.42);
    padding: 0;
}

.auth-portal-kop__logo .logo-ring--fallback .logo-fallback {
    transform: none;
}

[data-theme="dark"] .auth-portal-kop__logo .logo-ring:not(.logo-ring--fallback) {
    background: #fff;
    border: 1px solid rgba(255, 255, 255, 0.55);
}

.auth-portal-kop__teks {
    flex: 1 1 auto;
    min-width: 0;
    text-align: left;
}

.auth-portal-kop__jenis {
    font-size: clamp(0.68rem, 2.2vw, 0.78rem);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    opacity: 0.9;
    line-height: 1.3;
}

.auth-portal-kop__nama {
    font-size: clamp(0.92rem, 3vw, 1.08rem);
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: -0.02em;
    margin-top: 0.15rem !important;
}

.auth-portal-kop__alamat {
    font-size: clamp(0.72rem, 2.4vw, 0.82rem);
    font-weight: 500;
    line-height: 1.45;
    opacity: 0.9;
    margin-top: 0.35rem !important;
    overflow-wrap: anywhere;
}

.auth-portal-headline {
    font-size: clamp(1rem, 3.2vw, 1.28rem);
    font-weight: 800;
    line-height: 1.35;
    letter-spacing: -0.02em;
    color: #fff;
    text-shadow: 0 2px 12px rgba(15, 23, 42, 0.2);
    margin: 0 0 0.5rem;
    max-width: min(100%, 34rem);
}

.auth-portal-hero-text {
    width: min(100%, 34rem);
    margin-inline: auto;
}

.auth-portal-hero .auth-portal-salam--utama {
    font-size: clamp(1rem, 3.5vw, 1.22rem);
    font-weight: 700;
    line-height: 1.4;
    margin: 0 0 0.5rem;
    max-width: none;
    text-align: center;
}

.auth-portal-formal-body {
    font-size: clamp(0.8rem, 2.5vw, 0.875rem);
    line-height: 1.55;
    width: 100%;
    max-width: min(100%, 34rem);
    margin: 0 auto 0.65rem;
    padding: 0.7rem 0.85rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.11);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.96);
    text-align: left;
}

.auth-portal-formal-body p {
    margin: 0 0 0.5rem;
}

.auth-portal-formal-body p:last-child {
    margin-bottom: 0;
}

.auth-portal-pintu-hint {
    font-size: clamp(0.8rem, 2.4vw, 0.88rem);
    font-weight: 600;
    line-height: 1.5;
    opacity: 0.94;
    max-width: min(100%, 34rem);
    margin-inline: auto;
    text-align: center;
}

.auth-portal-pondok-identity {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    max-width: 100%;
    margin-bottom: 0.5rem;
    padding-inline: 0.35rem;
}

.auth-portal-pondok-identity .auth-portal-brand-kicker {
    text-transform: none;
    letter-spacing: 0.02em;
    font-size: clamp(0.72rem, 2.8vw, 0.82rem);
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: 0;
    opacity: 0.92;
    overflow-wrap: anywhere;
    word-break: break-word;
    hyphens: auto;
}

.auth-portal-pondok-identity .auth-portal-brand {
    margin-top: 0.1rem;
}

.auth-portal-hero .auth-portal-brand {
    font-size: clamp(1.1rem, 3.4vw, 1.35rem);
    font-weight: 800;
    margin: 0 0 0.35rem;
    line-height: 1.35;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 10px rgba(15, 23, 42, 0.18);
    overflow-wrap: anywhere;
    word-break: break-word;
    hyphens: auto;
    padding-inline: clamp(0.25rem, 2vw, 0.75rem);
    max-width: 100%;
}

.auth-portal-hero .auth-portal-salam {
    font-size: clamp(1.2rem, 3.8vw, 1.55rem);
    font-weight: 700;
    margin: 0 0 0.35rem;
    letter-spacing: -0.02em;
    line-height: 1.25;
    text-shadow: 0 2px 12px rgba(15, 23, 42, 0.2);
    opacity: 0.96;
}

.auth-portal-hero .auth-portal-salam--utama {
    font-size: clamp(1.05rem, 3.2vw, 1.42rem);
    font-weight: 600;
    line-height: 1.45;
    letter-spacing: 0.01em;
    max-width: 28rem;
    margin-inline: auto;
}

.auth-portal-hero .auth-portal-salam-waktu {
    font-size: clamp(0.92rem, 2.6vw, 1.05rem);
    font-weight: 500;
    line-height: 1.4;
    opacity: 0.92;
    text-shadow: 0 1px 8px rgba(15, 23, 42, 0.15);
    padding-inline: clamp(0.25rem, 2vw, 0.75rem);
    max-width: 26rem;
    margin-inline: auto;
}

.auth-portal-hero .auth-portal-tagline {
    font-size: clamp(0.88rem, 2.5vw, 0.98rem);
    font-weight: 500;
    margin: 0 0 0.55rem;
    line-height: 1.45;
    opacity: 0.9;
}

.auth-portal-hero-text {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.auth-portal-hero-lead,
.auth-portal-hero-follow {
    min-width: 0;
}

.auth-portal-hero .sub {
    font-size: clamp(0.84rem, 2.4vw, 0.92rem);
    opacity: 0.9;
    margin: 0;
    line-height: 1.5;
    max-width: 36ch;
    margin-inline: auto;
}

.auth-portal-sub-line--desktop {
    display: none;
}

.auth-portal-sub-line--mobile {
    display: block;
}

/* Kartu */
.auth-portal-card {
    border-radius: clamp(14px, 3vw, 20px);
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: var(--ap-auth-surface);
    box-shadow:
        0 12px 32px rgba(15, 23, 42, 0.14),
        0 0 0 1px rgba(255, 255, 255, 0.06) inset;
    backdrop-filter: blur(14px);
    overflow: hidden;
    width: 100%;
}

@media (max-width: 575.98px) {
    .auth-portal-card {
        box-shadow:
            0 8px 20px rgba(15, 23, 42, 0.1),
            0 0 0 1px rgba(255, 255, 255, 0.06) inset;
    }

    .auth-portal-hero .logo-ring img {
        transform: scale(1.14);
    }
}

.auth-portal-card__head {
    padding: 0.85rem 1.15rem;
    background: linear-gradient(120deg, var(--ap-auth-accent) 0%, var(--ap-auth-accent-mid, var(--ap-auth-accent)) 100%);
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.auth-portal-card__head-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.auth-portal-card__head-meta {
    font-size: 0.78rem;
    opacity: 0.9;
    margin: 0.2rem 0 0;
    line-height: 1.4;
}

.auth-portal-card__body {
    padding: clamp(1rem, 3.5vw, 1.35rem);
}

.auth-portal-role-grid--compact {
    gap: 0.45rem;
}

.auth-portal-role-grid--compact .auth-portal-role {
    min-height: 3.75rem;
    padding: 0.65rem 0.75rem;
}

.auth-portal-hub__section + .auth-portal-hub__section {
    padding-top: 0.25rem;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
}

[data-theme="dark"] .auth-portal-hub__section + .auth-portal-hub__section {
    border-top-color: rgba(148, 163, 184, 0.2);
}

/* Grid peran — mobile */
.auth-portal-role-grid {
    display: grid;
    gap: 0.55rem;
    grid-template-columns: 1fr;
}

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

.auth-portal-role {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.75rem 0.9rem 0.85rem;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #0f766e;
    background: #ffffff;
    text-decoration: none;
    color: #0f172a;
    transition: none;
    min-height: 4.5rem;
    height: 100%;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

@media (hover: hover) and (pointer: fine) {
    .auth-portal-role:hover {
        border-color: #99f6e4;
        box-shadow: 0 6px 18px rgba(15, 118, 110, 0.12);
        color: #0f172a;
    }

    .auth-portal-role:hover .auth-portal-role__go {
        opacity: 1;
        color: #0f766e;
    }
}

.auth-portal-role__icon {
    flex: 0 0 auto;
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.auth-portal-role__icon--pengurus { background: rgba(15, 118, 110, 0.14); color: #0f766e; }
.auth-portal-role__icon--pembimbing { background: rgba(37, 99, 235, 0.12); color: #2563eb; }
.auth-portal-role__icon--presensi { background: rgba(8, 145, 178, 0.14); color: #0891b2; }
.auth-portal-role__icon--wali { background: rgba(22, 163, 74, 0.12); color: #16a34a; }
.auth-portal-role__icon--koperasi { background: rgba(217, 119, 6, 0.14); color: #d97706; }
.auth-portal-role__icon--santri { background: rgba(124, 58, 237, 0.12); color: #7c3aed; }
.auth-portal-role__icon--mukimin { background: rgba(100, 116, 139, 0.14); color: #475569; }

.auth-portal-role__text {
    flex: 1 1 auto;
    min-width: 0;
}

.auth-portal-role__text strong {
    display: block;
    font-size: 0.88rem;
    font-weight: 800;
    line-height: 1.25;
    color: #0f172a;
}

.auth-portal-role__text span {
    display: block;
    font-size: 0.74rem;
    color: #475569;
    margin-top: 0.15rem;
    line-height: 1.4;
    padding-bottom: 0.05rem;
}

.auth-portal-role__go {
    flex: 0 0 auto;
    opacity: 0.35;
    font-size: 0.72rem;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.auth-portal-role--full {
    grid-column: 1 / -1;
}

@media (min-width: 400px) and (max-width: 991.98px) {
    .auth-portal-role--full-sm {
        grid-column: 1 / -1;
    }
}

.auth-portal-form .form-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #334155;
}

.auth-portal-form .input-group-text {
    background: rgba(240, 253, 250, 0.9);
    border-color: #cbd5e1;
    color: var(--ap-auth-accent);
}

.auth-portal-form .form-control {
    border-radius: 0 0.65rem 0.65rem 0;
    border-color: #cbd5e1;
    padding-block: 0.6rem;
}

.auth-portal-form .input-group .form-control {
    border-radius: 0 0.65rem 0.65rem 0;
}

.auth-portal-form .input-group > .input-group-text {
    border-radius: 0.65rem 0 0 0.65rem;
}

.auth-portal-back {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--ap-auth-accent);
    text-decoration: none;
    margin-bottom: 0.75rem;
}

.auth-portal-back:hover {
    color: var(--ap-auth-accent-dark);
}

.auth-portal-footnote {
    font-size: 0.75rem;
    color: #64748b;
    text-align: center;
    margin: 0.85rem 0 0;
    line-height: 1.45;
}

.auth-portal-links {
    flex-shrink: 0;
}

/* =============================================================================
   PC / komputer — layar lebar (992px+)
   Layout dua kolom: salam kiri, kartu kanan
   ============================================================================= */
@media (min-width: 992px) {
    .auth-portal-viewport {
        width: min(1180px, 90vw);
        padding-inline: clamp(1rem, 2vw, 2rem);
    }

    .auth-portal-shell--wide {
        display: grid;
        grid-template-columns: minmax(0, 1.15fr) minmax(380px, 480px);
        grid-template-rows: auto auto;
        align-items: center;
        column-gap: clamp(2rem, 4vw, 3.25rem);
        row-gap: 1.25rem;
        width: 100%;
        max-width: none;
        margin-inline: auto;
    }

    .auth-portal-shell--wide .auth-portal-hero {
        grid-column: 1;
        grid-row: 1;
        text-align: left;
        align-self: center;
        padding: clamp(0.5rem, 2vw, 1.25rem) clamp(1rem, 3vw, 2rem) clamp(0.5rem, 2vw, 1rem) clamp(1.25rem, 3.5vw, 2.5rem);
    }

    .auth-portal-shell--wide .auth-portal-kop {
        margin-left: 0;
        margin-right: 0;
        width: 100%;
        max-width: min(100%, 520px);
        padding: 0.85rem 1rem;
    }

    .auth-portal-shell--wide .auth-portal-kop__logo .logo-ring {
        width: 84px;
        height: 84px;
        min-width: 84px;
        min-height: 84px;
        border-radius: 50%;
    }

    .auth-portal-shell--wide .auth-portal-hero .logo-ring img,
    .auth-portal-shell--wide .auth-portal-kop__logo .auth-portal-logo-img {
        width: 100% !important;
        height: 100% !important;
        max-width: none !important;
        max-height: none !important;
        border-radius: 50%;
        object-fit: cover;
        transform: scale(1.14);
    }

    .auth-portal-shell--wide .auth-portal-kop__nama {
        font-size: 1.05rem;
    }

    .auth-portal-shell--wide .auth-portal-headline {
        font-size: clamp(1.15rem, 1.5vw, 1.4rem);
        max-width: 520px;
        text-align: left;
    }

    .auth-portal-shell--wide .auth-portal-hero-text {
        width: 100%;
        max-width: min(100%, 520px);
        margin-left: 0;
        margin-right: 0;
    }

    .auth-portal-shell--wide .auth-portal-salam--utama {
        text-align: left;
    }

    .auth-portal-shell--wide .auth-portal-formal-body {
        margin-left: 0;
        margin-right: 0;
        max-width: 520px;
        font-size: 0.875rem;
    }

    .auth-portal-shell--wide .auth-portal-pintu-hint {
        margin-left: 0;
        text-align: left;
        max-width: 520px;
    }

    .auth-portal-shell--wide .auth-portal-hero .logo-ring--fallback {
        width: 100px;
        height: 100px;
        font-size: 1.5rem;
    }

    .auth-portal-shell--wide .auth-portal-brand {
        font-size: clamp(1.35rem, 1.8vw, 1.65rem);
        max-width: 28ch;
        line-height: 1.3;
    }

    .auth-portal-shell--wide .auth-portal-salam {
        font-size: clamp(1.5rem, 2vw, 1.85rem);
        max-width: 20ch;
    }


    .auth-portal-shell--wide .auth-portal-sub-line--mobile {
        display: none;
    }

    .auth-portal-shell--wide .auth-portal-sub-line--desktop {
        display: block;
    }

    .auth-portal-shell--wide .auth-portal-card {
        grid-column: 2;
        grid-row: 1;
        align-self: center;
    }

    .auth-portal-shell--wide > .auth-portal-links {
        grid-column: 1 / -1;
        grid-row: 2;
        justify-content: flex-start;
        text-align: left;
        margin-top: 0.25rem;
    }

    .auth-portal-shell--wide .auth-portal-card__head {
        padding: 1rem 1.35rem;
    }

    .auth-portal-shell--wide .auth-portal-card__head-title {
        font-size: 1.05rem;
    }

    .auth-portal-shell--wide .auth-portal-card__head-meta {
        font-size: 0.82rem;
    }

    .auth-portal-shell--wide .auth-portal-card__body {
        padding: 1.25rem 1.35rem 1.4rem;
    }

    .auth-portal-shell--wide .auth-portal-role-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-auto-rows: 1fr;
        gap: 0.65rem;
        align-items: stretch;
    }

    .auth-portal-shell--wide .auth-portal-role {
        min-height: 4.6rem;
        padding: 0.75rem 0.95rem 0.9rem;
    }

    .auth-portal-shell--wide .auth-portal-role__text strong {
        font-size: 0.9rem;
    }

    .auth-portal-shell--wide .auth-portal-footnote {
        text-align: left;
    }

    /* Form login (pengurus/pembimbing) — kartu di tengah PC */
    .auth-portal-shell--narrow {
        max-width: min(480px, 42vw);
        margin-inline: auto;
    }

    .auth-portal-shell--narrow .auth-portal-hero {
        text-align: center;
    }

    .auth-portal-shell--narrow .auth-portal-hero .logo-ring {
        margin-inline: auto;
    }

    .auth-portal-shell--narrow .auth-portal-salam {
        font-size: clamp(1.6rem, 2vw, 2rem);
    }

    .auth-portal-shell--narrow .auth-portal-brand {
        font-size: 1.15rem;
    }

    .auth-portal-shell--narrow .auth-portal-tagline {
        font-size: 0.95rem;
    }

    .auth-portal-shell--narrow .auth-portal-hero .sub {
        max-width: 40ch;
    }

    .auth-portal-shell--narrow .auth-portal-card__body {
        padding: 1.35rem 1.5rem 1.5rem;
    }

    .auth-portal-bg__orb--1 {
        width: min(520px, 45vw);
        height: min(520px, 45vw);
    }

    .auth-portal-bg__orb--2 {
        width: min(440px, 38vw);
        height: min(440px, 38vw);
    }
}

/* Layar PC sedang (1200px+) */
@media (min-width: 1200px) {
    .auth-portal-viewport {
        width: min(1240px, 86vw);
    }

    .auth-portal-shell--wide {
        grid-template-columns: minmax(360px, 1.12fr) minmax(460px, 560px);
        column-gap: clamp(2.5rem, 5vw, 4rem);
    }

    .auth-portal-shell--wide .auth-portal-role-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        grid-auto-rows: 1fr;
        gap: 0.7rem;
    }

    .auth-portal-shell--wide .auth-portal-role--full,
    .auth-portal-shell--wide .auth-portal-role--full-sm {
        grid-column: 1 / -1;
    }

    .auth-portal-shell--wide .auth-portal-role {
        min-height: 4.35rem;
    }
}

/* Monitor besar / resolusi tinggi (1536px+) */
@media (min-width: 1536px) {
    .auth-portal-viewport {
        width: min(1280px, 82vw);
    }

    .auth-portal-shell--wide {
        grid-template-columns: minmax(400px, 1.15fr) minmax(500px, 580px);
    }

    .auth-portal-shell--wide .auth-portal-brand {
        font-size: 1.75rem;
    }

    .auth-portal-shell--wide .auth-portal-salam {
        font-size: 2rem;
    }
}

/* Ultrawide — batasi agar tidak terlalu renggang */
@media (min-width: 1920px) {
    .auth-portal-viewport {
        width: 1280px;
    }
}

[data-theme="dark"] .auth-portal-role {
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.95) 0%, rgba(15, 23, 42, 0.9) 100%);
    border-color: rgba(71, 85, 105, 0.5);
    color: #f1f5f9;
}

[data-theme="dark"] .auth-portal-role__text span {
    color: #94a3b8;
}

[data-theme="dark"] .auth-portal-form .form-label {
    color: #e2e8f0;
}

[data-theme="dark"] .auth-portal-form .form-control,
[data-theme="dark"] .auth-portal-form .input-group-text {
    background: rgba(15, 23, 42, 0.65);
    border-color: rgba(71, 85, 105, 0.55);
    color: #f1f5f9;
}

[data-theme="dark"] .auth-portal-footnote {
    color: #94a3b8;
}

/* Portal wali — di dalam kartu auth (sama gaya portal lain) */
.auth-portal-shell--wali.auth-portal-shell--narrow {
    max-width: 100%;
}

@media (min-width: 576px) {
    .auth-portal-shell--wali.auth-portal-shell--narrow {
        max-width: min(520px, 94vw);
    }
}

@media (min-width: 992px) {
    .auth-portal-shell--wali.auth-portal-shell--narrow {
        max-width: min(560px, 46vw);
    }

    .auth-portal-shell--wali .auth-portal-hero-text {
        flex-direction: column;
        gap: 0.65rem;
    }

    .auth-portal-shell--wali .auth-portal-hero-follow {
        border-left: none;
        padding-left: 0;
        padding-top: 0;
    }
}

.auth-portal-wali-steps {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.auth-portal-wali-step {
    flex: 1 1 0;
    text-align: center;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.45rem 0.5rem;
    border-radius: 999px;
    background: rgba(15, 118, 110, 0.08);
    color: #64748b;
    border: 1px solid rgba(15, 118, 110, 0.12);
}

.auth-portal-wali-step.is-active {
    background: var(--ap-auth-accent);
    color: #fff;
    border-color: var(--ap-auth-accent);
}

.auth-portal-inner-panel {
    padding: 0.85rem 0.9rem;
    border-radius: 14px;
    border: 1px solid rgba(15, 118, 110, 0.16);
    background: rgba(240, 253, 250, 0.55);
}

.auth-portal-inner-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--ap-auth-accent);
    margin: 0 0 0.65rem;
}

.auth-portal-wali-pick-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    max-height: min(240px, 40vh);
    overflow-y: auto;
    border-radius: 12px;
    border: 1px solid rgba(15, 118, 110, 0.14);
    background: #fff;
}

.auth-portal-wali-pick {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.65rem 0.75rem;
    border: none;
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
    background: transparent;
    text-align: left;
    font-size: 0.84rem;
    transition: background 0.12s ease;
}

.auth-portal-wali-pick:last-child {
    border-bottom: none;
}

.auth-portal-wali-pick:hover,
.auth-portal-wali-pick.is-selected {
    background: rgba(15, 118, 110, 0.1);
}

.auth-portal-wali-pick.is-selected {
    box-shadow: inset 3px 0 0 var(--ap-auth-accent);
}

.auth-portal-wali-selected {
    padding: 0.75rem 0.85rem;
    border-radius: 12px;
    background: rgba(15, 118, 110, 0.08);
    border: 1px dashed rgba(15, 118, 110, 0.28);
}

.auth-portal-form .input-group-lg > .form-control {
    border-radius: 0 0.65rem 0.65rem 0;
}

.auth-portal-form .input-group-lg > .input-group-text {
    border-radius: 0.65rem 0 0 0.65rem;
}

.auth-portal-form .input-group-lg > .btn-outline-secondary {
    border-radius: 0 0.65rem 0.65rem 0;
}

[data-theme="dark"] .auth-portal-inner-panel {
    background: rgba(15, 118, 110, 0.12);
    border-color: rgba(71, 85, 105, 0.45);
}

[data-theme="dark"] .auth-portal-wali-pick-list {
    background: rgba(15, 23, 42, 0.65);
    border-color: rgba(71, 85, 105, 0.5);
}

[data-theme="dark"] .auth-portal-wali-pick {
    border-bottom-color: rgba(71, 85, 105, 0.45);
    color: #f1f5f9;
}

[data-theme="dark"] .auth-portal-wali-selected {
    background: rgba(15, 118, 110, 0.18);
    border-color: rgba(45, 212, 191, 0.35);
}

/* HP / Android — logo & nama pondok di halaman login */
@media (max-width: 480px) {
    .auth-portal-kop {
        padding: 0.65rem 0.75rem;
    }

    .auth-portal-kop__logo .logo-ring {
        width: clamp(64px, 18vw, 80px);
        height: clamp(64px, 18vw, 80px);
        min-width: clamp(64px, 18vw, 80px);
        min-height: clamp(64px, 18vw, 80px);
    }

    .auth-portal-kop__logo .auth-portal-logo-img {
        transform: scale(1.14);
    }

    .auth-portal-hero .logo-ring {
        width: clamp(64px, 18vw, 80px);
        height: clamp(64px, 18vw, 80px);
        margin-bottom: 0.85rem;
    }

    .auth-portal-hero .logo-ring img {
        width: 100%;
        height: 100%;
        max-width: none;
        max-height: none;
    }

    .auth-portal-hero .auth-portal-brand {
        font-size: clamp(1.02rem, 4.8vw, 1.3rem);
        line-height: 1.32;
    }

    .auth-portal-hero .auth-portal-tagline {
        font-size: clamp(0.78rem, 3.2vw, 0.88rem);
        padding-inline: 0.5rem;
    }
}

@media (display-mode: standalone) {
    .auth-portal-page {
        padding-top: max(1rem, env(safe-area-inset-top, 0px));
        padding-bottom: max(1rem, env(safe-area-inset-bottom, 0px));
    }
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

.auth-portal-page img,
.auth-portal-page video {
    max-width: 100%;
    height: auto;
}

.auth-portal-page .table-responsive,
.auth-portal-page .card-body:has(> table),
.auth-portal-page .card-body:has(> .table) {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Portal pembimbing — masuk dengan scan QR (layout mirip presensi/scan) */
.auth-portal-page--pb-scan {
    padding: max(0.35rem, env(safe-area-inset-top, 0px))
        max(0.35rem, env(safe-area-inset-right, 0px))
        max(0.5rem, env(safe-area-inset-bottom, 0px))
        max(0.35rem, env(safe-area-inset-left, 0px));
}

.auth-portal-page--pb-scan .auth-portal-viewport {
    align-items: stretch;
    padding-inline: 0;
    min-height: calc(100dvh - 0.5rem);
}

.auth-portal-shell--pb-scan {
    width: 100%;
    max-width: min(560px, 100%);
    margin-inline: auto;
    flex: 1;
    min-height: 0;
    gap: 0.5rem;
}

.auth-portal-shell--pb-scan .auth-portal-hero {
    display: none;
}

.auth-portal-shell--pb-scan .auth-portal-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    border-radius: 14px;
}

.auth-portal-shell--pb-scan .auth-portal-card__head {
    padding: 0.55rem 0.85rem;
}

.auth-portal-shell--pb-scan .auth-portal-card__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 0.5rem 0.5rem 0.65rem;
}

.auth-portal-shell--pb-scan .auth-portal-back {
    margin-bottom: 0.35rem;
}

.auth-portal-shell--pb-scan .login-pb-alt {
    margin-top: 0.65rem !important;
}

@media (min-width: 992px) {
    .auth-portal-shell--pb-scan.auth-portal-shell--narrow {
        max-width: min(560px, 52vw);
    }

    .auth-portal-page--pb-scan {
        padding: max(0.5rem, env(safe-area-inset-top, 0px))
            max(0.75rem, env(safe-area-inset-right, 0px))
            max(0.75rem, env(safe-area-inset-bottom, 0px))
            max(0.75rem, env(safe-area-inset-left, 0px));
    }
}
