/* css/login.css - Emerald Harmony Glassmorphism Login */
/* TIDAK IMPORT global.css karena butuh override khusus */

/* =========== OVERRIDE UNTUK LOGIN PAGE =========== */
body.login-page {
    padding: 0 !important;
    min-height: 100vh;
    background: none !important;
    margin: 0;
}

.login-page .emerald-gradient-bg {
    min-height: 100vh;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* =========== EMERALD HARMONY VARIABLES =========== */
:root {
    /* Emerald Harmony Colors */
    --primary: #206E35;           /* Emerald Green */
    --primary-dark: #072621;      /* Deep Forest Green */
    --primary-light: #e8f5e9;     /* Light Emerald */
    --primary-extra-light: #f7fdf8; /* Very light green */
    
    /* Gold Accent Colors */
    --accent: #F0C56F;            /* Soft Gold */
    --accent-dark: #d4a657;       /* Dark Gold */
    --accent-light: #f9e4b7;      /* Light Gold */
    --accent-extra-light: #fff9e6;
    
    /* Status Colors (Emerald Harmony Variants) */
    --success: #2e7d32;           /* Emerald Success */
    --success-light: #d4edda;
    --warning: #F0C56F;           /* Gold Warning */
    --warning-light: #fff3cd;
    --danger: #dc3545;            /* Red Danger */
    --danger-light: #f8d7da;
    --info: #2196f3;              /* Blue Info */
    --info-light: #d1ecf1;
    
    /* Extended Emerald Palette */
    --emerald-50: #f0f9f2;
    --emerald-100: #d4e8d8;
    --emerald-200: #b8d7be;
    --emerald-300: #8bc096;
    --emerald-400: #5da96e;
    --emerald-500: #206E35;       /* Primary */
    --emerald-600: #1b5e2c;
    --emerald-700: #164d23;
    --emerald-800: #072621;       /* Primary Dark */
    --emerald-900: #051c18;
    
    /* Gold Palette */
    --gold-50: #fffdf6;
    --gold-100: #fef9e7;
    --gold-200: #f9e4b7;
    --gold-300: #F0C56F;          /* Accent */
    --gold-400: #e6b95c;
    --gold-500: #d4a657;          /* Accent Dark */
    --gold-600: #c28b3e;
    
    /* Grayscale - Adjusted for Emerald Theme */
    --dark: #0a291f;              /* Dark greenish black */
    --gray-800: #1e3a2f;
    --gray-700: #2d4a3e;
    --gray-600: #4a6659;
    --gray-500: #6b8a7d;
    --gray-400: #9cb5a9;
    --gray-300: #c5d6cf;
    --gray-200: #e3ede8;
    --gray-100: #f0f9f4;
    --light: #ffffff;
    
    /* Layout */
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    
    /* Login Specific */
    --glass-blur: 20px;
}

/* =========== BASE RESET =========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 16px;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* =========== BACKGROUND & CONTAINER =========== */
.emerald-gradient-bg {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

.emerald-gradient-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(240, 197, 111, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(32, 110, 53, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(7, 38, 33, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.glass-container {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border-radius: var(--radius-xl);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 
        0 8px 32px rgba(7, 38, 33, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    padding: 32px 24px;
    width: 100%;
    max-width: 400px;
    text-align: center;
    animation: fadeIn 0.5s ease-out;
    color: white;
    position: relative;
    overflow: hidden;
    margin: 0;
}

.glass-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent) 0%, var(--gold-500) 100%);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    z-index: 1;
}

.glass-container::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 150%;
    height: 150%;
    background: radial-gradient(circle at center, rgba(240, 197, 111, 0.1) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    z-index: 0;
    pointer-events: none;
}

@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(15px); 
        filter: blur(4px);
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
        filter: blur(0);
    }
}

/* =========== HEADER & LOGO =========== */
.login-header {
    padding: 0 0 32px;
    position: relative;
    z-index: 2;
}

.logo-container {
    text-align: center;
}

.logo-icon {
    width: 70px;
    height: 70px;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(240, 197, 111, 0.1) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    color: var(--accent);
    font-size: 1.8rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 12px rgba(7, 38, 33, 0.15);
}

.app-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: white;
    margin-bottom: 4px;
    text-shadow: 0 2px 4px rgba(7, 38, 33, 0.3);
    background: linear-gradient(135deg, white 0%, var(--accent-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.app-subtitle {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 400;
}

/* =========== FORM CONTAINER =========== */
.login-form-container {
    position: relative;
    z-index: 2;
}

.form-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.form-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: white;
    margin-bottom: 6px;
    text-shadow: 0 1px 2px rgba(7, 38, 33, 0.3);
}

.form-subtitle {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 400;
}

/* =========== FORM ELEMENTS =========== */
.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-label i {
    color: var(--accent);
    font-size: 0.85rem;
    width: 16px;
    text-align: center;
}

.form-control-wrapper {
    position: relative;
}

.glass-input {
    width: 100%;
    padding: 15px 16px 15px 44px;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius);
    font-size: 0.9rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: white;
    font-family: 'Poppins', sans-serif;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.glass-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(240, 197, 111, 0.8);
    font-size: 0.95rem;
    pointer-events: none;
    z-index: 1;
}

.toggle-password {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    padding: 4px;
    font-size: 0.95rem;
    z-index: 1;
    transition: color 0.2s ease;
}

.toggle-password:hover {
    color: var(--accent);
}

.glass-input:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 
        0 0 0 3px rgba(240, 197, 111, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

/* Checkbox Styling */
.checkbox {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.05);
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.checkbox:checked {
    background: var(--accent);
    border-color: var(--accent);
}

.checkbox:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--primary-dark);
    font-size: 0.7rem;
    font-weight: bold;
}

/* =========== BUTTONS =========== */
.glass-btn {
    background: linear-gradient(135deg, rgba(32, 110, 53, 0.9) 0%, rgba(7, 38, 33, 0.9) 100%);
    color: white;
    border: none;
    border-radius: var(--radius);
    padding: 16px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 
        0 4px 15px rgba(7, 38, 33, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.glass-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: 0.5s;
}

.glass-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    transform: translateY(-2px);
    box-shadow: 
        0 6px 20px rgba(7, 38, 33, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.glass-btn:hover::before {
    left: 100%;
}

.glass-btn:active:not(:disabled) {
    transform: translateY(0);
}

.glass-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 2px solid rgba(240, 197, 111, 0.4);
    border-radius: var(--radius);
    padding: 16px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: rgba(240, 197, 111, 0.2);
    border-color: var(--accent);
    transform: translateY(-1px);
}

/* =========== DIVIDER =========== */
.glass-divider {
    position: relative;
    margin: 24px 0;
    text-align: center;
}

.glass-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
    z-index: 1;
}

.glass-divider span {
    position: relative;
    padding: 0 16px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--radius-sm);
    z-index: 2;
}

/* =========== FOOTER =========== */
.login-footer {
    margin-top: 20px;
    text-align: center;
    position: relative;
    z-index: 2;
}

.footer-text {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.footer-text i {
    color: var(--accent);
}

/* =========== MODALS =========== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(7, 38, 33, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(8px);
    padding: 16px;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: var(--light);
    border-radius: var(--radius-lg);
    padding: 28px;
    width: 100%;
    max-width: 320px;
    text-align: center;
    box-shadow: 0 20px 25px -5px rgba(7, 38, 33, 0.3);
    border: 1px solid var(--gray-300);
    animation: scaleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 1.4rem;
}

.modal-icon.loading {
    animation: spin 1s linear infinite;
    border: 3px solid var(--primary-light);
    border-top-color: var(--primary);
}

.modal-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 8px;
}

.modal-text {
    font-size: 0.85rem;
    color: var(--gray-600);
    line-height: 1.4;
}

/* =========== ANIMATIONS =========== */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.error-shake {
    animation: errorShake 0.5s ease-in-out;
}

/* =========== RESPONSIVE =========== */
@media (max-width: 480px) {
    :root {
        --glass-blur: 15px;
    }
    
    .emerald-gradient-bg {
        padding: 16px;
    }
    
    .glass-container {
        padding: 24px 20px;
        max-width: 100%;
        border-radius: var(--radius-lg);
    }
    
    .logo-icon {
        width: 60px;
        height: 60px;
        font-size: 1.6rem;
    }
    
    .app-title {
        font-size: 1.4rem;
    }
    
    .form-card {
        padding: 24px 20px;
    }
    
    .glass-input {
        padding: 14px 16px 14px 44px;
        font-size: 0.85rem;
    }
    
    .glass-btn,
    .btn-secondary {
        padding: 14px 16px;
        font-size: 0.9rem;
    }
}

@media (max-width: 320px) {
    .glass-container {
        padding: 20px 16px;
    }
    
    .form-card {
        padding: 20px 16px;
    }
    
    .logo-icon {
        width: 56px;
        height: 56px;
        font-size: 1.5rem;
    }
    
    .app-title {
        font-size: 1.3rem;
    }
}

@media (min-width: 768px) {
    .glass-container {
        max-width: 420px;
        padding: 40px 32px;
    }
    
    .logo-icon {
        width: 80px;
        height: 80px;
        font-size: 2rem;
    }
    
    .app-title {
        font-size: 1.8rem;
    }
}

/* Utility classes */
.hidden {
    display: none !important;
}

.fa-spinner {
    animation: spin 1s linear infinite;
}

/* Message Alert */
.message-alert {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    padding: 12px 20px;
    border-radius: var(--radius);
    font-weight: 500;
    z-index: 9999;
    opacity: 0;
    transition: all 0.3s ease;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    max-width: 90%;
    text-align: center;
}

.message-alert.fade-in {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.message-alert.success {
    background: rgba(46, 125, 50, 0.9);
    color: white;
    border-left: 4px solid var(--accent);
}

.message-alert.error {
    background: rgba(220, 53, 69, 0.9);
    color: white;
    border-left: 4px solid #ff6b6b;
}

.message-alert.info {
    background: rgba(33, 150, 243, 0.9);
    color: white;
    border-left: 4px solid #4fc3f7;
}