/* Design System Implementation */
:root {
    /* Primary Colors - Theme Agnostic */
    --primary-blue: #4A90E2;
    --primary-purple: #B19CD9;
    --primary-coral: #FF6B7A;
    --primary-teal: #50E3C2;
    
    /* Border Radius - Theme Agnostic */
    --radius-small: 8px;
    --radius-medium: 12px;
    --radius-large: 16px;
    --radius-xlarge: 24px;
    
    /* Transitions - Theme Agnostic */
    --transition-standard: all 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light Mode Variables (Default) */
:root,
[data-theme="light"] {
    /* Gradients - Light Mode */
    --gradient-background-main: linear-gradient(135deg, #E8F4FD 0%, #F5E6FF 50%, #FFE8EC 100%);
    --gradient-card-overlay: linear-gradient(135deg, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0.7) 100%);
    --gradient-header-text: linear-gradient(135deg, #4A90E2 0%, #B19CD9 50%, #FF6B7A 100%);
    
    /* Neutrals - Light Mode */
    --text-primary: #2C2C2E;
    --text-secondary: #8E8E93;
    --text-tertiary: #C7C7CC;
    --bg-white: #FFFFFF;
    --bg-gray: #F2F2F7;
    --bg-primary: var(--gradient-background-main);
    --border-color: #E5E5EA;
    --shadow-color: rgba(0, 0, 0, 0.1);
    
    /* Semantic Colors - Light Mode */
    --color-success: #34C759;
    --color-warning: #FF9500;
    --color-error: #FF3B30;
    --color-info: #007AFF;
    
    /* Shadows - Light Mode */
    --shadow-light: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-medium: 0 2px 16px rgba(0, 0, 0, 0.08);
    --shadow-heavy: 0 8px 32px rgba(0, 0, 0, 0.12);
}

/* Dark Mode Variables */
[data-theme="dark"] {
    /* Dark mode gradients */
    --gradient-background-main: linear-gradient(135deg, #0a0e27 0%, #1a1235 50%, #251020 100%);
    --gradient-card-overlay: linear-gradient(135deg, rgba(26, 31, 58, 0.9) 0%, rgba(26, 31, 58, 0.7) 100%);
    --gradient-header-text: linear-gradient(135deg, #64B5F6 0%, #CE93D8 50%, #FF8A95 100%);
    
    /* Dark mode neutrals */
    --text-primary: #FFFFFF;
    --text-secondary: #B0BEC5;
    --text-tertiary: #78909C;
    --bg-white: #1a1f3a;
    --bg-gray: #252b48;
    --bg-primary: var(--gradient-background-main);
    --border-color: #2a3456;
    --shadow-color: rgba(0, 0, 0, 0.3);
    
    /* Dark mode semantic colors */
    --color-success: #4CAF50;
    --color-warning: #FFA726;
    --color-error: #EF5350;
    --color-info: #42A5F5;
    
    /* Dark mode shadows */
    --shadow-light: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-medium: 0 4px 16px rgba(0, 0, 0, 0.3);
    --shadow-heavy: 0 8px 32px rgba(0, 0, 0, 0.4);
    
    /* Accent color adjustments */
    --primary-blue: #64B5F6;
}

/* Support system preference as fallback */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        /* Dark mode gradients */
        --gradient-background-main: linear-gradient(135deg, #0a0e27 0%, #1a1235 50%, #251020 100%);
        --gradient-card-overlay: linear-gradient(135deg, rgba(26, 31, 58, 0.9) 0%, rgba(26, 31, 58, 0.7) 100%);
        --gradient-header-text: linear-gradient(135deg, #64B5F6 0%, #CE93D8 50%, #FF8A95 100%);
        
        /* Dark mode neutrals */
        --text-primary: #FFFFFF;
        --text-secondary: #B0BEC5;
        --text-tertiary: #78909C;
        --bg-white: #1a1f3a;
        --bg-gray: #252b48;
        --bg-primary: var(--gradient-background-main);
        --border-color: #2a3456;
        --shadow-color: rgba(0, 0, 0, 0.3);
        
        /* Dark mode semantic colors */
        --color-success: #4CAF50;
        --color-warning: #FFA726;
        --color-error: #EF5350;
        --color-info: #42A5F5;
        
        /* Dark mode shadows */
        --shadow-light: 0 2px 8px rgba(0, 0, 0, 0.2);
        --shadow-medium: 0 4px 16px rgba(0, 0, 0, 0.3);
        --shadow-heavy: 0 8px 32px rgba(0, 0, 0, 0.4);
        
        /* Accent color adjustments */
        --primary-blue: #64B5F6;
    }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* Theme transition for smooth switching */
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

/* Auth pages (login/register) center content */
body.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-container {
    background: var(--bg-white);
    padding: 40px;
    border-radius: var(--radius-large);
    box-shadow: var(--shadow-heavy);
    border: 1px solid var(--border-color);
    width: 100%;
    max-width: 400px;
    transition: var(--transition-standard);
}

.login-container:hover {
    box-shadow: var(--shadow-heavy);
}

.logo-container {
    text-align: center;
    margin-bottom: 30px;
}

.logo-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 15px auto;
    padding: 8px;
    background: var(--primary-blue);
    border-radius: var(--radius-medium);
    box-shadow: var(--shadow-medium);
}

h1 {
    color: var(--text-primary);
    text-align: center;
    margin: 0;
    font-size: 28px;
    background: var(--gradient-header-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

.subtitle {
    color: var(--text-secondary);
    text-align: center;
    font-size: 14px;
    margin-top: 5px;
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-medium);
    font-size: 16px;
    background: var(--bg-white);
    color: var(--text-primary);
    transition: var(--transition-standard);
}

input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.15);
}

button {
    width: 100%;
    background: var(--color-info);
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: var(--radius-medium);
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: var(--transition-standard);
}

button:hover {
    background: #0056CC;
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

/* Remember me checkbox styling */
.remember-me-label {
    display: flex !important;
    align-items: center;
    font-size: 14px !important;
    font-weight: normal !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    cursor: pointer;
}

.remember-me-label input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
    cursor: pointer;
}

@media (prefers-color-scheme: dark) {
    button:hover {
        background: #1976D2;
    }
    
    input:focus {
        box-shadow: 0 0 0 3px rgba(100, 181, 246, 0.3);
    }
}

.error {
    background: rgba(255, 59, 48, 0.1);
    border: 1px solid var(--color-error);
    color: var(--color-error);
    padding: 12px;
    border-radius: var(--radius-small);
    margin-bottom: 20px;
    text-align: center;
    font-size: 14px;
}

.environment-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 10px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: white;
    box-shadow: var(--shadow-light);
}

.environment-banner.development {
    background: var(--primary-blue);
}

.environment-banner.staging {
    background: var(--color-warning);
}

.environment-banner.production {
    background: var(--color-success);
}

/* Additional styles specific to auth pages */
.auth-link {
    color: var(--primary-blue);
    text-decoration: none;
    font-size: 14px;
    text-align: center;
    display: block;
    margin-top: 20px;
}

.auth-link:hover {
    text-decoration: underline;
}

/* Register specific styles */
.register-container {
    background: var(--bg-white);
    padding: 40px;
    border-radius: var(--radius-large);
    box-shadow: var(--shadow-heavy);
    border: 1px solid var(--border-color);
    width: 100%;
    max-width: 450px;
    transition: var(--transition-standard);
}

.register-container:hover {
    box-shadow: var(--shadow-heavy);
}

input[type="text"],
input[type="email"],
input[type="password"] {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-medium);
    font-size: 16px;
    background: var(--bg-white);
    color: var(--text-primary);
    transition: var(--transition-standard);
}

.flash {
    background: rgba(255, 59, 48, 0.1);
    border: 1px solid var(--color-error);
    color: var(--color-error);
    padding: 12px;
    border-radius: var(--radius-small);
    margin-bottom: 10px;
    text-align: center;
    font-size: 14px;
}

.login-link {
    text-align: center;
    margin-top: 20px;
    color: var(--text-secondary);
    font-size: 14px;
}

.login-link a {
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 500;
}

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

.info-text {
    text-align: center;
    color: var(--text-tertiary);
    font-size: 12px;
    margin-top: 20px;
    line-height: 1.6;
    padding: 0 20px;
}
