:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --background-dark: #0f0f23;
    --card-bg: #1a1b2f;
    --card-border: #2d2d4d;
    --text-primary: #ffffff;
    --text-secondary: #a0a0c0;
    --input-bg: #252547;
    --input-border: #3a3a5d;
    --error-color: #ef4444;
    --success-color: #10b981;
    --warning-color: #f59e0b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--background-dark);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    line-height: 1.6;
}

.auth-container {
    width: 100%;
    max-width: 440px; /* Increased for desktop */
}

.auth-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 48px 40px; /* Increased padding for desktop */
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}

.logo-section {
    text-align: center;
    margin-bottom: 32px;
}

.logo-icon {
    height: 56px; /* Slightly larger for desktop */
    width: auto;
    margin-bottom: 16px;
}

.logo-text {
    font-size: 28px; /* Larger for desktop */
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: block;
}

.auth-title {
    font-size: 32px; /* Larger for desktop */
    font-weight: 700;
    text-align: center;
    margin-bottom: 12px;
}

.auth-subtitle {
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 36px; /* More space for desktop */
    font-size: 16px; /* Slightly larger */
}

.form-group {
    margin-bottom: 24px; /* More space between form groups */
    position: relative;
}

.form-input {
    width: 100%;
    padding: 16px 18px; /* Slightly larger padding */
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 10px; /* Slightly more rounded */
    color: var(--text-primary);
    font-size: 15px; /* Slightly larger font */
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.form-input::placeholder {
    color: var(--text-secondary);
}

.btn {
    width: 100%;
    padding: 16px 18px; /* Slightly larger */
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
}

.btn-google {
    background: white;
    color: #333;
    border: 1px solid #ddd;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-google:hover {
    background: #f8f9fa;
    border-color: #ccc;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.divider {
    display: flex;
    align-items: center;
    margin: 28px 0; /* More space */
    color: var(--text-secondary);
    font-size: 13px;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--input-border);
}

.divider::before {
    margin-right: 20px;
}

.divider::after {
    margin-left: 20px;
}

.auth-links {
    text-align: center;
    margin-top: 28px;
}

.auth-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.auth-link:hover {
    text-decoration: underline;
    color: var(--primary-hover);
}

.messages {
    margin-bottom: 24px;
}

.alert {
    padding: 14px 18px;
    border-radius: 10px;
    font-size: 14px;
    margin-bottom: 18px;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--error-color);
    color: var(--error-color);
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--success-color);
    color: var(--success-color);
}

.password-reset-info {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid var(--primary-color);
    border-radius: 10px;
    padding: 18px;
    margin-bottom: 24px;
    font-size: 14px;
    color: var(--text-secondary);
}

/* Form row styling */
.form-row {
    display: flex;
    gap: 16px; /* More space between columns */
    margin-bottom: 24px;
}

.form-group.half {
    flex: 1;
    margin-bottom: 0;
}

/* Password toggle button */
.password-toggle {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: color 0.3s ease;
}

.password-toggle:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
}

/* Password strength indicator */
.password-strength {
    margin-top: 8px;
    height: 4px;
    border-radius: 2px;
    background: var(--input-border);
    overflow: hidden;
    position: relative;
}

.strength-bar {
    height: 100%;
    width: 0%;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.strength-text {
    font-size: 12px;
    margin-top: 4px;
    color: var(--text-secondary);
}

.strength-weak { background: var(--error-color); width: 25%; }
.strength-fair { background: var(--warning-color); width: 50%; }
.strength-good { background: var(--warning-color); width: 75%; }
.strength-strong { background: var(--success-color); width: 100%; }

.text-weak { color: var(--error-color); }
.text-fair { color: var(--warning-color); }
.text-good { color: var(--warning-color); }
.text-strong { color: var(--success-color); }

/* Legal links */
.legal-links {
    text-align: center;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--input-border);
}

.legal-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 12px;
    margin: 0 12px;
    transition: color 0.3s ease;
}

.legal-links a:hover {
    color: var(--text-primary);
    text-decoration: underline;
}

/* Loading state */
.btn.loading {
    opacity: 0.7;
    pointer-events: none;
}

.btn.loading::after {
    content: '';
    width: 18px;
    height: 18px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==================== */
/* MOBILE RESPONSIVE */
/* ==================== */
@media (max-width: 768px) {
    body {
        padding: 16px;
        align-items: flex-start; /* Start from top on mobile */
        padding-top: 40px; /* Space from top */
    }

    .auth-container {
        max-width: 100%;
    }

    .auth-card {
        background: transparent; /* Remove card background on mobile */
        border: none;
        border-radius: 0;
        padding: 0;
        box-shadow: none;
        backdrop-filter: none;
    }

    .logo-section {
        margin-bottom: 40px; /* More space on mobile */
    }

    .logo-icon {
        height: 64px; /* Larger on mobile */
        margin-bottom: 16px;
    }

    .logo-text {
        font-size: 24px;
    }

    .auth-title {
        font-size: 28px;
        margin-bottom: 8px;
    }

    .auth-subtitle {
        font-size: 14px;
        margin-bottom: 40px; /* More space on mobile */
    }

    .form-group {
        margin-bottom: 20px;
    }

    .form-input {
        padding: 16px;
        font-size: 16px; /* Better for mobile touch */
    }

    .btn {
        padding: 16px;
        font-size: 16px; /* Better for mobile touch */
    }

    .divider {
        margin: 32px 0; /* More space on mobile */
    }

    .auth-links {
        margin-top: 32px;
    }

    /* Form row becomes vertical on mobile */
    .form-row {
        flex-direction: column;
        gap: 20px;
    }

    /* Legal links stack on mobile */
    .legal-links {
        margin-top: 40px;
    }

    .legal-links a {
        display: block;
        margin: 8px 0;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    body {
        padding: 12px;
        padding-top: 30px;
    }

    .logo-icon {
        height: 56px;
    }

    .logo-text {
        font-size: 22px;
    }

    .auth-title {
        font-size: 26px;
    }
}

/* ==================== */
/* DESKTOP ENHANCEMENTS */
/* ==================== */
@media (min-width: 1200px) {
    .auth-container {
        max-width: 480px; /* Even wider on large desktop */
    }

    .auth-card {
        padding: 56px 48px; /* More padding on large desktop */
    }

    .logo-icon {
        height: 64px;
    }

    .logo-text {
        font-size: 32px;
    }

    .auth-title {
        font-size: 36px;
    }

    .auth-subtitle {
        font-size: 17px;
    }
}

/* Field error styling */
.field-error {
    color: var(--error-color);
    font-size: 12px;
    margin-top: 6px;
    display: block;
}