/* =============================================================
   login.css — Styles untuk halaman Login Admin
   Diekstrak dari inline <style> di login.html agar bisa di-cache
   oleh browser setelah kunjungan pertama.
   ============================================================= */

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Design tokens ── */
:root {
    --cyan: #38bdf8;
    --blue: #818cf8;
    --pink: #f472b6;
    --slate-900: #0f172a;
    --slate-800: #1e293b;
}

/* ── Base ── */
body {
    font-family: 'Inter', sans-serif;
    background: #0f0c29;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex; align-items: center; justify-content: center;
    color: #fff; overflow-x: hidden; overflow-y: auto;
    padding: clamp(0.5rem, 2vh, 1.25rem) 1rem;
}
.ms { font-family: 'Material Symbols Outlined'; line-height: 1; }

/* ── Animated Background ── */
#bg {
    position: fixed; inset: 0; z-index: -1;
    background: linear-gradient(135deg,#0f0c29,#302b63,#24243e);
}
.orb { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .4; pointer-events: none; }
.orb1 { width:400px;height:400px;background:radial-gradient(var(--cyan),var(--blue));top:-100px;left:-100px;animation:f1 10s infinite; }
.orb2 { width:300px;height:300px;background:radial-gradient(var(--pink),#c084fc);bottom:10%;right:-50px;animation:f2 12s infinite; }

@keyframes f1 { 0%,100%{transform:translate(0,0)} 50%{transform:translate(40px,30px)} }
@keyframes f2 { 0%,100%{transform:translate(0,0)} 50%{transform:translate(-30px,40px)} }

/* ── Login Card ── */
.login-card {
    position: relative;
    width: 100%; max-width: 410px;
    padding: clamp(1.15rem, 2.4vh, 1.6rem) clamp(1.25rem, 3vw, 1.75rem);
    background: rgba(255,255,255,0.035); backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255,255,255,0.12); border-radius: 24px;
    box-shadow: 0 25px 60px -15px rgba(0,0,0,0.6);
    animation: cardIn 0.6s cubic-bezier(0.22, 1, 0.36, 1);
    margin: auto;
}
@keyframes cardIn {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Logo ── */
.logo-wrap {
    width: 48px; height: 48px; border-radius: 14px;
    background: linear-gradient(135deg, var(--cyan), var(--blue));
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 0.6rem;
    box-shadow: 0 8px 20px rgba(56,189,248,0.28);
}

/* ── Typography ── */
h1 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 19px; font-weight: 800;
    text-align: center; margin-bottom: 0.15rem;
    letter-spacing: -0.02em;
    /* MWG: text-wrap balance untuk judul pendek */
    text-wrap: balance;
}
p.subtitle {
    text-align: center; color: rgba(255,255,255,0.5);
    font-size: 12px; margin-bottom: 0.9rem;
    text-wrap: pretty;
}

/* ── Form ── */
.form-group { margin-bottom: 0.7rem; }
.form-group label {
    display: block; font-size: 11.5px; font-weight: 600;
    color: rgba(255,255,255,0.7); margin-bottom: 0.25rem; margin-left: 3px;
}
.input-wrap { position: relative; transition: all 0.2s ease; }
.input-wrap span {
    position: absolute; left: 12px; top: 50%;
    transform: translateY(-50%); color: rgba(255,255,255,0.4); font-size: 17px;
    transition: color 0.2s ease; pointer-events: none;
}
.input-wrap input {
    width: 100%; padding: 9.5px 12px 9.5px 38px; border-radius: 10px;
    background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.15);
    color: #fff; font-family: inherit; font-size: 13.5px; transition: all 0.2s;
}
.input-wrap input::placeholder { color: rgba(255,255,255,0.3); }
.input-wrap input:hover {
    background: rgba(255,255,255,0.07); border-color: rgba(255,255,255,0.25);
}
.input-wrap input:focus {
    outline: none; border-color: var(--cyan);
    background: rgba(255,255,255,0.08);
    box-shadow: 0 0 0 3.5px rgba(56, 189, 248, 0.15);
}
.input-wrap input:-webkit-autofill,
.input-wrap input:-webkit-autofill:hover, 
.input-wrap input:-webkit-autofill:focus, 
.input-wrap input:-webkit-autofill:active{
    -webkit-box-shadow: 0 0 0 30px #1e293b inset !important;
    -webkit-text-fill-color: white !important;
    transition: background-color 5000s ease-in-out 0s;
    border-radius: 10px;
}
.input-wrap:focus-within span.ms {
    color: var(--cyan);
}

/* ── Password Eye Toggle Button ── */
.btn-eye {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 5px;
    cursor: pointer;
    color: rgba(255,255,255,0.35);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease, background 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}
.btn-eye:hover {
    color: var(--cyan);
    background: rgba(56, 189, 248, 0.1);
}
.btn-eye:focus-visible {
    outline: 2px solid var(--cyan);
    outline-offset: 2px;
    color: var(--cyan);
}
.btn-eye:active { transform: translateY(-50%) scale(0.9); }
.btn-eye .ms {
    font-size: 16px;
    position: static;
    transform: none;
    pointer-events: none;
    transition: transform 0.12s ease, color 0.2s ease;
    color: inherit;
}
/* Tambah padding kanan agar teks tidak tertutup tombol eye */
.input-wrap input[type="password"],
.input-wrap input[type="text"] {
    padding-right: 38px;
}

/* ── Login Button ── */
#btn-login {
    width: 100%; padding: 10px; border-radius: 10px; border: none;
    background: linear-gradient(135deg, var(--cyan), var(--blue));
    color: #fff; font-size: 13.5px; font-weight: 700; cursor: pointer;
    margin-top: 0.55rem; transition: all 0.2s;
    display: flex; align-items: center; justify-content: center; gap: 6px;
}
#btn-login:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(56,189,248,0.35); }
#btn-login:active { transform: scale(0.98); }

/* ── Footer links ── */
.footer-links { display: flex; justify-content: center; gap: 14px; margin-top: 0.85rem; }
.footer-links a {
    color: rgba(255,255,255,0.4); font-size: 11px;
    text-decoration: none; transition: color 0.2s;
}
.footer-links a:hover { color: var(--cyan); }

/* ── Toast ── */
#toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; }
.toast {
    background: white; color: #333; padding: 12px 20px;
    border-radius: 12px; display: flex; align-items: center; gap: 12px;
    margin-bottom: 10px; box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    animation: toastIn 0.3s forwards;
}
@keyframes toastIn {
    from { transform: translateX(100%); }
    to   { transform: translateX(0); }
}

/* =============================================================
   MWG: prefers-reduced-motion
   Matikan semua animasi untuk pengguna yang meminta gerak minimal.
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
    .orb1, .orb2 { animation: none; }
    .login-card { animation: none; opacity: 1; transform: none; }
    .toast { animation: none; transform: none; }
    input, #btn-login, .footer-links a { transition: none; }
}


/* =============================================================
   UNIVERSAL DIALOG STYLING & ANIMATIONS (Modern Web Standards)
   ============================================================= */
@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.93) translateY(14px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes backdropIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ── CRITICAL & MODERN WEB GUIDANCE SAFEGUARD:
   Pastikan dialog yang tertutup SELALU display: none !important
   sehingga tidak ada override CSS ID yang dapat membocorkan modal ke layar. ── */
dialog:not([open]) {
    display: none !important;
}

dialog[open] {
    margin: auto;
    outline: none;
    color: #fff;
}

dialog::backdrop {
    background: rgba(6, 10, 20, 0.78);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: display 0.3s allow-discrete, overlay 0.3s allow-discrete, opacity 0.3s ease;
}

@media (prefers-reduced-motion: reduce) {
    #modal-forgot-password,
    #modal-reset-success,
    #modal-face-login,
    #modal-select-role { animation: none !important; }
    #modal-forgot-password::backdrop,
    #modal-reset-success::backdrop,
    #modal-face-login::backdrop,
    #modal-select-role::backdrop { animation: none !important; }
}

/* ============================================================
   MODAL FORGOT PASSWORD (Native <dialog>)
   ============================================================ */
#modal-forgot-password {
    border: none;
    border-radius: 28px;
    padding: 2.25rem 2rem;
    max-width: 440px;
    width: calc(100% - 32px);
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.75),
                0 0 0 1px rgba(255, 255, 255, 0.08) inset;
    color: #fff;
    margin: auto;
    position: fixed;
    inset: 0;
    overflow: hidden;
    animation: modalIn 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

#modal-forgot-password::backdrop {
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: backdropIn 0.3s ease;
}

.fp-modal-glow {
    position: absolute;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.22) 0%, transparent 70%);
    top: -90px;
    right: -70px;
    pointer-events: none;
}

.fp-modal-icon {
    width: 64px;
    height: 64px;
    border-radius: 20px;
    background: linear-gradient(135deg, #10b981, #06b6d4);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    box-shadow: 0 12px 30px rgba(16, 185, 129, 0.35),
                0 0 0 1px rgba(255,255,255,0.15) inset;
}

.fp-modal-icon .ms {
    font-size: 32px;
    color: #fff;
}

/* ============================================================
   MODAL SUKSES RESET PASSWORD (Native <dialog>)
   ============================================================ */
#modal-reset-success {
    border: none;
    border-radius: 28px;
    padding: 2.25rem 2rem;
    max-width: 440px;
    width: calc(100% - 32px);
    background: rgba(15, 23, 42, 0.94);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border: 1px solid rgba(16, 185, 129, 0.25);
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.8),
                0 0 0 1px rgba(16, 185, 129, 0.15) inset;
    color: #fff;
    margin: auto;
    position: fixed;
    inset: 0;
    overflow: hidden;
    animation: modalIn 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

#modal-reset-success::backdrop {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: backdropIn 0.3s ease;
}

/* ============================================================
   MODAL PILIH PERAN AKUN (Dual Roles / Multi-Role)
   UI/UX Pro Max Glassmorphism Design System
   ============================================================ */
/* ── FIX: Jangan set display:flex di sini — akan menyebabkan dialog
   langsung tampil saat halaman dibuka (melanggar UA display:none).
   display:flex hanya diterapkan saat dialog TERBUKA via [open] selector. ── */
#modal-select-role {
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 28px;
    padding: 1.5rem 1.6rem;
    max-width: 480px;
    width: min(480px, calc(100vw - 28px));
    max-height: min(92vh, 680px);
    background: rgba(15, 23, 42, 0.94);
    backdrop-filter: blur(32px);
    -webkit-backdrop-filter: blur(32px);
    box-shadow: 0 30px 80px -10px rgba(0, 0, 0, 0.85),
                0 0 50px rgba(99, 102, 241, 0.18),
                inset 0 1px 0 rgba(255, 255, 255, 0.12);
    color: #fff;
    margin: auto;
    position: fixed;
    inset: 0;
    overflow: hidden;
    animation: modalIn 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 999;
}

/* Flex layout hanya aktif saat dialog TERBUKA */
#modal-select-role[open] {
    display: flex;
    flex-direction: column;
}

#modal-select-role::backdrop {
    background: rgba(6, 10, 22, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    animation: backdropIn 0.3s ease;
}

.role-modal-glow {
    position: absolute;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.25) 0%, transparent 70%);
    top: -100px;
    right: -80px;
    pointer-events: none;
    z-index: 0;
}

/* Role Verified Profile Banner */
.role-user-badge-capsule {
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 18px;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
    position: relative;
    z-index: 1;
}

.role-user-badge-pulse {
    position: relative;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 10px #10b981;
    flex-shrink: 0;
}
.role-user-badge-pulse::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    border: 2px solid #10b981;
    opacity: 0.6;
    animation: pulseRing 2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}
@keyframes pulseRing {
    0% { transform: scale(0.8); opacity: 0.8; }
    100% { transform: scale(2.2); opacity: 0; }
}

/* Custom Sleek Scrollbar for Role List */
#role-selection-list {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
    -webkit-overflow-scrolling: touch;
}
#role-selection-list::-webkit-scrollbar {
    width: 5px;
}
#role-selection-list::-webkit-scrollbar-track {
    background: transparent;
}
#role-selection-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.18);
    border-radius: 10px;
}
#role-selection-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.35);
}

/* Role Card Item */
.role-card-item {
    width: 100%;
    text-align: left;
    padding: 0.85rem 1rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    color: #fff;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}

.role-card-item:hover {
    background: rgba(255, 255, 255, 0.085);
    border-color: rgba(99, 102, 241, 0.45);
    transform: translateY(-2px);
    box-shadow: 0 12px 28px -6px rgba(0, 0, 0, 0.5), 0 0 24px rgba(99, 102, 241, 0.16);
}

.role-card-item:active {
    transform: scale(0.985);
}

.role-card-icon-box {
    width: 46px;
    height: 46px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 8px 20px -3px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.25);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.role-card-item:hover .role-card-icon-box {
    transform: scale(1.08);
}

.role-card-arrow-pill {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.7);
    flex-shrink: 0;
    transition: all 0.25s ease;
}

.role-card-item:hover .role-card-arrow-pill {
    background: rgba(99, 102, 241, 0.25);
    border-color: rgba(99, 102, 241, 0.5);
    color: #fff;
    transform: translateX(3px);
}

/* ── Tombol Refresh Aplikasi ── */
#btn-refresh-app {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 10;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.07);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease,
                box-shadow 0.2s ease, transform 0.15s ease;
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

#btn-refresh-app:hover {
    background: rgba(56, 189, 248, 0.15);
    border-color: rgba(56, 189, 248, 0.4);
    color: var(--cyan);
    box-shadow: 0 6px 24px rgba(56, 189, 248, 0.25);
    transform: scale(1.08);
}

#btn-refresh-app:active {
    transform: scale(0.94);
}

#btn-refresh-app:focus-visible {
    outline: 2px solid var(--cyan);
    outline-offset: 3px;
    color: var(--cyan);
}

#btn-refresh-app .ms {
    font-size: 18px;
    position: static;
    transform: none;
    pointer-events: none;
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Animasi spin saat refresh diklik */
@keyframes spinRefresh {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

#btn-refresh-app.is-spinning .ms {
    animation: spinRefresh 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@media (prefers-reduced-motion: reduce) {
    #btn-refresh-app { transition: none; }
    #btn-refresh-app .ms { transition: none; }
    #btn-refresh-app.is-spinning .ms { animation: none; }
    .btn-biometric { transition: none !important; }
}

/* ── Biometric Login Button ── */
.btn-biometric {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.16), rgba(6, 182, 212, 0.16));
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #6ee7b7;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}
.btn-biometric:hover {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.3), rgba(6, 182, 212, 0.3));
    border-color: rgba(52, 211, 153, 0.7);
    color: #a7f3d0;
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.25);
    transform: translateY(-2px);
}
.btn-biometric:active {
    transform: scale(0.98);
}
.btn-biometric .ms {
    transition: transform 0.25s ease;
}
.btn-biometric:hover .ms {
    transform: scale(1.18);
}

/* ── Biometric container: tampil secara default, JS yang menyembunyikannya ── */
#biometric-login-container {
    display: block;
}

/* ── Face Login Button ── */
.btn-face-login {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.16), rgba(99, 102, 241, 0.16));
    border: 1px solid rgba(6, 182, 212, 0.4);
    color: #67e8f9;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}
.btn-face-login:hover {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.3), rgba(99, 102, 241, 0.3));
    border-color: rgba(34, 211, 238, 0.7);
    color: #a5f3fc;
    box-shadow: 0 10px 25px rgba(6, 182, 212, 0.25);
    transform: translateY(-2px);
}
.btn-face-login:active {
    transform: scale(0.98);
}
.btn-face-login .ms {
    transition: transform 0.25s ease;
}
.btn-face-login:hover .ms {
    transform: scale(1.18);
}

/* ── Face Scanner Modal (<dialog>) ── */
#modal-face-login, #modal-register-face {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 26px;
    padding: 1.4rem 1.5rem;
    color: #fff;
    /* Lebar Desktop: Luas & Lega (500px), Responsif di mobile */
    width: min(500px, calc(100vw - 28px));
    max-width: 500px;
    /* Rock-Solid Centering: Posisi tetap terpusat di semua browser desktop & mobile */
    position: fixed;
    top: 50%;
    left: 50%;
    right: auto;
    bottom: auto;
    transform: translate(-50%, -50%);
    margin: 0;
    height: auto;
    max-height: min(96dvh, 96vh, 680px);
    overflow-y: auto;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.75), 0 0 40px rgba(6, 182, 212, 0.25);
    overscroll-behavior: contain;
    -webkit-text-size-adjust: 100%;
    animation: modalIn 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 9999;
}

/* Flex layout only when dialog is open */
#modal-face-login[open], #modal-register-face[open] {
    display: flex;
    flex-direction: column;
}

#modal-face-login::backdrop, #modal-register-face::backdrop {
    background: rgba(8, 12, 22, 0.80);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: backdropIn 0.3s ease;
}

.face-camera-wrapper {
    position: relative;
    /* KUNCI KRUSIAL: Selalu pertahankan rasio kamera 4:3 murni tanpa max-height yang mendistorsi */
    width: 100%;
    max-width: 440px;
    aspect-ratio: 4 / 3;
    margin: 0.45rem auto 0.65rem auto;
    border-radius: 18px;
    overflow: hidden;
    background: #000;
    box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.85), 0 10px 28px rgba(0, 0, 0, 0.45);
    border: 2px solid rgba(56, 189, 248, 0.35);
    touch-action: none;
    flex-shrink: 0;
}

.face-video-feed,
.face-overlay-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1); /* Mirror matching video & canvas */
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
}

.face-overlay-canvas {
    pointer-events: none;
}

/* Animasi garis laser pemindai wajah */
.face-laser-line {
    position: absolute;
    left: 10%;
    width: 80%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #38bdf8, #818cf8, transparent);
    box-shadow: 0 0 12px #38bdf8;
    top: 15%;
    animation: scanFace 2.2s ease-in-out infinite alternate;
    pointer-events: none;
}

@keyframes scanFace {
    0% { top: 15%; opacity: 0.2; }
    50% { opacity: 0.85; }
    100% { top: 85%; opacity: 0.2; }
}

/* ── Spin animation untuk ikon loading biometrik ── */
@keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* ── Responsive Adaptations for Low-Height Screens ── */
@media (max-height: 720px) {
    body { padding: 0.5rem; }
    .login-card {
        padding: 1.1rem 1.4rem;
        border-radius: 20px;
    }
    .logo-wrap {
        width: 42px; height: 42px;
        margin-bottom: 0.4rem;
    }
    h1 { font-size: 17.5px; }
    p.subtitle { font-size: 11.5px; margin-bottom: 0.7rem; }
    .form-group { margin-bottom: 0.55rem; }
    .input-wrap input { padding: 8.5px 12px 8.5px 36px; font-size: 13px; }
    #btn-login { padding: 9px; font-size: 13px; margin-top: 0.45rem; }
    .footer-links { margin-top: 0.65rem; }
}

@media (max-height: 620px) {
    .logo-wrap { display: none; }
    .login-card { padding: 0.9rem 1.25rem; }
    p.subtitle { margin-bottom: 0.5rem; }
    .form-group { margin-bottom: 0.45rem; }
}

/* ══════════════════════════════════════════════════════════════════
   RESPONSIVE & SHORT SCREEN ADAPTATIONS — Face Liveness Modal
   ══════════════════════════════════════════════════════════════════ */

/* Layar Pendek (e.g. Laptop 768p / Viewport height <= 680px) */
@media (max-height: 680px) {
    #modal-face-login, #modal-register-face {
        padding: 0.95rem 1.15rem 0.8rem;
        border-radius: 20px;
    }
    #modal-face-login > p, #modal-register-face > p {
        display: none;
    }
    .face-camera-wrapper {
        /* Skala proporsional 4:3 yang pas dengan sisa tinggi viewport */
        max-width: min(380px, calc((100vh - 210px) * 4 / 3));
        margin: 0.3rem auto 0.45rem auto;
        border-radius: 15px;
    }
}

/* Layar Menengah / Tablet Kecil (max-width: 639px) */
@media (max-width: 639px) {
    #modal-face-login, #modal-register-face {
        width: calc(100vw - 20px);
        max-width: 420px;
        padding: 1.15rem 1rem 0.85rem;
        border-radius: 22px;
    }

    .face-camera-wrapper {
        max-width: min(360px, 100%);
        margin: 0.4rem auto 0.6rem auto;
        border-radius: 16px;
    }
}

/* Layar Ponsel Standar (max-width: 480px) */
@media (max-width: 480px) {
    #modal-face-login, #modal-register-face {
        padding: 1rem 0.9rem 0.8rem;
        border-radius: 20px;
    }

    .face-camera-wrapper {
        max-width: min(330px, 100%);
        margin: 0.35rem auto 0.5rem auto;
        border-radius: 15px;
    }
}

/* Layar Sangat Kecil (e.g. iPhone SE 375px) */
@media (max-width: 380px) {
    #modal-face-login, #modal-register-face {
        padding: 0.85rem 0.8rem 0.75rem;
        border-radius: 18px;
    }

    #modal-face-login > p,
    #modal-register-face > p {
        display: none;
    }

    .face-camera-wrapper {
        max-height: clamp(170px, 34dvh, 220px);
        margin: 0.3rem auto 0.5rem auto;
    }

    .face-laser-line {
        height: 1.5px;
    }
}

/* ── Prevent body scroll saat modal kamera terbuka ──
   Kelas ini ditambahkan/dihapus via JS saat dialog dibuka/ditutup */
body.face-modal-open {
    overflow: hidden;
    /* Mencegah iOS Safari "bounce" scroll yang bisa menggeser modal */
    overscroll-behavior: none;
    /* Prevent position:fixed element from shifting when virtual keyboard opens on Android */
    touch-action: none;
}





