/* Authentication Page Styles (Login/Register) */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Ensure white background for login page - override base.css */
body {
    font-family: 'Inter', sans-serif;
    background: #ffffff !important; /* Pure white background - must override base.css */
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.login-container {
    background: white;
    border-radius: 20px;
    padding: 3rem;
    width: 100%;
    max-width: 400px;
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 2px 4px rgba(113, 127, 231, 0.15),  /* Small, tight shadow */
        0 8px 16px rgba(113, 127, 231, 0.15); /* Larger, fading shadow */
    
}



.logo {
    text-align: center;
    margin-bottom: 2rem;
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.logo p {
    color: #666;
    font-size: 1rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #333;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 1rem;
    padding-right: 3rem;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease; /* Changed from border-color only */
    outline: none;
    background: #fff;
}

.form-group input:hover {
    border-color: #d1d5db; /* Subtle hover effect */
}

.form-group input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background: #fff;
}

/* Better placeholder styling */
.form-group input::placeholder {
    color: #9ca3af;
    opacity: 1;
}

.password-input-wrapper {
    position: relative;
    width: 100%;
}

.password-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
    z-index: 1;
}

.password-toggle:hover {
    color: #667eea;
}

.password-toggle:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
    border-radius: 4px;
}

.password-toggle i {
    font-size: 1.1rem;
}


.form-group input.error {
    border-color: #e74c3c;
}

.error-message {
    color: #e74c3c;
    font-size: 0.9rem;
    margin-top: 0.5rem;
    display: none;
}

.error-message-general {
    background: #f8d7da;
    color: #721c24;
    padding: 0.75rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    text-align: center;
}

.login-btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 1rem;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.login-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.divider {
    text-align: center;
    margin: 1.5rem 0;
    position: relative;
    color: #666;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e1e5e9;
}

.divider span {
    background: white;
    padding: 0 1rem;
    position: relative;
}

.register-btn {
    width: 100%;
    padding: 1rem;
    background: transparent;
    color: #667eea;
    border: 2px solid #667eea;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.register-btn:hover {
    background: #667eea;
    color: white;
}

.login-description {
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
    margin-bottom: var(--spacing-lg);
    line-height: 1.5;
}

.google-btn {
    width: 100%;
    padding: var(--spacing-md) var(--spacing-lg);
    background: white;
    color: #333;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: var(--font-size-base);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    margin: 0 auto;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.google-btn:hover {
    background: #f8f9fa;
    border-color: #d1d5db;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

.google-btn:active {
    transform: translateY(0);
}

.google-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.loading {
    display: none;
    text-align: center;
    margin-top: 1rem;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.success-message {
    background: #d4edda;
    color: #155724;
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    display: none;
}

.error-message {
    background: #fee2e2;
    color: #991b1b;
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    display: none;
    border: 1px solid #fca5a5;
}

.demo-credentials {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 1rem;
    margin-top: 1rem;
    font-size: 0.9rem;
}

.demo-credentials h4 {
    color: #495057;
    margin-bottom: 0.5rem;
}

.demo-credentials p {
    color: #6c757d;
    margin-bottom: 0.25rem;
}

/* Login Options Container */
.login-options {
    width: 100%;
}

/* Login Section Wrapper */
.login-section {
    width: 100%;
    margin-bottom: var(--spacing-xl);
}

.login-section-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.login-section-title i {
    color: var(--color-primary-start);
}

/* Divider Between Login Methods */
.login-divider {
    position: relative;
    text-align: center;
    margin: var(--spacing-xxl) 0;
    color: var(--color-text-secondary);
}

.login-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e1e5e9;
}

.login-divider span {
    background: white;
    padding: 0 var(--spacing-md);
    position: relative;
    font-weight: 500;
    font-size: var(--font-size-sm);
}

/* Email Login Section */
.email-login-section {
    /* Already styled via .login-section */
}

/* Google Login Section */
.google-login-section {
    padding: var(--spacing-lg) 0;
}

.google-login-content {
    text-align: center;
}


/* Login Form Container */
.login-form-container {
    width: 100%;
}

.submit-btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.register-link {
    text-align: center;
    margin-top: 1.5rem;
    color: #666;
    font-size: 0.9rem;
}

.register-link a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.register-link a:hover {
    text-decoration: underline;
}

@media (max-width: 480px) {
    .login-container {
        padding: 1.5rem 1.25rem; /* Reduced from 2rem 1.5rem */
        margin: 0.5rem;
        border-radius: 16px; /* Slightly smaller radius on mobile */
        /* Slightly lighter shadow on mobile for performance */
        box-shadow: 
            0 1px 2px rgba(0, 0, 0, 0.02),
            0 2px 4px rgba(0, 0, 0, 0.03),
            0 4px 8px rgba(0, 0, 0, 0.04),
            0 8px 16px rgba(0, 0, 0, 0.05);
    }
    
    .logo {
        margin-bottom: 1.5rem; /* Reduced from 2rem */
    }
    
    .logo h1 {
        font-size: 1.75rem; /* Reduced from 2rem */
        margin-bottom: 0.25rem; /* Reduced from default */
    }
    
    .logo p {
        font-size: 0.9rem; /* Slightly smaller */
    }
    
    .login-section {
        margin-bottom: 1.25rem; /* Reduced from var(--spacing-xl) */
    }
    
    .login-section-title {
        font-size: var(--font-size-base);
        margin-bottom: 1rem; /* Reduced from var(--spacing-lg) */
    }
    
    .login-divider {
        margin: 1.25rem 0; /* Reduced from var(--spacing-xl) */
    }
    
    .form-group {
        margin-bottom: 1.25rem; /* Reduced from 1.5rem */
    }
    
    .form-group input {
        padding: 0.875rem; /* Reduced from 1rem */
        padding-right: 2.75rem; /* Reduced from 3rem to match */
        font-size: 0.95rem; /* Slightly smaller */
    }
    
    .google-btn {
        padding: 0.875rem var(--spacing-md);
        font-size: 0.95rem;
    }
    
    .login-description {
        margin-bottom: 1rem; /* Reduced from var(--spacing-lg) */
        font-size: 0.85rem; /* Slightly smaller */
    }
    
    .submit-btn {
        padding: 0.875rem; /* Reduced from 1rem */
        font-size: 0.95rem; /* Slightly smaller */
        margin-top: 0.75rem; /* Reduced from 1rem */
    }
    
    .register-link {
        margin-top: 1rem; /* Reduced from 1.5rem */
        font-size: 0.85rem; /* Slightly smaller */
    }
}

/* Password Setup Card */
.password-setup-card {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    background: var(--color-white);
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 2rem;
}

.password-setup-card-content {
    width: 100%;
}

.password-setup-header {
    text-align: center;
    margin-bottom: 2rem;
}

.password-setup-header i {
    font-size: 3rem;
    color: var(--color-primary-start);
    margin-bottom: 1rem;
}

.password-setup-header h2 {
    font-size: 1.5rem;
    color: var(--color-text-primary);
    margin-bottom: 0.5rem;
}

.password-setup-header p {
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

#passwordSetupForm .form-group {
    margin-bottom: 1.5rem;
}

#passwordSetupForm .error-message {
    background: #fee2e2;
    color: #991b1b;
    padding: 0.75rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

@media (min-width: 481px) and (max-width: 768px) {
    .login-container {
        max-width: 450px;
        padding: 2.5rem;
    }
    
    .login-options {
        display: flex;
        flex-direction: column;
        gap: var(--spacing-xl);
    }
}

/* Dark Theme Styles */
[data-theme="dark"] body {
    background: var(--color-background-dark) !important;
}

[data-theme="dark"] .login-container {
    background: #2a2a2a;
    color: var(--color-text-primary);
}

[data-theme="dark"] .form-group label {
    color: var(--color-text-primary);
}

[data-theme="dark"] .form-group input {
    background: #1a1a1a;
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--color-text-primary);
}

[data-theme="dark"] .form-group input:focus {
    border-color: var(--color-primary-start);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

[data-theme="dark"] .error-message {
    background: rgba(231, 76, 60, 0.2);
    color: #ff6b6b;
}

[data-theme="dark"] .login-btn,
[data-theme="dark"] .register-btn {
    color: var(--color-white);
}

[data-theme="dark"] .google-btn {
    background: var(--color-white);
    color: var(--color-text-primary);
}

[data-theme="dark"] .google-btn:hover {
    background: rgba(255, 255, 255, 0.9);
}

[data-theme="dark"] .divider {
    color: var(--color-text-secondary);
}

[data-theme="dark"] .divider::before,
[data-theme="dark"] .divider::after {
    border-color: rgba(255, 255, 255, 0.2);
}

