/* ============================================
   AXIS — Design System
   Plataforma de Cursos: Arquitetura da Consciência
   ============================================ */

/* ============================================
   CSS CUSTOM PROPERTIES (TOKENS)
   ============================================ */
:root {
    /* === Color Palette === */
    /* Primary: Deep Violet / Indigo (consciousness, depth) */
    --primary-50: #f0eaff;
    --primary-100: #d4c4ff;
    --primary-200: #b89dff;
    --primary-300: #9b76ff;
    --primary-400: #7f50ff;
    --primary-500: #6d3aed;
    --primary-600: #5a2dcf;
    --primary-700: #4722a8;
    --primary-800: #351a82;
    --primary-900: #24115c;

    /* Accent: Warm Gold (transformation, alchemy) */
    --accent-50: #fff8e6;
    --accent-100: #ffebb3;
    --accent-200: #ffde80;
    --accent-300: #ffd14d;
    --accent-400: #ffc41a;
    --accent-500: #f0a500;
    --accent-600: #cc8b00;
    --accent-700: #a87200;
    --accent-800: #855900;
    --accent-900: #614100;

    /* Semantic Colors */
    --success-400: #34d399;
    --success-500: #10b981;
    --success-600: #059669;
    --warning-400: #fbbf24;
    --warning-500: #f59e0b;
    --error-400: #f87171;
    --error-500: #ef4444;
    --error-600: #dc2626;
    --info-400: #60a5fa;
    --info-500: #3b82f6;

    /* === Dark Theme (default) === */
    --bg-base: #0a0a12;
    --bg-surface: #12121e;
    --bg-elevated: #1a1a2e;
    --bg-card: #16162a;
    --bg-hover: #1f1f3a;
    --bg-overlay: rgba(0, 0, 0, 0.7);
    --bg-glass: rgba(22, 22, 42, 0.65);
    --bg-input: #0f0f1e;

    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-default: rgba(255, 255, 255, 0.1);
    --border-strong: rgba(255, 255, 255, 0.18);
    --border-focus: var(--primary-500);

    --text-primary: #f0f0f5;
    --text-secondary: #a0a0b8;
    --text-tertiary: #6b6b85;
    --text-inverse: #0a0a12;
    --text-accent: var(--primary-300);

    /* === Typography === */
    --font-display: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;

    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;
    --text-4xl: 2.25rem;
    --text-5xl: 3rem;

    --leading-tight: 1.2;
    --leading-normal: 1.5;
    --leading-relaxed: 1.65;

    --weight-light: 300;
    --weight-regular: 400;
    --weight-medium: 500;
    --weight-semibold: 600;
    --weight-bold: 700;
    --weight-extrabold: 800;

    /* === Spacing === */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;

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

    /* === Shadows === */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 16px 50px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 30px rgba(109, 58, 237, 0.3);
    --shadow-glow-accent: 0 0 30px rgba(240, 165, 0, 0.2);

    /* === Layout === */
    --sidebar-width: 280px;
    --sidebar-collapsed: 72px;
    --header-height: 64px;
    --content-max-width: 1200px;

    /* === Transitions === */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms ease;
    --transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);

    /* === Z-Index === */
    --z-sidebar: 100;
    --z-header: 90;
    --z-overlay: 200;
    --z-modal: 300;
    --z-toast: 400;
    --z-loading: 500;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    font-weight: var(--weight-regular);
    line-height: var(--leading-normal);
    color: var(--text-primary);
    background: var(--bg-base);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Subtle gradient background */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background:
        radial-gradient(ellipse at 20% 0%, rgba(109, 58, 237, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 100%, rgba(240, 165, 0, 0.05) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

a {
    color: var(--primary-300);
    text-decoration: none;
    transition: color var(--transition-fast);
}
a:hover { color: var(--primary-200); }

img { max-width: 100%; display: block; }

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: var(--weight-bold);
    line-height: var(--leading-tight);
    color: var(--text-primary);
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }

p { line-height: var(--leading-relaxed); }

::selection {
    background: rgba(109, 58, 237, 0.3);
    color: var(--text-primary);
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* ============================================
   LOADING SCREEN
   ============================================ */
.loading-screen {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: var(--bg-base);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-loading);
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.loading-content {
    text-align: center;
}

.loading-logo {
    margin-bottom: var(--space-8);
    display: flex;
    justify-content: center;
}

.logo-orbit {
    position: relative;
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.orbit-ring {
    position: absolute;
    border: 1px solid rgba(109, 58, 237, 0.3);
    border-radius: 50%;
    animation: orbit-spin 3s linear infinite;
}

.orbit-ring:nth-child(1) {
    width: 60px; height: 60px;
    border-color: rgba(109, 58, 237, 0.4);
    animation-duration: 3s;
}
.orbit-ring:nth-child(2) {
    width: 80px; height: 80px;
    border-color: rgba(109, 58, 237, 0.25);
    animation-duration: 4s;
    animation-direction: reverse;
}
.orbit-ring:nth-child(3) {
    width: 100px; height: 100px;
    border-color: rgba(109, 58, 237, 0.15);
    animation-duration: 5s;
}

.orbit-ring::after {
    content: '';
    position: absolute;
    top: -3px; left: 50%;
    width: 6px; height: 6px;
    background: var(--primary-400);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--primary-500);
}

.orbit-core {
    font-family: var(--font-display);
    font-size: var(--text-3xl);
    font-weight: var(--weight-extrabold);
    color: var(--primary-400);
    text-shadow: 0 0 20px rgba(109, 58, 237, 0.5);
    z-index: 2;
}

@keyframes orbit-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.loading-title {
    font-family: var(--font-display);
    font-size: var(--text-4xl);
    font-weight: var(--weight-extrabold);
    letter-spacing: 0.15em;
    background: linear-gradient(135deg, var(--primary-300), var(--accent-400));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--space-2);
}

.loading-subtitle {
    color: var(--text-secondary);
    font-size: var(--text-sm);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: var(--space-8);
}

.loading-bar {
    width: 200px;
    height: 3px;
    background: var(--border-subtle);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin: 0 auto;
}

.loading-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary-500), var(--accent-500));
    border-radius: var(--radius-full);
    animation: loading-fill 1.8s ease-in-out forwards;
}

@keyframes loading-fill {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}

/* ============================================
   AUTH VIEWS
   ============================================ */
.auth-container {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    position: relative;
    z-index: 1;
}

.auth-left {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: var(--space-16);
    background: linear-gradient(135deg, rgba(109, 58, 237, 0.1) 0%, rgba(240, 165, 0, 0.05) 100%);
    border-right: 1px solid var(--border-subtle);
    position: relative;
    overflow: hidden;
}

.auth-left::before {
    content: '';
    position: absolute;
    top: -50%; right: -50%;
    width: 100%; height: 100%;
    background: radial-gradient(circle, rgba(109, 58, 237, 0.08) 0%, transparent 70%);
    animation: pulse-glow 6s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.1); }
}

.auth-brand {
    position: relative;
    z-index: 1;
    margin-bottom: var(--space-12);
}

.auth-logo {
    font-family: var(--font-display);
    font-size: var(--text-5xl);
    font-weight: var(--weight-extrabold);
    color: var(--primary-400);
    text-shadow: 0 0 30px rgba(109, 58, 237, 0.4);
    margin-bottom: var(--space-4);
}

.auth-brand h1 {
    font-size: var(--text-5xl);
    letter-spacing: 0.12em;
    background: linear-gradient(135deg, var(--text-primary), var(--primary-300));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--space-6);
}

.auth-tagline {
    font-size: var(--text-lg);
    color: var(--text-secondary);
    font-style: italic;
    line-height: var(--leading-relaxed);
    max-width: 420px;
}

.auth-features {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.auth-feature {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    color: var(--text-secondary);
    font-size: var(--text-base);
}

.feature-icon {
    width: 20px;
    height: 20px;
    color: var(--primary-400);
    flex-shrink: 0;
}

.auth-right {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-8);
    position: relative;
    z-index: 1;
}

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

.auth-form-wrapper h2 {
    font-size: var(--text-3xl);
    margin-bottom: var(--space-2);
}

.auth-form-desc {
    color: var(--text-secondary);
    margin-bottom: var(--space-8);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.form-group label {
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    color: var(--text-secondary);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper > svg,
.input-wrapper > i {
    position: absolute;
    left: var(--space-4);
    width: 18px;
    height: 18px;
    color: var(--text-tertiary);
    pointer-events: none;
    z-index: 1;
}

.input-wrapper input {
    width: 100%;
    padding: var(--space-3) var(--space-4) var(--space-3) calc(var(--space-4) + 26px);
    background: var(--bg-input);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: var(--text-base);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    outline: none;
}

.input-wrapper input:focus {
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(109, 58, 237, 0.15);
}

.input-wrapper input::placeholder {
    color: var(--text-tertiary);
}

.toggle-password {
    position: absolute;
    right: var(--space-3);
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: var(--space-1);
    display: flex;
    z-index: 1;
}
.toggle-password:hover { color: var(--text-secondary); }
.toggle-password svg, .toggle-password i { width: 18px; height: 18px; pointer-events: none; }

.form-actions-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

.checkbox-wrapper input[type="checkbox"] {
    appearance: none;
    width: 18px; height: 18px;
    border: 1px solid var(--border-default);
    border-radius: 4px;
    background: var(--bg-input);
    cursor: pointer;
    position: relative;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.checkbox-wrapper input[type="checkbox"]:checked {
    background: var(--primary-500);
    border-color: var(--primary-500);
}

.checkbox-wrapper input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.link-forgot {
    font-size: var(--text-sm);
    color: var(--primary-400);
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    margin: var(--space-6) 0;
    color: var(--text-tertiary);
    font-size: var(--text-sm);
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-subtle);
}

.auth-switch {
    text-align: center;
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.auth-switch a {
    font-weight: var(--weight-semibold);
}

.demo-hint {
    margin-top: var(--space-6);
    padding: var(--space-4);
    background: rgba(109, 58, 237, 0.08);
    border: 1px solid rgba(109, 58, 237, 0.2);
    border-radius: var(--radius-md);
    display: flex;
    gap: var(--space-3);
    align-items: flex-start;
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.demo-hint svg, .demo-hint i {
    width: 18px; height: 18px;
    color: var(--primary-400);
    flex-shrink: 0;
    margin-top: 2px;
}

/* ============================================
   APP LAYOUT
   ============================================ */
.app-layout {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    top: 0; left: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg-surface);
    border-right: 1px solid var(--border-subtle);
    z-index: var(--z-sidebar);
    transition: width var(--transition-base), transform var(--transition-base);
    overflow: hidden;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed);
}

.sidebar.collapsed .brand-text,
.sidebar.collapsed .nav-link span,
.sidebar.collapsed .sidebar-section-title,
.sidebar.collapsed .sidebar-progress,
.sidebar.collapsed .user-info {
    opacity: 0;
    pointer-events: none;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-5) var(--space-5);
    border-bottom: 1px solid var(--border-subtle);
    min-height: var(--header-height);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.brand-icon {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: var(--weight-extrabold);
    color: var(--primary-400);
    text-shadow: 0 0 15px rgba(109, 58, 237, 0.4);
    flex-shrink: 0;
}

.brand-text {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: var(--weight-bold);
    letter-spacing: 0.1em;
    transition: opacity var(--transition-fast);
    white-space: nowrap;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: var(--space-2);
    border-radius: var(--radius-sm);
    display: flex;
    transition: all var(--transition-fast);
}
.sidebar-toggle:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}
.sidebar-toggle svg, .sidebar-toggle i { width: 20px; height: 20px; }

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-4) var(--space-3);
}

.nav-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-weight: var(--weight-medium);
    font-size: var(--text-sm);
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.nav-link:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-link.active {
    background: rgba(109, 58, 237, 0.12);
    color: var(--primary-300);
}

.nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    width: 3px;
    height: 24px;
    background: var(--primary-500);
    border-radius: 0 3px 3px 0;
}

.nav-link svg, .nav-link i {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.nav-link span {
    transition: opacity var(--transition-fast);
}

.nav-item {
    position: relative;
}

/* Sidebar Progress Section */
.sidebar-section {
    margin-top: var(--space-8);
    padding-top: var(--space-4);
    border-top: 1px solid var(--border-subtle);
}

.sidebar-section-title {
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0 var(--space-4);
    margin-bottom: var(--space-3);
    transition: opacity var(--transition-fast);
    white-space: nowrap;
}

.sidebar-progress {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    transition: opacity var(--transition-fast);
}

.progress-module-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    color: var(--text-secondary);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.progress-module-item:hover {
    background: var(--bg-hover);
}

.progress-module-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--text-tertiary);
}

.progress-module-dot.completed { background: var(--success-500); }
.progress-module-dot.active { background: var(--primary-500); box-shadow: 0 0 8px var(--primary-500); }
.progress-module-dot.locked { background: var(--text-tertiary); opacity: 0.4; }

.progress-module-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: var(--space-4);
    border-top: 1px solid var(--border-subtle);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.user-avatar {
    width: 36px; height: 36px;
    border-radius: var(--radius-full);
    background: var(--bg-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 2px solid var(--border-default);
}
.user-avatar svg, .user-avatar i { width: 18px; height: 18px; color: var(--text-secondary); }

.user-info {
    flex: 1;
    min-width: 0;
    transition: opacity var(--transition-fast);
}

.user-name {
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-role {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    display: block;
}

.btn-icon {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: var(--space-2);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}
.btn-icon:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}
.btn-icon svg, .btn-icon i { width: 18px; height: 18px; }

/* Mobile Header */
.mobile-header {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--header-height);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-4);
    z-index: var(--z-header);
    backdrop-filter: blur(20px);
}

.mobile-brand {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-family: var(--font-display);
    font-weight: var(--weight-bold);
    letter-spacing: 0.1em;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: var(--bg-overlay);
    z-index: calc(var(--z-sidebar) - 1);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left var(--transition-base);
    padding: var(--space-8);
}

.sidebar.collapsed ~ .main-content,
.sidebar.collapsed ~ * .main-content {
    margin-left: var(--sidebar-collapsed);
}

.page-view {
    max-width: var(--content-max-width);
    margin: 0 auto;
    animation: fadeIn 0.3s ease;
}

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

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.toast-container {
    position: fixed;
    top: var(--space-6);
    right: var(--space-6);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    z-index: var(--z-toast);
    pointer-events: none;
}

.toast {
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: var(--space-4) var(--space-5);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    min-width: 280px;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
    animation: toast-in 0.4s var(--transition-spring) forwards;
    pointer-events: auto;
    backdrop-filter: blur(20px);
}

.toast.removing {
    animation: toast-out 0.3s ease forwards;
}

.toast.toast-success { border-left: 3px solid var(--success-500); }
.toast.toast-error { border-left: 3px solid var(--error-500); }
.toast.toast-warning { border-left: 3px solid var(--warning-500); }
.toast.toast-info { border-left: 3px solid var(--info-500); }

.toast-icon {
    flex-shrink: 0;
    width: 20px; height: 20px;
}
.toast-success .toast-icon { color: var(--success-500); }
.toast-error .toast-icon { color: var(--error-500); }
.toast-warning .toast-icon { color: var(--warning-500); }
.toast-info .toast-icon { color: var(--info-500); }

.toast-message {
    flex: 1;
    font-size: var(--text-sm);
    color: var(--text-primary);
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 2px;
    display: flex;
}
.toast-close svg { width: 16px; height: 16px; }

@keyframes toast-in {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes toast-out {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(30px); }
}

/* ============================================
   MODAL
   ============================================ */
.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: var(--bg-overlay);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
    animation: fadeIn 0.2s ease;
    backdrop-filter: blur(4px);
}

.modal {
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 560px;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-xl);
    animation: modal-in 0.3s var(--transition-spring);
}

@keyframes modal-in {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-6);
    border-bottom: 1px solid var(--border-subtle);
}

.modal-header h3 {
    font-size: var(--text-xl);
}

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

.modal-footer {
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid var(--border-subtle);
    display: flex;
    gap: var(--space-3);
    justify-content: flex-end;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .auth-container {
        grid-template-columns: 1fr;
    }

    .auth-left {
        display: none;
    }

    .main-content {
        padding: var(--space-6);
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: var(--sidebar-width);
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .sidebar-overlay.active {
        display: block;
    }

    .mobile-header {
        display: flex;
    }

    .main-content {
        margin-left: 0;
        padding: calc(var(--header-height) + var(--space-4)) var(--space-4) var(--space-4);
    }

    .sidebar.collapsed ~ .main-content {
        margin-left: 0;
    }

    .toast-container {
        top: calc(var(--header-height) + var(--space-3));
        right: var(--space-3);
        left: var(--space-3);
    }

    .toast {
        min-width: unset;
        max-width: unset;
    }
}

@media (max-width: 480px) {
    :root {
        --space-8: 1.5rem;
    }

    h1 { font-size: var(--text-3xl); }
    h2 { font-size: var(--text-2xl); }
    h3 { font-size: var(--text-xl); }

    .auth-right {
        padding: var(--space-6);
    }

    .main-content {
        padding: calc(var(--header-height) + var(--space-3)) var(--space-3) var(--space-3);
    }
}
