/* ============================================== */
/* ========== 1. Variabel Tema & Reset ========== */
/* ============================================== */

:root {
    --primary-color: #004d40;
    --primary-hover: #00382e;
    --accent-color: #ffab00; /* Warna Emas/Kuning untuk aksen Dark Mode */
    --text-dark: #1f2937;
    --text-medium: #6b7280;
    --text-light: #9ca3af;
    --bg-input: #f3f4f6;
    --card-bg: #ffffff;
    --shadow-soft: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --error-color: #ef4444;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #f0fdfa 0%, #e0f2f1 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    color: var(--text-dark);
}

/* ============================================== */
/* ========== 2. Container & Card =============== */
/* ============================================== */

.login-container {
    width: 100%;
    max-width: 420px;
}

.login-card {
    background: var(--card-bg);
    border-radius: 20px;
    box-shadow: var(--shadow-soft);
    padding: 40px;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

/* Garis Aksen di atas Card */
.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: var(--primary-color);
}

/* ============================================== */
/* ========== 3. Header & Logo ================== */
/* ============================================== */

.login-header {
    text-align: center;
    margin-bottom: 35px;
}

.login-header img {
    width: 120px;
    transition: transform 0.3s ease;
}

.login-header img:hover {
    transform: scale(1.05);
}

/* ============================================== */
/* ========== 4. Form & Inputs ================== */
/* ============================================== */

.form-group {
    margin-bottom: 24px;
    position: relative;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
    margin-left: 2px;
}

/* Style Input */
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="text"] {
    width: 100%;
    padding: 14px 45px; /* Space untuk ikon */
    border: 1px solid transparent;
    border-radius: 12px;
    font-size: 15px;
    background-color: var(--bg-input);
    color: var(--text-dark);
    transition: all 0.3s ease;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.03);
}

/* Efek Focus */
.form-group input:focus {
    outline: none;
    background-color: #fff;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(0, 77, 64, 0.1);
}

/* ============================================== */
/* ========== 5. Icons Positioning ============== */
/* ============================================== */

.form-group .icon {
    position: absolute;
    left: 16px;
    top: 42px;
    color: var(--text-light);
    font-size: 16px;
    pointer-events: none;
    transition: color 0.3s;
}

.form-group .password-toggle {
    position: absolute;
    right: 16px;
    top: 42px;
    color: var(--text-light);
    font-size: 16px;
    cursor: pointer;
    transition: color 0.3s;
    padding: 5px;
}

/* Warna ikon berubah saat input fokus */
.form-group input:focus ~ .icon,
.form-group input:focus ~ .password-toggle {
    color: var(--primary-color);
}

/* ============================================== */
/* ========== 6. Options (Remember & Forgot) ==== */
/* ============================================== */

.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between; /* Kiri Kanan Mentok */
    margin-bottom: 25px;
}

.remember-me {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: var(--text-medium);
    cursor: pointer;
    user-select: none;
}

.remember-me input[type="checkbox"] {
    accent-color: var(--primary-color);
    width: 16px;
    height: 16px;
    margin-right: 8px;
    cursor: pointer;
}

/* Link Lupa Password (BARU) */
.forgot-password {
    font-size: 14px;
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.forgot-password:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* ============================================== */
/* ========== 7. Buttons ======================== */
/* ============================================== */

.btn-main {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 77, 64, 0.3);
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.btn-main:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 77, 64, 0.4);
}

.btn-main:active {
    transform: translateY(0);
}

/* ============================================== */
/* ========== 8. Footer Links =================== */
/* ============================================== */

.register-link {
    text-align: center;
    margin-top: 25px;
    font-size: 14px;
    color: var(--text-medium);
}

.register-link a {
    color: var(--primary-color);
    font-weight: 700;
    text-decoration: none;
    transition: color 0.2s;
}

.register-link a:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

/* ============================================== */
/* ========== 9. Error Messages ================= */
/* ============================================== */

.is-invalid {
    border-color: var(--error-color) !important;
    background-color: #fef2f2 !important;
}

.is-invalid ~ .icon {
    color: var(--error-color) !important;
}

.invalid-feedback {
    display: flex;
    align-items: center;
    font-size: 0.8em;
    color: var(--error-color);
    margin-top: 6px;
    font-weight: 500;
}

.invalid-feedback::before {
    content: '\f06a';
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    margin-right: 5px;
}

/* ============================================== */
/* ========== 10. Dark Mode Support ============= */
/* ============================================== */

@media (prefers-color-scheme: dark) {
    :root {
        --text-dark: #f3f4f6;
        --text-medium: #9ca3af;
        --text-light: #6b7280;
        --bg-input: #2d2d2d;
        --card-bg: #1f1f1f;
        --shadow-soft: 0 10px 30px rgba(0,0,0,0.5);
    }
    
    body {
        background: #121212;
    }
    
    .login-card {
        border: 1px solid #333;
    }
    
    .form-group input {
        color: white;
    }

    .form-group input:focus {
        background-color: #2d2d2d;
        border-color: var(--accent-color);
        box-shadow: 0 0 0 4px rgba(255, 171, 0, 0.1);
    }
    
    /* Tombol Utama jadi Kuning/Emas di Dark Mode */
    .btn-main {
        background: var(--accent-color);
        color: #121212;
        box-shadow: 0 4px 12px rgba(255, 171, 0, 0.2);
    }
    
    .btn-main:hover {
        background: #ffbf00;
    }
    
    /* Link Register & Forgot Password menyesuaikan */
    .register-link a, 
    .forgot-password:hover {
        color: var(--accent-color);
    }

    /* Warna default link forgot password di dark mode agar terbaca */
    .forgot-password {
        color: #d1d5db; /* Abu terang */
    }
}

/* ============================================== */
/* ========== 12. Halaman Reset Password ======== */
/* ============================================== */

/* Style khusus input Readonly (Email) */
.readonly-input {
    background-color: #e5e7eb !important; /* Abu-abu terang */
    color: #6b7280 !important; /* Teks abu tua */
    cursor: not-allowed; /* Kursor tanda larang */
    border-color: transparent;
}

.readonly-input:focus {
    box-shadow: none !important;
    border-color: transparent !important;
}

/* Dark Mode untuk Readonly */
@media (prefers-color-scheme: dark) {
    .readonly-input {
        background-color: #374151 !important;
        color: #9ca3af !important;
    }
}