@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700;800&display=swap');

:root {
    /* Colors */
    --primary: #1e40af;
    --primary-hover: #1e3a8a;
    --secondary: #64748b;
    --background: #f8fafc;
    --surface: #ffffff;
    --surface-2: #f1f5f9;
    --border: #e2e8f0;
    --text-primary: #1e293b;
    --text-secondary: #64748b; /* Fixed typo from #647569 */
    --success: #10b981;
    --error: #ef4444;
    
    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    
    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 16px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    
    /* Transitions */
    --transition: all 0.2s ease;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background);
    color: var(--text-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: var(--spacing-md);
    /* Background pattern */
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(30, 64, 175, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(30, 64, 175, 0.05) 0%, transparent 50%);
}

.login-container {
    display: flex;
    width: 100%;
    max-width: 900px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    min-height: 500px;
}

/* Left side - Branding */
.branding {
    flex: 1;
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: white;
    padding: var(--spacing-xl);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.branding::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: pulse 8s infinite;
}

.logo {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: var(--spacing-md);
    position: relative;
    z-index: 1;
}

.tagline {
    font-size: 1.1rem;
    font-weight: 300;
    margin-bottom: var(--spacing-xl);
    position: relative;
    z-index: 1;
    opacity: 0.9;
}

.features {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 300px;
}

.feature-item {
    display: flex;
    align-items: center;
    margin-bottom: var(--spacing-md);
}

.feature-icon {
    width: 20px;
    height: 20px;
    margin-right: var(--spacing-md);
    opacity: 0.9;
    flex-shrink: 0;
}

.feature-text {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Right side - Login Form */
.login-form-container {
    flex: 1;
    padding: var(--spacing-xl);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
}

.subtitle {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-lg);
}

.form-group {
    margin-bottom: var(--spacing-md);
}

label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: var(--spacing-xs);
}

input {
    width: 100%;
    padding: 14px var(--spacing-md);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
    transition: var(--transition);
}

input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

/* Password Input Container */
.password-input-container {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-container input {
    padding-right: 50px; /* Space for icon */
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    color: var(--text-secondary);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    height: 24px;
    width: 24px;
}

.toggle-password:hover {
    color: var(--primary);
}

.toggle-password svg {
    width: 20px;
    height: 20px;
}

.btn {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    margin-top: var(--spacing-md);
}

.btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.footer-text {
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: var(--spacing-xl);
}

.footer-text a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.footer-text a:hover {
    text-decoration: underline;
}

/* Animation */
@keyframes pulse {
    0%, 100% { opacity: 0.1; transform: scale(1); }
    50% { opacity: 0.2; transform: scale(1.05); }
}

/* ==========================================
   RESPONSIVE - MOBILE FIRST
   ========================================== */

/* Tablets and below */
@media (max-width: 768px) {
    .login-container {
        flex-direction: column;
        min-height: auto;
        margin: auto;
    }

    /* Make branding a small header on mobile */
    .branding {
        padding: var(--spacing-lg);
        min-height: auto; /* Auto height based on content */
        width: 100%;
        border-radius: 0; /* Remove inner radius if needed */
    }
    
    /* Hide features on mobile to save space */
    .features {
        display: none;
    }

    .logo {
        font-size: 1.75rem;
        margin-bottom: var(--spacing-xs);
    }

    .tagline {
        font-size: 0.95rem;
        margin-bottom: 0;
        opacity: 0.9;
    }

    .login-form-container {
        padding: var(--spacing-lg);
        width: 100%;
        flex: 1;
    }

    h2 {
        font-size: 1.5rem;
    }
}

/* Extra small devices (Phones) */
@media (max-width: 480px) {
    body {
        padding: 0;
        background: var(--surface); /* Solid background for immersion */
        align-items: flex-start; /* Start from top */
    }
    
    .login-container {
        border-radius: 0;
        box-shadow: none;
        min-height: 100vh; /* Full height */
    }

    .branding {
        padding: var(--spacing-md);
    }

    .login-form-container {
        padding: var(--spacing-lg) var(--spacing-md);
        justify-content: flex-start; /* Align to top */
        padding-top: var(--spacing-xl);
    }

    input {
        font-size: 16px; /* Prevents iOS zoom on focus */
    }
}