/* =========================================
   1. GLOBAL RESET & TYPOGRAPHY (Apple Style)
   ========================================= */
:root {
    --apple-bg: #f5f5f7;
    --apple-card: #ffffff;
    --apple-text: #1d1d1f;
    --apple-text-muted: #86868b;
    --apple-blue: #0071e3;
    --apple-blue-hover: #0077ed;
    --apple-border: #d2d2d7;
    --shadow-subtle: 0 4px 24px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.04);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* Menggunakan font bawaan Apple (San Francisco) */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    text-decoration: none;
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--apple-bg);
    color: var(--apple-text);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

/* =========================================
   2. LOADING SCREEN
   ========================================= */
.loading-screen {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: var(--apple-bg);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease;
}

.loading-logo {
    width: 80px;
    margin-bottom: 20px;
    border-radius: 18px;
}

.loading-title {
    color: var(--apple-text);
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.loading-subtitle {
    color: var(--apple-text-muted);
    margin-top: 5px;
    font-size: 14px;
}

/* =========================================
   3. LOGIN CONTAINER & CARD
   ========================================= */
.container {
    width: 100%;
    max-width: 400px;
    opacity: 0; 
    transition: opacity 0.6s ease-in-out;
}

.login-card {
    background: var(--apple-card);
    padding: 40px 30px;
    border-radius: 18px;
    box-shadow: var(--shadow-subtle);
    text-align: center;
}

.card-header .form-logo {
    width: 60px;
    border-radius: 14px;
    margin-bottom: 15px;
}

.card-header h2 {
    color: var(--apple-text);
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}

.card-header p {
    color: var(--apple-text-muted);
    font-size: 14px;
    font-weight: 400;
    margin-bottom: 30px;
}

/* =========================================
   4. ALERT ERROR
   ========================================= */
.alert-error {
    background: #fdf2f2;
    color: #e30000;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 20px;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid #fceceb;
}

/* =========================================
   5. FORM INPUTS
   ========================================= */
.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--apple-text-muted);
    margin-bottom: 8px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper input {
    width: 100%;
    padding: 14px 40px; /* Ruang untuk ikon di kiri & kanan */
    font-size: 16px; /* 16px mencegah auto-zoom paksa di iOS */
    border: 1px solid var(--apple-border);
    border-radius: 12px;
    background-color: var(--apple-card);
    color: var(--apple-text);
    transition: all 0.2s ease;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

/* Efek Focus ala Apple (Ring Biru Tipis) */
.input-wrapper input:focus {
    border-color: var(--apple-blue);
    box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.2);
}

.input-icon {
    position: absolute;
    left: 14px;
    color: var(--apple-text-muted);
    font-size: 16px;
}

.toggle-password {
    position: absolute;
    right: 14px;
    cursor: pointer;
    color: var(--apple-text-muted);
    transition: color 0.2s;
    font-size: 16px;
}

.toggle-password:hover {
    color: var(--apple-text);
}

/* =========================================
   6. CHECKBOX REMEMBER ME
   ========================================= */
.remember-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    margin-bottom: 10px;
}

.remember-group label {
    margin: 0;
    font-size: 14px;
    color: var(--apple-text);
    cursor: pointer;
    font-weight: 400;
}

/* =========================================
   7. LINKS & BUTTONS
   ========================================= */
.form-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 25px;
}

.forgot-link {
    color: var(--apple-blue);
    font-size: 13px;
    font-weight: 500;
}

.forgot-link:hover {
    opacity: 0.8;
}

/* Tombol Submit (Pill-shape Apple Style) */
.btn-login {
    width: 100%;
    padding: 14px;
    background-color: var(--apple-blue);
    color: white;
    border: none;
    border-radius: 980px; /* Bentuk oval/kapsul sempurna */
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-login:hover {
    background-color: var(--apple-blue-hover);
}

.btn-login:active {
    transform: scale(0.96); /* Efek mengecil halus saat diklik */
}

/* =========================================
   8. RESPONSIVE (MOBILE)
   ========================================= */
@media (max-width: 480px) {
    .login-card {
        padding: 30px 20px;
    }
    
    .card-header h2 { font-size: 22px; }
}