/**
 * LOVELL AI - Application Gateway Styles
 * Integrated with Serene Ocean Oasis Theme
 * Color Palette: Pale Sky, Cool Steel, Air Force Blue, Sea Green, Dark Spruce
 */

/* ============================================
   GOOGLE FONTS IMPORT
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Space+Mono:wght@400;700&display=swap');

/* ============================================
   CSS CUSTOM PROPERTIES (VARIABLES)
   ============================================ */
:root {
    /* Primary Color Palette */
    --pale-sky: #bfd7ea;
    --cool-steel: #91aec1;
    --air-force-blue: #508ca4;
    --sea-green: #0a8754;
    --dark-spruce: #004f2d;
    --emerald-green: #34d399;

    /* Extended Semantic Colors */
    --color-primary: var(--air-force-blue);
    --color-primary-light: var(--cool-steel);
    --color-primary-dark: #3d7a91;
    --color-secondary: var(--sea-green);
    --color-secondary-bright: var(--emerald-green);
    --color-accent: var(--dark-spruce);
    --color-success: var(--sea-green);
    --color-success-glow: rgba(10, 135, 84, 0.55);
    --color-warning: #d9a441;
    --color-warning-glow: rgba(217, 164, 65, 0.55);
    --color-error: #c94a4a;
    --color-error-glow: rgba(201, 74, 74, 0.55);
    --color-info: var(--air-force-blue);

    /* Background Colors - Deep ocean dark theme */
    --bg-primary: #070c10;
    --bg-secondary: #0c1318;
    --bg-tertiary: #121c22;
    --bg-elevated: #18252d;
    --bg-glass: rgba(145, 174, 193, 0.07);
    --bg-glass-hover: rgba(145, 174, 193, 0.12);
    --bg-glass-active: rgba(145, 174, 193, 0.18);

    /* Text Colors */
    --text-primary: #eaf2f7;
    --text-secondary: #9ab5c7;
    --text-tertiary: #34d399;
    --text-muted: #5a7a8f;
    --text-inverse: #070c10;

    /* Border Colors */
    --border-primary: rgba(145, 174, 193, 0.12);
    --border-secondary: rgba(145, 174, 193, 0.22);
    --border-accent: var(--air-force-blue);
    --border-focus: var(--pale-sky);

    /* Extended palette */
    --air-force-blue: 209 28% 48%;
    --cool-steel: 210 15% 65%;
    --surface-glass: 220 16% 12%;
    --surface-elevated: 220 16% 14%;
    --glow-primary: 209 60% 50%;
    --status-healthy: 152 60% 50%;
    --status-active: 152 60% 50%;
    --status-training: 38 90% 55%;
    --status-pending: 25 90% 55%;
    --status-idle: 220 10% 45%;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, var(--air-force-blue) 0%, var(--cool-steel) 100%);
    --gradient-secondary: linear-gradient(135deg, var(--dark-spruce) 0%, var(--sea-green) 100%);
    --gradient-success: linear-gradient(135deg, var(--sea-green) 0%, #0fa366 100%);
    --gradient-card: linear-gradient(160deg, rgba(12, 19, 24, 0.94) 0%, rgba(7, 12, 16, 0.98) 100%);
    --gradient-header: linear-gradient(90deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    --gradient-sidebar: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    --gradient-hero: radial-gradient(ellipse at 30% 20%, rgba(80, 140, 164, 0.08) 0%, transparent 40%),
                     radial-gradient(ellipse at 70% 80%, rgba(10, 135, 84, 0.06) 0%, transparent 40%);
    --gradient-surface: linear-gradient(180deg, rgba(145, 174, 193, 0.03) 0%, transparent 100%);

    /* Notification Colors - Validation Message System */
    --notification-validation-start: rgba(251, 191, 36, 0.95);    /* #FBBf24 - Amber-400 */
    --notification-validation-end: rgba(245, 158, 11, 0.95);      /* #F59E0B - Amber-500 */
    --notification-info-start: rgba(59, 130, 246, 0.95);          /* #3B82F6 - Blue-500 */
    --notification-info-end: rgba(37, 99, 235, 0.95);             /* #2563EB - Blue-600 */
    --notification-warning-start: rgba(245, 158, 11, 0.95);       /* #F59E0B - Amber-500 */
    --notification-warning-end: rgba(217, 119, 6, 0.95);          /* #D97706 - Amber-600 */
    --notification-error-start: rgba(239, 68, 68, 0.95);          /* #EF4444 - Red-500 */
    --notification-error-end: rgba(220, 38, 38, 0.95);            /* #DC2626 - Red-600 */
    --notification-success-start: rgba(34, 197, 94, 0.95);        /* #22C55E - Green-500 */
    --notification-success-end: rgba(22, 163, 74, 0.95);          /* #16A34A - Green-600 */

    /* Notification Gradients */
    --gradient-notification-validation: linear-gradient(135deg, var(--notification-validation-start) 0%, var(--notification-validation-end) 100%);
    --gradient-notification-info: linear-gradient(135deg, var(--notification-info-start) 0%, var(--notification-info-end) 100%);
    --gradient-notification-warning: linear-gradient(135deg, var(--notification-warning-start) 0%, var(--notification-warning-end) 100%);
    --gradient-notification-error: linear-gradient(135deg, var(--notification-error-start) 0%, var(--notification-error-end) 100%);
    --gradient-notification-success: linear-gradient(135deg, var(--notification-success-start) 0%, var(--notification-success-end) 100%);
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.25), 0 1px 3px rgba(0, 0, 0, 0.15);
    --shadow-md: 0 3px 8px rgba(0, 0, 0, 0.3), 0 2px 4px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.35), 0 6px 12px rgba(0, 0, 0, 0.25);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.4), 0 10px 20px rgba(0, 0, 0, 0.3);
    --shadow-glow-primary: 0 0 25px rgba(80, 140, 164, 0.3), 0 0 50px rgba(80, 140, 164, 0.15);
    --shadow-glow-secondary: 0 0 25px rgba(10, 135, 84, 0.35), 0 0 50px rgba(10, 135, 84, 0.18);
    --shadow-glow-success: 0 0 25px rgba(10, 135, 84, 0.4), 0 0 50px rgba(10, 135, 84, 0.2);
    --shadow-inset: inset 0 1px 3px rgba(0, 0, 0, 0.2);
    --shadow-glow: 0 0 20px hsl(209 60% 50% / 0.15);
    --shadow-glow-lg: 0 0 40px hsl(209 60% 50% / 0.2), 0 0 80px hsl(209 60% 50% / 0.1);
    --shadow-card: 0 4px 24px hsl(0 0% 0% / 0.3);
    --shadow-elevated: 0 8px 32px hsl(0 0% 0% / 0.4);
    --shadow-neon: 0 0 8px hsl(209 60% 50% / 0.3), 0 0 32px hsl(209 60% 50% / 0.15);
    
    /* Typography */
    --font-primary: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'Space Mono', 'Fira Code', 'Consolas', monospace;
    --font-size-xs: 0.6875rem;
    --font-size-sm: 0.8125rem;
    --font-size-base: 0.9375rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.375rem;
    --font-size-2xl: 1.75rem;
    --font-size-3xl: 2.25rem;
    --font-size-4xl: 3rem;
    --line-height-tight: 1.2;
    --line-height-normal: 1.55;
    --line-height-relaxed: 1.75;
    --letter-spacing-tight: -0.015em;
    --letter-spacing-normal: 0;
    --letter-spacing-wide: 0.04em;
    --letter-spacing-wider: 0.08em;

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 0.75rem;
    --space-lg: 1rem;
    --space-xl: 1.5rem;
    --space-2xl: 2rem;
    --space-3xl: 3rem;
    --space-4xl: 4rem;

    /* Border Radius */
    --radius-sm: 3px;
    --radius-md: 6px;
    --radius-lg: 10px;
    --radius-xl: 14px;
    --radius-2xl: 20px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 120ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 220ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 450ms cubic-bezier(0.34, 1.56, 0.64, 1);

    /* Custom utility classes */
        @layer utilities {
            .glass-surface {
                background: hsl(var(--surface-glass) / 0.7);
                border: 1px solid hsl(var(--border));
                backdrop-filter: blur(12px);
            }
    
            .glass-surface-hover:hover {
                background: hsl(var(--surface-elevated));
                border-color: hsl(var(--air-force-blue) / 0.4);
            }
    
            .glow-accent {
                box-shadow: var(--shadow-glow);
            }
    
            .text-gradient {
                background: var(--gradient-accent);
                -webkit-background-clip: text;
                -webkit-text-fill-color: transparent;
                background-clip: text;
            }
    
            .text-gradient-bright {
                background: linear-gradient(135deg, hsl(200 80% 70%), hsl(209 50% 60%), hsl(220 40% 80%));
                -webkit-background-clip: text;
                -webkit-text-fill-color: transparent;
                background-clip: text;
            }
        }
    
        /* Animated gradient border wrapper */
        @property --border-angle {
            syntax: '<angle>';
            initial-value: 0deg;
            inherits: false;
        }
    
        .animated-border {
            --border-angle: 0deg;
            border: 1px solid transparent;
            background-origin: border-box;
            background-clip: padding-box, border-box;
            background-image:
                linear-gradient(hsl(var(--card)), hsl(var(--card))),
                conic-gradient(from var(--border-angle),
                    hsl(209 40% 45% / 0.1),
                    hsl(209 50% 55% / 0.5),
                    hsl(200 60% 60% / 0.3),
                    hsl(209 40% 45% / 0.1));
            animation: rotate-border 4s linear infinite;
        }
    
        @keyframes rotate-border {
            to {
                --border-angle: 360deg;
            }
        }
    
        /* Grid pattern overlay */
        .grid-pattern {
            background-image:
                linear-gradient(hsl(var(--border) / 0.15) 1px, transparent 1px),
                linear-gradient(90deg, hsl(var(--border) / 0.15) 1px, transparent 1px);
            background-size: 40px 40px;
        }
    
        /* Scan-line effect */
        .scanline::after {
            content: '';
            position: absolute;
            inset: 0;
            pointer-events: none;
            background: repeating-linear-gradient(0deg,
                    transparent,
                    transparent 2px,
                    hsl(209 60% 50% / 0.02) 2px,
                    hsl(209 60% 50% / 0.02) 4px);
            z-index: 1;
        }
    
        /* Ambient orb glow */
        @keyframes float-orb {
    
            0%,
            100% {
                transform: translate(0, 0) scale(1);
            }
    
            25% {
                transform: translate(30px, -20px) scale(1.1);
            }
    
            50% {
                transform: translate(-20px, 15px) scale(0.95);
            }
    
            75% {
                transform: translate(15px, 25px) scale(1.05);
            }
        }
    
        .ambient-orb {
            position: absolute;
            border-radius: 50%;
            filter: blur(80px);
            opacity: 0.4;
            animation: float-orb 15s ease-in-out infinite;
            pointer-events: none;
        }
    
        /* Shimmer text animation */
        @keyframes shimmer {
            0% {
                background-position: -200% center;
            }
    
            100% {
                background-position: 200% center;
            }
        }
    
        .shimmer-text {
            background: linear-gradient(90deg,
                    hsl(var(--foreground)) 0%,
                    hsl(200 70% 70%) 25%,
                    hsl(var(--foreground)) 50%,
                    hsl(200 70% 70%) 75%,
                    hsl(var(--foreground)) 100%);
            background-size: 200% auto;
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            animation: shimmer 6s linear infinite;
        }
        
    /* Z-Index Scale */
    --z-base: 0;
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-fixed: 300;
    --z-modal-backdrop: 400;
    --z-modal: 500;
    --z-popover: 600;
    --z-toast: 700;
    --z-tooltip: 2000;
}

/* ============================================
   LIGHT MODE OVERRIDES
   ============================================ */
[data-theme="light"],
:root.light {
    --pale-sky: #7ba3c4;
    --cool-steel: #5a8aa8;
    --air-force-blue: #3d7a91;
    --sea-green: #087048;
    --dark-spruce: #003d24;

    --color-primary: var(--air-force-blue);
    --color-primary-light: var(--cool-steel);
    --color-primary-dark: #2d5f73;
    --color-secondary: var(--sea-green);
    --color-success-glow: rgba(8, 112, 72, 0.35);
    --color-warning: #c08a2a;
    --color-warning-glow: rgba(192, 138, 42, 0.35);
    --color-error: #b84040;
    --color-error-glow: rgba(184, 64, 64, 0.35);

    --bg-primary: #f8fafb;
    --bg-secondary: #ffffff;
    --bg-tertiary: #eef3f6;
    --bg-elevated: #ffffff;
    --bg-glass: rgba(61, 122, 145, 0.06);
    --bg-glass-hover: rgba(61, 122, 145, 0.10);
    --bg-glass-active: rgba(61, 122, 145, 0.14);

    --text-primary: #1a2a35;
    --text-secondary: #4a6070;
    --text-tertiary: #3d7a91;
    --text-muted: #7a8f9f;
    --text-inverse: #f8fafb;

    --border-primary: rgba(61, 122, 145, 0.15);
    --border-secondary: rgba(61, 122, 145, 0.25);

    --gradient-card: linear-gradient(160deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 251, 0.98) 100%);
    --gradient-header: linear-gradient(90deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    --gradient-sidebar: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    --gradient-hero: radial-gradient(ellipse at 30% 20%, rgba(61, 122, 145, 0.06) 0%, transparent 40%),
                     radial-gradient(ellipse at 70% 80%, rgba(8, 112, 72, 0.04) 0%, transparent 40%);

    --shadow-sm: 0 1px 2px rgba(26, 42, 53, 0.06), 0 1px 3px rgba(26, 42, 53, 0.08);
    --shadow-md: 0 3px 8px rgba(26, 42, 53, 0.08), 0 2px 4px rgba(26, 42, 53, 0.06);
    --shadow-lg: 0 10px 25px rgba(26, 42, 53, 0.10), 0 6px 12px rgba(26, 42, 53, 0.08);
    --shadow-xl: 0 20px 40px rgba(26, 42, 53, 0.12), 0 10px 20px rgba(26, 42, 53, 0.08);
    --shadow-glow-primary: 0 0 20px rgba(61, 122, 145, 0.20), 0 0 40px rgba(61, 122, 145, 0.10);
    --shadow-glow-secondary: 0 0 20px rgba(8, 112, 72, 0.22), 0 0 40px rgba(8, 112, 72, 0.12);
}

/* ============================================
   BASE STYLES & RESET
   ============================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

@media (max-width: 900px) {
    html {
        overflow-x: hidden;
        width: 100%;
    }
}

body {
    font-family: var(--font-primary);
    font-size: var(--font-size-base);
    line-height: var(--line-height-normal);
    color: var(--text-primary);
    background: var(--bg-primary);
    background-image: var(--gradient-hero);
    background-attachment: fixed;
    min-height: 100vh;
    overflow-x: hidden;
}

@media (max-width: 900px) {
    body {
        overflow-x: hidden;
        width: 100vw;
        position: relative;
    }
}

::selection {
    background: var(--air-force-blue);
    color: var(--text-primary);
}

a {
    color: var(--air-force-blue);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--pale-sky);
}

/* ============================================
   SCROLLBAR STYLING
   ============================================ */
::-webkit-scrollbar {
    width: 10px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--cool-steel);
    border-radius: var(--radius-sm);
    border: 2px solid var(--bg-secondary);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--air-force-blue);
}

/* ============================================
   AUTH SHELL – Split-panel login/signup
   ============================================ */
.auth-container {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
}

.auth-shell {
    display: grid;
    grid-template-columns: 5fr 7fr;
    flex: 1;
}

.auth-footer {
    background: var(--bg-primary);
    border-top: 1px solid var(--border-primary);
    padding: var(--space-lg) var(--space-2xl);
    text-align: center;
}

.auth-footer p {
    margin: 0;
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

@media (max-width: 900px) {
    .auth-shell {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }
    .auth-panel-brand {
        display: flex;
        padding: var(--space-xl) var(--space-lg);
        border-right: none;
        border-bottom: 1px solid var(--border-primary);
        min-height: auto;
    }
    .brand-content {
        margin-top: 0;
    }
    .auth-footer {
        padding: var(--space-md) var(--space-lg);
    }
}

/* ── Brand panel (left) ── */
.auth-panel-brand {
    background: var(--gradient-sidebar);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: var(--space-3xl) var(--space-4xl);
    border-right: 1px solid var(--border-primary);
    position: relative;
    overflow: hidden;
}

/* Mobile: adjust padding for better balance */
@media (max-width: 900px) {
    .auth-panel-brand {
        padding: var(--space-2xl) var(--space-xl);
    }
}

.auth-panel-brand::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-hero);
    pointer-events: none;
}

.brand-content {
    position: relative;
    margin-top: 8vh;
}

/* Mobile: reduce top margin for better balance */
@media (max-width: 900px) {
    .brand-content {
        margin-top: var(--space-2xl);
    }
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    color: var(--text-primary);
    margin-bottom: var(--space-3xl);
}

/* Mobile: reduce logo bottom margin */
@media (max-width: 900px) {
    .brand-logo {
        margin-bottom: var(--space-xl);
    }
}

.brand-logo svg {
    width: 72px;
    height: 72px;
    flex-shrink: 0;
    filter: drop-shadow(0 0 24px rgba(52, 211, 153, 0.5)) drop-shadow(0 0 48px rgba(52, 211, 153, 0.25));
}

.brand-logo img {
    width: auto;
    height: 64px !important;
    flex-shrink: 0;
    filter: drop-shadow(0 0 24px rgba(52, 211, 153, 0.5)) drop-shadow(0 0 48px rgba(52, 211, 153, 0.25));
}

/* Responsive logo sizing */
@media (max-width: 600px) {
    .brand-logo img {
        height: 36px !important;
        max-width: 90vw;
        object-fit: contain;
    }
    .brand-sub {
        display: none;
    }
}

@media (min-width: 601px) and (max-width: 900px) {
    .brand-logo img {
        height: 48px !important;
        max-width: 90vw;
        object-fit: contain;
    }
}

.brand-name {
    font-weight: 700;
    font-size: var(--font-size-2xl);
    letter-spacing: var(--letter-spacing-tight);
}

.brand-tagline {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    line-height: var(--line-height-tight);
    letter-spacing: var(--letter-spacing-tight);
    color: var(--text-primary);
    margin-bottom: var(--space-xl);
}

.brand-tagline .highlight-emerald {
    background: linear-gradient(135deg, 
        var(--emerald-green) 0%, 
        var(--sea-green) 50%, 
        var(--emerald-green) 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: emerald-shimmer 3s ease-in-out infinite;
    text-shadow: 0 0 30px rgba(52, 211, 153, 0.3);
    position: relative;
}

.brand-tagline .highlight-emerald::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        var(--emerald-green) 50%, 
        transparent 100%);
    opacity: 0.6;
    animation: emerald-pulse 2s ease-in-out infinite;
}

@keyframes emerald-shimmer {
    0%, 100% {
        background-position: 0% center;
        filter: brightness(1);
    }
    50% {
        background-position: 100% center;
        filter: brightness(1.2);
    }
}

@keyframes emerald-pulse {
    0%, 100% {
        opacity: 0.4;
        transform: scaleX(0.8);
    }
    50% {
        opacity: 0.8;
        transform: scaleX(1);
    }
}

.brand-tagline::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--emerald-green);
    margin-top: var(--space-lg);
    border-radius: var(--radius-sm);
    box-shadow: 0 0 20px rgba(52, 211, 153, 0.4);
}

.brand-sub {
    font-size: var(--font-size-lg);
    color: var(--text-secondary);
    max-width: 480px;
    line-height: var(--line-height-relaxed);
}

/* ── Form panel (right) ── */
.auth-panel-form {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-2xl) var(--space-4xl);
    background: var(--bg-primary);
}

@media (max-width: 900px) {
    .auth-panel-form {
        padding: var(--space-xl) var(--space-lg);
    }
    .brand-content {
        margin-top: 0;
    }
}

.form-wrapper {
    width: 100%;
    max-width: 460px;
}

.form-wrapper h2 {
    font-size: var(--font-size-xl);
    font-weight: 700;
    letter-spacing: var(--letter-spacing-tight);
    margin-bottom: var(--space-xs);
    color: var(--text-primary);
}

.form-subtitle {
    color: var(--text-secondary);
    margin-bottom: var(--space-xl);
    font-size: var(--font-size-sm);
}

/* ── Form Styles ── */
.auth-form label {
    display: block;
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
    margin-top: var(--space-lg);
}

.auth-form label:first-of-type {
    margin-top: 0;
}

.auth-form input[type="email"],
.auth-form input[type="password"],
.auth-form input[type="text"] {
    width: 100%;
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-glass);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-size: var(--font-size-sm);
    font-family: var(--font-primary);
    transition: all var(--transition-fast);
}

.auth-form input:focus {
    outline: none;
    border-color: var(--air-force-blue);
    box-shadow: 0 0 0 3px rgba(80, 140, 164, 0.15);
    background: var(--bg-glass-hover);
}

.auth-form input::placeholder {
    color: var(--text-muted);
}

.input-hint {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    margin-top: var(--space-xs);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
}

@media (max-width: 500px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

.form-row-between {
    display: flex;
    justify-content: flex-end;
    margin-top: var(--space-sm);
}

.link-muted {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    transition: color var(--transition-fast);
}

.link-muted:hover {
    color: var(--air-force-blue);
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    border-radius: var(--radius-lg);
    font-size: var(--font-size-sm);
    font-weight: 600;
    font-family: var(--font-primary);
    border: none;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    width: 100%;
    margin-top: var(--space-xl);
    background: linear-gradient(135deg, var(--sea-green) 0%, var(--emerald-green) 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(52, 211, 153, 0.25);
}

.btn-primary:hover {
    box-shadow: 0 0 30px rgba(52, 211, 153, 0.5), 0 4px 16px rgba(52, 211, 153, 0.35);
    transform: translateY(-2px);
}

.btn-primary:active {
    transform: translateY(0) scale(0.98);
}

/* ── Button loading state ── */
.btn-primary .btn-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: btn-spin 0.6s linear infinite;
}

.btn-primary.is-loading .btn-label {
    visibility: hidden;
}

.btn-primary.is-loading .btn-spinner {
    display: block;
    position: absolute;
}

.btn-primary.is-loading {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0.8;
}

@keyframes btn-spin {
    to { transform: rotate(360deg); }
}

.form-footer {
    text-align: center;
    margin-top: var(--space-xl);
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

/* ── Alerts ── */
/* Aligned with Autonomy/Command Center notification color palette */
.alert {
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-lg);
    font-size: var(--font-size-sm);
    margin-bottom: var(--space-lg);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    line-height: 1.5;
    backdrop-filter: blur(20px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.alert::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 2px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* 🔴 Red - Error (System Failures) */
.alert-error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.95) 0%, rgba(220, 38, 38, 0.95) 100%);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.2);
}

.alert-error::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z'/%3E%3C/svg%3E");
}

/* 🔵 Blue - Info (Duplicates/Informational) */
.alert-info {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.95) 0%, rgba(37, 99, 235, 0.95) 100%);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.2);
}

.alert-info::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z'/%3E%3C/svg%3E");
}

/* 🟢 Green - Success (Confirmation) */
.alert-success {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.95) 0%, rgba(22, 163, 74, 0.95) 100%);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.2);
}

.alert-success::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z'/%3E%3C/svg%3E");
}

/* 🟠 Orange - Warning (Recoverable Issues) */
.alert-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.95) 0%, rgba(217, 119, 6, 0.95) 100%);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.2);
}

.alert-warning::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff'%3E%3Cpath d='M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z'/%3E%3C/svg%3E");
}

/* 🟡 Amber - Validation (Form Validation) */
.alert-validation {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.95) 0%, rgba(245, 158, 11, 0.95) 100%);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.2);
}

.alert-validation::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff'%3E%3Cpath d='M13,9H11V7H13M13,17H11V11H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z'/%3E%3C/svg%3E");
}

/* ============================================
   APP SHELL – Sidebar + Content (Dashboard)
   ============================================ */
.app-shell {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100dvh;
}

@media (max-width: 900px) {
    .app-shell {
        grid-template-columns: 1fr;
    }
    .sidebar {
        display: none;
    }
    .sidebar.open {
        display: flex;
        position: fixed;
        inset: 0;
        z-index: var(--z-modal);
        width: 280px;
        box-shadow: var(--shadow-xl);
    }
}

/* ── Sidebar ── */
.sidebar {
    background: var(--gradient-sidebar);
    border-right: 1px solid var(--border-primary);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.sidebar-header {
    padding: var(--space-xl) var(--space-lg);
    border-bottom: 1px solid var(--border-primary);
}

.sidebar-header .brand-logo {
    gap: var(--space-sm);
    margin-bottom: 0;
}

.sidebar-header .brand-name {
    font-size: var(--font-size-base);
}

.sidebar-nav {
    flex: 1;
    padding: var(--space-md) var(--space-md);
}

.nav-section-label {
    font-size: var(--font-size-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: var(--letter-spacing-wider);
    color: var(--text-muted);
    padding: var(--space-lg) var(--space-md) var(--space-sm);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-normal);
    border-left: 2px solid transparent;
    text-decoration: none;
}

.nav-item:hover {
    background: var(--bg-glass);
    color: var(--text-primary);
    border-left-color: var(--cool-steel);
}

.nav-item.active {
    background: var(--bg-glass-active);
    color: var(--air-force-blue);
    border-left-color: var(--air-force-blue);
}

.nav-icon {
    font-size: var(--font-size-base);
    width: 1.4rem;
    text-align: center;
    flex-shrink: 0;
    opacity: 0.8;
}

.nav-item:hover .nav-icon,
.nav-item.active .nav-icon {
    opacity: 1;
}

/* ── Sidebar Footer / User Card ── */
.sidebar-footer {
    border-top: 1px solid var(--border-primary);
    padding: var(--space-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
}

.user-card {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    min-width: 0;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: var(--bg-glass-active);
    color: var(--air-force-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: var(--font-size-sm);
    flex-shrink: 0;
    border: 1px solid var(--border-primary);
}

.user-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.user-name {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-email {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.signout-form {
    flex-shrink: 0;
}

.btn-signout {
    background: transparent;
    border: 1px solid var(--border-primary);
    color: var(--text-muted);
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: var(--font-size-base);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.btn-signout:hover {
    border-color: var(--color-error);
    color: var(--color-error);
    background: rgba(201, 74, 74, 0.08);
}

/* ── Content Area ── */
.app-content {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: transparent;
}

.content-header {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    padding: var(--space-lg) var(--space-xl);
    border-bottom: 1px solid var(--border-primary);
    background: var(--gradient-header);
    backdrop-filter: blur(16px);
}

.content-header h1 {
    font-size: var(--font-size-lg);
    font-weight: 600;
    letter-spacing: var(--letter-spacing-tight);
    flex: 1;
    color: var(--text-primary);
}

.sidebar-toggle {
    display: none;
    background: transparent;
    border: 1px solid var(--border-primary);
    color: var(--text-primary);
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: var(--font-size-base);
    align-items: center;
    justify-content: center;
}

@media (max-width: 900px) {
    .sidebar-toggle {
        display: flex;
    }
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

/* Mobile responsive header */
@media (max-width: 900px) {
    .content-header {
        padding: var(--space-md) var(--space-lg);
    }

    .content-header h1 {
        font-size: var(--font-size-base);
    }

    .header-actions {
        gap: var(--space-sm);
    }

    .env-badge {
        display: none;
    }
}

@media (max-width: 600px) {
    .content-header {
        padding: var(--space-sm) var(--space-md);
    }
}

.env-badge {
    font-size: var(--font-size-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: var(--letter-spacing-wide);
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-full);
    background: var(--bg-glass-active);
    color: var(--air-force-blue);
    font-family: var(--font-mono);
    border: 1px solid var(--border-primary);
}

.content-body {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-xl);
}

/* Mobile responsive content */
@media (max-width: 900px) {
    .content-body {
        padding: var(--space-lg);
    }
}

@media (max-width: 600px) {
    .content-body {
        padding: var(--space-md);
    }
}

/* ── Welcome Card ── */
.welcome-card {
    max-width: 580px;
    margin: var(--space-4xl) auto;
    text-align: center;
}

.welcome-card h2 {
    font-size: var(--font-size-xl);
    font-weight: 700;
    letter-spacing: var(--letter-spacing-tight);
    margin-bottom: var(--space-sm);
    color: var(--text-primary);
}

.welcome-card p {
    color: var(--text-secondary);
    margin-bottom: var(--space-2xl);
}

.quick-actions {
    display: flex;
    gap: var(--space-lg);
    justify-content: center;
    flex-wrap: wrap;
}

.qa-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-xl) var(--space-2xl);
    background: var(--gradient-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-xl);
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: var(--font-size-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.qa-btn:hover {
    border-color: var(--air-force-blue);
    background: var(--bg-glass-hover);
    box-shadow: var(--shadow-glow-primary);
    transform: translateY(-2px);
}

.qa-icon {
    font-size: var(--font-size-xl);
    opacity: 0.8;
}

/* ── Loading State ── */
.content-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    font-size: var(--font-size-sm);
    gap: var(--space-md);
}

.spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border-primary);
    border-top-color: var(--air-force-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(16px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-fade-in {
    animation: fadeIn var(--transition-normal) ease-out;
}

.animate-slide-in {
    animation: slideIn var(--transition-normal) ease-out;
}

/* ============================================
   FOCUS STATES (Accessibility)
   ============================================ */
:focus-visible {
    outline: 2px solid var(--air-force-blue);
    outline-offset: 2px;
}

.btn:focus-visible {
    outline: 2px solid var(--pale-sky);
    outline-offset: 2px;
}

/* ============================================
   LOGO SWITCHING - Dark/Light Mode
   ============================================ */

/* Logo image base styles */
.logo img,
.brand-logo img {
    height: 64px;
    width: auto;
    transition: all 0.3s ease;
}

/* Hide all logos by default, then show based on theme */
.logo img,
.brand-logo img {
    display: none !important;
}

/* Dark mode (default): show dark variant logos */
.logo img.logo-dark,
.brand-logo img.logo-dark {
    display: block !important;
}

/* Light mode: show light variant logos */
[data-theme="light"] .logo img.logo-dark,
[data-theme="light"] .brand-logo img.logo-dark,
:root.light .logo img.logo-dark,
:root.light .brand-logo img.logo-dark {
    display: none !important;
}

[data-theme="light"] .logo img.logo-light,
[data-theme="light"] .brand-logo img.logo-light,
:root.light .logo img.logo-light,
:root.light .brand-logo img.logo-light {
    display: block !important;
}

/* ============================================
   LIGHT MODE SPECIFIC OVERRIDES
   ============================================ */
[data-theme="light"] ::selection,
:root.light ::selection {
    background: var(--air-force-blue);
    color: #ffffff;
}

[data-theme="light"] .auth-form input:focus,
:root.light .auth-form input:focus {
    box-shadow: 0 0 0 3px rgba(61, 122, 145, 0.12);
    background: var(--bg-secondary);
}

[data-theme="light"] .btn-primary,
:root.light .btn-primary {
    color: #ffffff;
}

/* Light mode alert overrides - maintain gradient approach with adjusted opacity */
[data-theme="light"] .alert-error,
:root.light .alert-error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.85) 0%, rgba(220, 38, 38, 0.85) 100%);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.3);
}

[data-theme="light"] .alert-error::before,
:root.light .alert-error::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z'/%3E%3C/svg%3E");
}

[data-theme="light"] .alert-info,
:root.light .alert-info {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.85) 0%, rgba(37, 99, 235, 0.85) 100%);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.3);
}

[data-theme="light"] .alert-info::before,
:root.light .alert-info::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z'/%3E%3C/svg%3E");
}

[data-theme="light"] .alert-success,
:root.light .alert-success {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.85) 0%, rgba(22, 163, 74, 0.85) 100%);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.3);
}

[data-theme="light"] .alert-success::before,
:root.light .alert-success::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z'/%3E%3C/svg%3E");
}

[data-theme="light"] .alert-warning,
:root.light .alert-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.85) 0%, rgba(217, 119, 6, 0.85) 100%);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.3);
}

[data-theme="light"] .alert-warning::before,
:root.light .alert-warning::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff'%3E%3Cpath d='M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z'/%3E%3C/svg%3E");
}

[data-theme="light"] .alert-validation,
:root.light .alert-validation {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.85) 0%, rgba(245, 158, 11, 0.85) 100%);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.3);
}

[data-theme="light"] .alert-validation::before,
:root.light .alert-validation::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff'%3E%3Cpath d='M13,9H11V7H13M13,17H11V11H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z'/%3E%3C/svg%3E");
}

[data-theme="light"] ::-webkit-scrollbar-track,
:root.light ::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

[data-theme="light"] ::-webkit-scrollbar-thumb,
:root.light ::-webkit-scrollbar-thumb {
    border-color: var(--bg-tertiary);
}
