/* ==========================================================================
   E-SpencerOne Login - Single Gate Solution
   Color System v3 (Clean & Professional)
   ========================================================================== */

:root {
    /* Primary */
    --primary:   #3B82F6;
    --secondary: #60A5FA;

    /* Accent */
    --accent: #F59E0B;
    --accent-hover: #D97706;

    /* Base */
    --bg:      #F8FAFC;
    --surface: #FFFFFF;
    --border:  #E2E8F0;

    /* Text */
    --text-primary:   #1E293B;
    --text-secondary: #64748B;
    --text-disabled:  #94A3B8;

    /* Status */
    --success: #22C55E;
    --warning: #F59E0B;
    --error:   #EF4444;
    --info:    #0EA5E9;

    /* Dark card */
    --card-dark: #1E293B;

    --radius: 12px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Poppins', sans-serif;
    min-height: 100vh;
    background: var(--bg);
    overflow-x: hidden; /* Memastikan tidak ada luberan horizontal ke samping */
}

/* ==========================================================================
   TOP NAV
   ========================================================================== */
.top-nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 56px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    z-index: 100;
}

.nav-brand {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.brand-dot {
    width: 8px; height: 8px;
    background: var(--accent);
    border-radius: 50%;
    display: inline-block;
}

/* Center nav links */
.nav-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-center a {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.nav-center a:hover { color: var(--text-primary); }

.nav-home-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: none;
    cursor: pointer;
    text-decoration: none;
    font-family: 'Poppins', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-primary);
    transition: all 0.2s;
}

.nav-home-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.nav-home-btn i { font-size: 0.75rem; }

/* ==========================================================================
   WRAPPER CONTAINER & MAIN CARD (DESKTOP MODAL FULL FRAME)
   ========================================================================== */
.wrapper-container {
    width: 100%;
    height: 100vh; 
    padding: 0 !important; 
    margin: 0 !important;
    background: var(--bg);
}

.login-card-main {
    display: flex;
    width: 100%;
    height: 100%;
    max-width: 100% !important; 
    max-height: 100% !important; 
    border-radius: 0 !important; 
    background: transparent;
    box-shadow: none !important;
}

/* ==========================================================================
   LEFT PANEL (SINGLE GATE FORM DESKTOP - FULL FRAME & CENTERED)
   ========================================================================== */
.left-panel {
    width: 44%; 
    height: calc(100vh - 56px);
    margin-top: 56px; 
    background: var(--surface);
    display: flex;
    align-items: center; 
    justify-content: center; 
    padding: 40px 56px;
    border-right: 1px solid var(--border);
}

.form-inner {
    width: 100%;
    max-width: 340px;
    margin: 0 auto; 
}

.form-heading {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    margin-bottom: 6px;
}

.form-sub {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.5;
}

/* ── Form fields ── */
.field-group { margin-bottom: 20px; }

.field-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.field-input {
    width: 100%;
    border: none;
    border-bottom: 1.5px solid var(--border);
    border-radius: 0;
    padding: 9px 0;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    color: var(--text-primary);
    background: transparent;
    outline: none;
    transition: border-color 0.2s;
}

.field-input::placeholder { color: var(--text-disabled); }
.field-input:focus { border-bottom-color: var(--primary); }

/* ── Password wrapper with eye icon ── */
.pass-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.pass-wrap .field-input {
    padding-right: 28px;
}

.pass-eye {
    position: absolute;
    right: 2px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.82rem;
    color: var(--text-disabled);
    cursor: pointer;
    transition: color 0.2s;
    user-select: none;
}

.pass-eye:hover { color: var(--text-secondary); }

/* ── Alert boxes ── */
.alert-error-box, .alert-success-box {
    border-radius: var(--radius);
    padding: 10px 14px;
    font-size: 0.78rem;
    font-weight: 500;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.alert-error-box   { background: #FEF2F2; border: 1px solid #FECACA; color: var(--error); }
.alert-success-box { background: #F0FDF4; border: 1px solid #A7F3D0; color: #15803D; }

/* ── Remember / Forgot ── */
.row-check {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 8px 0 22px;
}

.check-wrap { display: flex; align-items: center; gap: 7px; }

.check-wrap input {
    accent-color: var(--primary);
    width: 14px; height: 14px;
}

.check-label { font-size: 0.78rem; color: var(--text-secondary); }

.lupa-link {
    font-size: 0.78rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.lupa-link:hover { color: var(--text-primary); }

/* ── Submit button ── */
.btn-login {
    width: 100%;
    height: 46px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-family: 'Poppins', sans-serif;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-login:hover {
    background: #2563EB;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.35);
}

/* ── Info chip bersama ── */
.role-info-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    margin-bottom: 20px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.role-info-chip i { font-size: 0.8rem; flex-shrink: 0; }

/* ==========================================================================
   ── 🛠️ OVERRIDE INLINE STYLE MODAL POP-UP BANTUAN ──
   ========================================================================== */
#modal-hub-admin > div { border-radius: 10px !important; }
#modal-hub-admin a { border-radius: 8px !important; }
#modal-hub-admin div[style*="border-radius:9px"] { border-radius: 6px !important; }
#modal-hub-admin button[style*="border-radius:8px"] { border-radius: 6px !important; }

/* ==========================================================================
   RIGHT PANEL — BACKGROUND FOTO SEKOLAH & MOTIVASI (DESKTOP)
   ========================================================================== */
.right-panel {
    width: 56%; 
    margin-top: 56px;
    height: calc(100vh - 56px);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-image: url('/images/sekolah.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.background-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(15, 23, 42, 0.72) 0%,
        rgba(15, 23, 42, 0.55) 50%,
        rgba(30, 41, 59, 0.68) 100%
    );
    z-index: 1;
}

.motivasi-container {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 520px;
    padding: 40px 48px;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.motivasi-headline {
    font-size: 2rem;
    font-weight: 800;
    color: white;
    letter-spacing: -0.8px;
    line-height: 1.2;
    margin-bottom: 12px;
}

.motivasi-headline span { color: var(--accent); }
.motivasi-sub { font-size: 0.82rem; color: rgba(255,255,255,0.65); line-height: 1.7; margin-bottom: 28px; }


/* ==========================================================================
   ── 📱 REVISI SAKTI: MOBILE & TABLET (FIX CENTERED & ADJUST TIMING TITLE) ──
   ========================================================================== */

@media (max-width: 991.98px) {
    body { 
        overflow-y: auto !important; 
        height: auto !important;
        min-height: 100vh !important;
    }
    
    .top-nav { padding: 0 20px; }
    .nav-center { display: none !important; }
    .nav-home-btn span { display: none !important; }
    .nav-home-btn { padding: 8px 12px; }

    /* Mengubah pembungkus luar di HP menjadi Flexbox Vertikal penuh di belakang screen */
    .wrapper-container {
        height: auto !important;
        min-height: calc(100vh - 56px) !important;
        margin-top: 56px !important;
        padding: 30px 16px 40px 16px !important; /* Jarak atas-bawah seimbang */
        background-image: url('/images/sekolah.jpg') !important;
        background-size: cover !important;
        background-position: center !important;
        background-repeat: no-repeat !important;
        position: relative !important;
        
        /* 🔥 KUNCI UTAMA HP CENTERED: Menggunakan Flexbox Rata Tengah Sempurna */
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
    }

    /* Lapisan gelap overlay di HP */
    .wrapper-container::before {
        content: '';
        position: absolute;
        inset: 0;
        background: linear-gradient(135deg, rgba(15, 23, 42, 0.85) 0%, rgba(30, 41, 59, 0.78) 100%);
        z-index: 1;
    }

    .login-card-main {
        background: transparent !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        z-index: 2 !important;
        position: relative !important;
        height: auto !important;
        max-height: none !important;
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
    }

    /* 🔥 FIX HEADLINE: Memberikan jarak aman agar teks judul turun kebawah dan pas dilihat */
    .right-panel { 
        width: 100% !important;
        height: auto !important;
        margin-top: 0 !important;
        background-image: none !important; 
        padding: 16px 10px 24px 10px !important; /* Memberi ruang jeda */
        z-index: 2 !important;
        display: block !important;
    }
    
    .background-overlay { display: none !important; }
    
    .motivasi-container { 
        padding: 0 !important; 
        max-width: 100% !important;
        text-align: center !important;
    }
    
    .motivasi-headline { 
        font-size: 1.45rem !important; 
        line-height: 1.35;
        margin-bottom: 2px;
        color: #ffffff !important;
    }
    .motivasi-sub { display: none !important; }

    /* 🔥 FIX CENTER CARD CONTAINER FORM */
    .left-panel { 
        width: 100% !important; 
        max-width: 360px !important; /* 🔥 Batasi lebar form di HP agar proporsional di tengah-tengah */
        height: auto !important;
        margin: 0 auto !important; /* Paksa posisi kartu lurus di tengah horizontal screen */
        padding: 32px 24px !important; 
        border-right: none !important;
        z-index: 2 !important;
        display: block !important;
        
        background: rgba(255, 255, 255, 0.14) !important;
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border: 1px solid rgba(255, 255, 255, 0.22) !important;
        border-radius: 20px !important;
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.35);
    }
    
    .form-inner {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .form-heading {
        font-size: 1.4rem;
        text-align: center;
        color: #ffffff !important;
        margin-bottom: 20px;
    }

    /* Kontras teks input diatas kaca transparan */
    .field-label { color: rgba(255, 255, 255, 0.85) !important; }
    .field-input {
        color: #ffffff !important;
        border-bottom-color: rgba(255, 255, 255, 0.3) !important;
    }
    .field-input::placeholder { color: rgba(255, 255, 255, 0.45) !important; }
    .field-input:focus { border-bottom-color: var(--accent) !important; }
    
    .pass-eye { color: rgba(255, 255, 255, 0.6) !important; }
    .check-label, .lupa-link { color: rgba(255, 255, 255, 0.85) !important; }
    
    .role-info-chip {
        background: rgba(15, 23, 42, 0.4) !important;
        border-color: rgba(255, 255, 255, 0.15) !important;
        color: rgba(255, 255, 255, 0.85) !important;
    }
}