html, body {
    max-width: 100vw;
    overflow-x: hidden; 
}

/* Reset Dasar & Variabel */
:root {
    --bg-color: #F8F9FB; /* Warna abu-abu kebiruan sangat terang */
    --text-main: #1E293B;
    --text-muted: #475569;
    --brand-blue: #2563EB;
    --border-color: #E2E8F0;
    --font-family: 'Inter', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body.auth-layout {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden; /* Mencegah scroll horizontal dari gambar absolute */
}

/* --- Elemen Dekoratif (Background) --- */
.bg-decor {
    position: absolute;
    z-index: 0;
    pointer-events: none; /* Agar tidak bisa diklik dan tidak mengganggu form */
    opacity: 0.5;
}

.bg-left {
    top: 50px;
    left: 40px;
    width: clamp(200px, 20vw, 300px); /* Ukuran dinamis */
}

.bg-right {
    bottom: 120px;
    right: 40px;
    width: clamp(250px, 25vw, 350px);
}

/* --- Area Konten Utama --- */
.auth-content {
    flex-grow: 1; /* Mengisi sisa ruang kosong antara atas dan footer */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 10; /* Berada di atas gambar background */
    padding: 20px;
    width: 100%;
}

/* --- Footer --- */
.auth-footer {
    position: relative;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 48px;
    border-top: 1px solid var(--border-color);
    font-size: 13px;
    color: var(--text-muted);
}

.footer-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* --- Footer --- */
.auth-footer {
    position: relative;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 48px;
    border-top: 1px solid var(--border-color);
    font-size: 13px;
    color: var(--text-muted);
}

.footer-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Mengatur ukuran gambar logo agar proporsional */
.footer-logo {
    height: 20px; /* Setengah dari tinggi aslinya (40px) agar rapi di footer */
    width: auto;  /* Lebar akan otomatis menyesuaikan menjadi sekitar 84px */
    object-fit: contain;
}

/* ... sisa css .footer-right tetap sama ... */

.footer-right {
    display: flex;
    gap: 24px;
}

.footer-right a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-right a:hover {
    color: var(--text-main);
    text-decoration: underline;
}

/* --- Media Queries untuk Responsivitas --- */
@media (max-width: 768px) {
    /* Sembunyikan atau kurangi opacity background di layar kecil agar tidak menumpuk form */
    .bg-decor {
        opacity: 0.15; 
    }
    
    .bg-left {
        top: 20px;
        left: -20px;
    }
    
    .bg-right {
        bottom: 150px;
        right: -20px;
    }

    /* Perbaikan 3: Kurangi padding card agar tidak meluber di layar HP kecil */
    .auth-card {
        padding: 24px; 
    }

    /* Tumpuk footer secara vertikal di perangkat mobile */
    .auth-footer {
        flex-direction: column;
        gap: 16px;
        padding: 24px 20px;
        text-align: center;
    }

    .footer-left {
        flex-direction: column;
        gap: 8px;
    }

    .footer-right {
        flex-wrap: wrap;
        justify-content: center;
        gap: 16px;
    }
}

/* --- Area Tengah (Bungkus Konten) --- */
.auth-center-wrapper {
    text-align: center;
    max-width: 440px;
    width: 100%;
    margin: 0 auto;
}

/* --- Header Form (Logo & Welcome) --- */
.auth-header {
    margin-bottom: 32px;
}

.auth-logo-top {
    width: 64px;
    height: 64px;
    object-fit: contain;
    margin-bottom: 16px;
}

.auth-icon {
    background-color: var(--brand-blue);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.2);
}

.auth-header h1 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 10px;
}

.auth-header p {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
    padding: 0 10px;
}

/* --- Card Putih --- */
.auth-card {
    background: #FFFFFF;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.03), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
    border: 1px solid var(--border-color);
    text-align: left;
}

/* --- Form Input --- */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-main);
    margin-bottom: 8px;
}

/* Trik memposisikan Icon di dalam input */
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    border-radius: 24px; /* Sudut melengkung ekstrim (pill-shape) */
    font-size: 14px;
    color: var(--text-main);
    outline: none;
    transition: all 0.2s ease;
    font-family: var(--font-family);
}

/* Ruang kosong agar teks tidak menabrak Icon */
.input-wrapper input[type="email"] { padding-left: 42px; }
.input-wrapper input[type="password"] { padding-right: 42px; }

.input-wrapper input:focus {
    border-color: var(--brand-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1); /* Efek glow biru */
}

/* Posisi Icon Kiri (Email) */
.icon-left {
    position: absolute;
    left: 14px;
    color: #94A3B8; /* Abu-abu terang */
    display: flex;
}

/* Posisi Icon Kanan (Password) */
.icon-right {
    position: absolute;
    right: 14px;
    color: #94A3B8;
    display: flex;
    cursor: pointer;
}
.icon-right:hover { color: var(--text-muted); }

/* --- Forgot Password Link --- */
.forgot-password {
    text-align: center;
    margin: 24px 0;
}

.forgot-password a {
    color: var(--brand-blue);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}
.forgot-password a:hover { text-decoration: underline; }

/* --- Button Submit --- */
.btn-submit {
    width: 100%;
    /* Warna abu-abu saat tombol didisable */
    background-color: #9CA3AF; 
    color: white;
    border: none;
    padding: 14px;
    border-radius: 24px;
    font-size: 15px;
    font-weight: 500;
    cursor: not-allowed; /* Kursor silang/dilarang */
    transition: all 0.3s ease;
    font-family: var(--font-family);
    opacity: 0.7;
}

/* Warna biru menyala saat tombol di-enable (valid) */
.btn-submit:not(:disabled) {
    background-color: var(--brand-blue); /* Menggunakan variabel biru Bizintel */
    cursor: pointer;
    opacity: 1;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2); /* Sedikit efek glow */
}

.btn-submit:not(:disabled):hover {
    background-color: #1D4ED8; /* Biru sedikit lebih gelap saat dihover */
}

/* --- Security Notice --- */
.security-notice {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 24px;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
}

.icon-shield {
    flex-shrink: 0;
    margin-top: 1px;
}

/* --- Admin Link (Bawah Card) --- */
.admin-link {
    margin-top: 32px;
    font-size: 13px;
    color: var(--text-muted);
}
.admin-link a {
    color: var(--brand-blue);
    text-decoration: none;
}
.admin-link a:hover { text-decoration: underline; }

.alert-error {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background-color: #FEE2E2; /* Merah pastel/muda */
    border: 1px solid #FCA5A5; /* Border merah lembut */
    color: #991B1B; /* Merah gelap untuk teks */
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 24px;
}

.alert-error .alert-icon {
    flex-shrink: 0;
    margin-top: 1px; /* Menyelaraskan icon dengan baris pertama teks */
}

.alert-error p {
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
}