/* ==============================================================================
   EduCycle - Design System & Global Stylesheet
   ============================================================================== */

/* Inter Variable Font - Self-Hosted (Offline PWA & GDPR Compliant) */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('/fonts/inter-variable-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('/fonts/inter-variable-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    
    /* Core & Civic-EdTech Semantic Palette */
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #eff6ff;
    --secondary: #6366f1;
    --secondary-hover: #4f46e5;
    --tertiary: #10b981;
    --success: #10b981;
    --success-light: #ecfdf5;
    --warning: #f59e0b;
    --danger: #ef4444;
    --danger-tint: #fef2f2;

    /* Material 3 & Classroom Surface Palette */
    --surface: #faf8ff;
    --surface-dim: #d2d9f4;
    --surface-bright: #faf8ff;
    --surface-container-lowest: #ffffff;
    --surface-container-low: #f2f3ff;
    --surface-container: #eaedff;
    --surface-container-high: #e2e7ff;
    --surface-container-highest: #dae2fd;
    --on-surface: #131b2e;
    --on-surface-variant: #434655;
    --inverse-surface: #283044;
    --inverse-on-surface: #eef0ff;
    --outline: #737686;
    --outline-variant: #c3c6d7;
    --surface-tint: #0053db;

    /* Base Neutrals & Classroom Projection */
    --bg-dark: #0f172a;
    --bg-surface: #1e293b;
    --bg-light: #faf8ff;
    --card-bg: #ffffff;
    --text-primary: #131b2e;
    --text-secondary: #434655;
    --text-muted: #737686;
    --border-color: #e2e8f0;
    --border-subtle: #e2e8f0;
    --border-dark: #334155;
    --scanner-surface: #1e293b;

    /* Four-Choice Semantic Colors & Colorblind Orientations */
    --option-a: #3b82f6;
    --option-a-tint: #eff6ff;
    --option-b: #10b981;
    --option-b-tint: #ecfdf5;
    --option-c: #f59e0b;
    --option-c-tint: #fef3c7;
    --option-d: #8b5cf6;
    --option-d-tint: #f5f3ff;

    /* Gamification & Telemetry Accents */
    --streak-flame: #f97316;
    --xp-gold: #eab308;

    /* Spacing System */
    --gutter: 1rem;
    --gutter-lg: 1.5rem;
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --margin-safe: 2.5rem;

    /* Border Radii (Level 2 Geometric System) */
    --radius-xs: 4px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Elevation & Physical-Plane Halos */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --elevation-0: none;
    --elevation-1: 0 1px 3px rgba(15, 23, 42, 0.06);
    --elevation-2: 0 10px 25px -5px rgba(15, 23, 42, 0.12);
    --aura-correct: 0 0 20px rgba(16, 185, 129, 0.35);
    --aura-streak: 0 0 20px rgba(249, 115, 22, 0.35);
    --aura-mazur: 0 0 24px rgba(99, 102, 241, 0.35);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.4) transparent;
}

/* Universal Modern Sleek Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.35);
    border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.6);
}

::-webkit-scrollbar-corner {
    background: transparent;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-light);
    color: var(--text-primary);
    line-height: 1.55;
    letter-spacing: -0.011em;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-sans);
    letter-spacing: -0.025em;
    color: var(--text-primary);
    font-weight: 700;
}

h1 {
    font-weight: 800;
    letter-spacing: -0.03em;
}

button, input, select, textarea {
    font-family: inherit;
    letter-spacing: inherit;
}

/* Modern Crisp Tabular Numerics */
.tabular-nums, .stat-value, .score, .timer, .pin-code, .stat-number, table {
    font-variant-numeric: tabular-nums;
}

/* ==============================================================================
   Active Pedagogy & Classroom Telemetry - Optical Typography Scale
   ============================================================================== */

/* Mathematical Formulations (KaTeX) Baseline Correction */
.katex {
    vertical-align: baseline !important;
    display: inline-block !important;
}

/* Modern Optical Hierarchy */
.display-hero {
    font-family: var(--font-sans);
    font-size: 48px;
    font-weight: 900;
    line-height: 56px;
    letter-spacing: -0.035em;
}

.headline-tbi-statement {
    font-family: var(--font-sans);
    font-size: 36px;
    font-weight: 800;
    line-height: 46px;
    letter-spacing: -0.025em;
}

.headline-lg {
    font-family: var(--font-sans);
    font-size: 28px;
    font-weight: 800;
    line-height: 36px;
    letter-spacing: -0.03em;
}

.headline-md {
    font-family: var(--font-sans);
    font-size: 22px;
    font-weight: 700;
    line-height: 30px;
    letter-spacing: -0.02em;
}

.headline-sm {
    font-family: var(--font-sans);
    font-size: 18px;
    font-weight: 700;
    line-height: 24px;
    letter-spacing: -0.015em;
}

.choice-text-tbi {
    font-family: var(--font-sans);
    font-size: 28px;
    font-weight: 700;
    line-height: 36px;
    letter-spacing: -0.015em;
}

.body-lg {
    font-family: var(--font-sans);
    font-size: 18px;
    font-weight: 500;
    line-height: 28px;
    letter-spacing: -0.01em;
}

.body-md {
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: 400;
    line-height: 22px;
    letter-spacing: -0.011em;
}

.body-sm {
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 400;
    line-height: 18px;
    letter-spacing: 0;
}

.label-prominent {
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 700;
    line-height: 18px;
    letter-spacing: 0.02em;
}

.label-micro {
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 800;
    line-height: 14px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

@media (max-width: 768px) {
    .display-hero {
        font-size: 30px;
        line-height: 38px;
        letter-spacing: -0.025em;
    }
    .headline-tbi-statement {
        font-size: 20px;
        line-height: 28px;
        letter-spacing: -0.015em;
    }
    .choice-text-tbi {
        font-size: 16px;
        line-height: 22px;
        letter-spacing: -0.01em;
    }
}

/* ==============================================================================
   Accessibility Utilities (WCAG 2.2 Level AA)
   ============================================================================== */

/* Skip to main content link */
.skip-link {
    position: absolute;
    top: -120px;
    left: 16px;
    background: #0f172a;
    color: #ffffff !important;
    padding: 12px 20px;
    font-weight: 800;
    font-size: 14px;
    border-radius: 0 0 10px 10px;
    z-index: 999999;
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    border: 2px solid #38bdf8;
    transition: top 0.15s ease-out;
}

.skip-link:focus,
.skip-link:focus-visible {
    top: 0;
    outline: 3px solid #38bdf8 !important;
    outline-offset: 2px !important;
}

/* Visually Hidden Utility for Screen Readers */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Global High-Contrast Focus Visible Ring */
:focus-visible {
    outline: 3px solid var(--primary, #2563eb) !important;
    outline-offset: 2px !important;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid #2563eb !important;
    outline-offset: 2px !important;
}

/* Respect Reduced Motion Preference */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .scan-laser-line {
        animation: none !important;
        display: none !important;
    }
}

/* Navbar */
.navbar {
    background-color: #ffffff;
    border-bottom: 1px solid var(--border-color);
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--primary);
}

.brand-text-container {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.brand-title {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.035em;
    color: var(--primary);
}

.brand-tagline {
    font-size: 10.5px;
    font-weight: 600;
    color: var(--text-secondary, #64748b);
    letter-spacing: -0.2px;
    white-space: nowrap;
}

@media (max-width: 640px) {
    .brand-title {
        font-size: 17px;
    }
    .brand-tagline {
        font-size: 9px;
    }
}

.brand-badge {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 20px;
    border-radius: var(--radius-md);
    font-size: 14.5px;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    text-decoration: none;
    min-height: 48px;
    box-sizing: border-box;
}

.btn-primary {
    background-color: var(--primary);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}

.btn-secondary {
    background-color: var(--surface-container-low, #f2f3ff);
    color: var(--on-surface, #131b2e);
    border: 1px solid var(--outline-variant, #c3c6d7);
}

.btn-secondary:hover {
    background-color: var(--surface-container, #eaedff);
    border-color: var(--primary, #2563eb);
}

.btn-success {
    background-color: var(--success);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.btn-success:hover {
    background-color: #059669;
    transform: translateY(-1px);
}

.btn-outline {
    background-color: transparent;
    border: 1.5px solid var(--border-color);
    color: var(--text-primary);
}

.btn-outline:hover {
    background-color: var(--surface-container-low, #f2f3ff);
    border-color: var(--primary);
    color: var(--primary);
}

.btn-sm {
    padding: 8px 14px;
    font-size: 13px;
    border-radius: var(--radius-sm);
    min-height: 44px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
    border-radius: var(--radius-lg);
    min-height: 48px;
}

/* Classroom Projector / TBI Extra-Tall Actions */
.btn-tbi-action {
    min-height: 56px;
    min-width: 48px;
    padding: 14px 28px;
    font-size: 18px;
    font-weight: 800;
    border-radius: var(--radius-md);
    letter-spacing: -0.015em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

/* Forms & Touch-Optimized Text Fields */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 6px;
    letter-spacing: 0.02em;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #cbd5e1;
    border-radius: var(--radius-md);
    font-size: 16px; /* Strict >=16px enforces zero automatic screen zoom on iOS */
    line-height: 1.5;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, outline 0.2s ease;
    background-color: #ffffff;
    color: var(--text-primary);
    min-height: 48px;
}

.form-control:focus,
.form-control:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Containers */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 24px;
}

/* Cards */
.card {
    background-color: var(--card-bg, #ffffff);
    border: 1.5px solid var(--border-color, #e2e8f0);
    border-radius: var(--radius-lg, 16px);
    padding: 24px;
    box-shadow: var(--elevation-1, 0 1px 3px rgba(15, 23, 42, 0.06));
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, border-color 0.2s ease;
}

.card:hover {
    box-shadow: var(--elevation-2, 0 10px 25px -5px rgba(15, 23, 42, 0.12));
    border-color: #bfdbfe;
}

/* Modal */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-backdrop.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 580px;
    padding: 28px;
    box-shadow: var(--shadow-lg);
    max-height: 88vh;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.4) transparent;
}

.modal-content::-webkit-scrollbar {
    width: 6px;
}

.modal-content::-webkit-scrollbar-track {
    background: transparent;
    margin: 12px 0;
}

.modal-content::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.4);
    border-radius: 999px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.7);
}

/* Mobile Responsive Modals & Standard Touch Targets */
@media (max-width: 768px) {
    body {
        overflow-x: hidden;
        width: 100%;
        max-width: 100vw;
        -webkit-tap-highlight-color: transparent;
    }

    .modal-backdrop {
        align-items: flex-end;
        padding: 0;
    }

    .modal-content {
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 24px 24px 0 0 !important;
        max-height: 90vh !important;
        padding: 16px 16px calc(24px + env(safe-area-inset-bottom, 0px)) 16px !important;
        margin: 0 !important;
        box-shadow: 0 -10px 25px rgba(0, 0, 0, 0.15) !important;
        animation: slideUpModal 0.28s cubic-bezier(0.16, 1, 0.3, 1);
        position: relative;
    }

    /* Native Bottom Sheet Drag Handle */
    .modal-content::before {
        content: '';
        display: block;
        width: 40px;
        height: 5px;
        background: #cbd5e1;
        border-radius: 999px;
        margin: 0 auto 16px auto;
    }

    @keyframes slideUpModal {
        from { transform: translateY(100%); }
        to { transform: translateY(0); }
    }

    .form-control, select.form-control, textarea.form-control, .admin-input {
        font-size: 16px !important; /* Prevents auto-zoom on iOS safari */
        padding: 12px 14px !important;
        min-height: 48px;
        border-radius: 12px !important;
    }

    .btn {
        min-height: 48px; /* Strict >= 48px tactile target per design system */
        border-radius: 12px;
        touch-action: manipulation;
    }

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

/* Responsive Table Wrapper (Prevents horizontal mobile break) */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 12px;
    border-radius: var(--radius-md);
    position: relative;
}

.table-responsive table {
    width: 100%;
    min-width: 580px;
}

/* Horizontal Scrollable Pills (Mobile App Bar style) */
.scroll-pills-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 4px 0 8px 0;
}

.scroll-pills-bar::-webkit-scrollbar {
    display: none;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 600;
}

.badge-blue, .badge-option-a {
    background-color: var(--option-a-tint, #eff6ff);
    color: var(--option-a, #3b82f6);
    border: 1px solid rgba(59, 130, 246, 0.25);
}

.badge-green, .badge-option-b {
    background-color: var(--option-b-tint, #ecfdf5);
    color: var(--option-b, #10b981);
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.badge-amber, .badge-option-c {
    background-color: var(--option-c-tint, #fef3c7);
    color: var(--option-c, #f59e0b);
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.badge-violet, .badge-option-d {
    background-color: var(--option-d-tint, #f5f3ff);
    color: var(--option-d, #8b5cf6);
    border: 1px solid rgba(139, 92, 246, 0.25);
}

/* ==============================================================================
   KaTeX Math Display & Fluid Inline Layout
   Prevents disruptive line-breaks within statements, questions, and explanations
   ============================================================================== */
.katex-display {
    display: inline-block !important;
    margin: 0 0.25em !important;
    text-align: inherit !important;
    vertical-align: baseline !important;
}

.katex-display > .katex {
    display: inline-block !important;
    text-align: inherit !important;
    white-space: nowrap !important;
}

/* Seamless baseline alignment and fluid inline flow for questions and explanations */
.q-statement,
#statementText,
.statement-card,
.choice-content-wrap,
.choice-card,
.choice-bar-box,
#explanationText,
.pedagogical-action-box,
.explanation-container,
.question-card,
.dist-choice-text,
.exercise-statement {
    line-height: 1.55;
}

.q-statement .katex,
.q-statement .katex-display,
#statementText .katex,
#statementText .katex-display,
.statement-card .katex,
.statement-card .katex-display,
.choice-content-wrap .katex,
.choice-content-wrap .katex-display,
.choice-card .katex,
.choice-card .katex-display,
.choice-bar-box .katex,
.choice-bar-box .katex-display,
#explanationText .katex,
#explanationText .katex-display,
.pedagogical-action-box .katex,
.pedagogical-action-box .katex-display,
.explanation-container .katex,
.explanation-container .katex-display {
    display: inline-block !important;
    margin: 0 0.15em !important;
    vertical-align: -0.05em !important;
    white-space: normal !important;
}

/* Gradient Text */
.gradient-text {
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ==============================================================================
   Footer Styles
   ============================================================================== */
.site-footer {
    background: #0f172a;
    color: #94a3b8;
    border-top: 1px solid #1e293b;
    margin-top: 60px;
    padding: 60px 0 30px;
    font-size: 14px;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 48px;
    margin-bottom: 48px;
}

@media (max-width: 900px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 32px;
    }
}

@media (max-width: 600px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }
}

.footer-col-title {
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 18px;
    letter-spacing: 0.3px;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-links a {
    color: #94a3b8;
    text-decoration: none;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.footer-links a:hover {
    color: #38bdf8;
    transform: translateX(3px);
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ffffff;
    font-size: 22px;
    font-weight: 800;
    text-decoration: none;
}

.footer-desc {
    color: #64748b;
    font-size: 13.5px;
    line-height: 1.6;
    max-width: 340px;
}

.status-badge-live {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(16, 185, 129, 0.1);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.25);
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    width: fit-content;
}

.status-dot-pulse {
    width: 7px;
    height: 7px;
    background: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 8px #10b981;
}

.footer-bottom {
    border-top: 1px solid #1e293b;
    padding-top: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    color: #64748b;
    font-size: 13px;
}

.footer-legal-links {
    display: flex;
    gap: 20px;
}

.footer-legal-links a {
    color: #64748b;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-legal-links a:hover {
    color: #94a3b8;
}

/* ==========================================================================
   Mobile Drawer & Header Actions
   ========================================================================== */
.mobile-header-actions {
    display: none;
    align-items: center;
    gap: 8px;
}

.hamburger-btn {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    width: 38px;
    height: 38px;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    padding: 0;
    transition: background 0.15s ease;
}

.hamburger-btn:active {
    background: #e2e8f0;
}

.hamburger-line {
    width: 18px;
    height: 2px;
    background-color: #0f172a;
    border-radius: 2px;
}

/* Mobile Drawer Overlay */
.mobile-drawer {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 2000;
    align-items: flex-end;
    padding: 0;
}

.mobile-drawer.active {
    display: flex !important;
}

.mobile-drawer-content {
    background: white;
    width: 100%;
    border-radius: 24px 24px 0 0;
    padding: 20px 20px 36px 20px;
    max-height: 85vh;
    overflow-y: auto;
    animation: slideUpDrawer 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.15);
}

@keyframes slideUpDrawer {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.mobile-drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.mobile-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: #f8fafc;
    border-radius: 12px;
    color: #1e293b;
    text-decoration: none;
    font-size: 14.5px;
    font-weight: 600;
    transition: background 0.15s ease;
    cursor: pointer;
}

.mobile-menu-item:active {
    background: #e2e8f0;
}

@media (max-width: 768px) {
    .desktop-nav {
        display: none !important;
    }

    .mobile-header-actions {
        display: flex !important;
    }

    .navbar {
        padding: 0 14px !important;
        height: 58px !important;
    }
}

/* ==========================================================================
   Bottom CTA Banner
   ========================================================================== */
.cta-bottom-banner {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    border: 1px solid #334155;
    border-radius: 28px;
    padding: 56px 32px;
    text-align: center;
    color: #ffffff;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.25);
    margin: 48px auto 64px;
    max-width: 1080px;
    position: relative;
    overflow: hidden;
}

.cta-bottom-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 300px;
    background: radial-gradient(ellipse at center, rgba(37, 99, 235, 0.25) 0%, rgba(37, 99, 235, 0) 70%);
    pointer-events: none;
}

.cta-bottom-banner h2 {
    font-size: 34px;
    font-weight: 900;
    letter-spacing: -0.5px;
    color: #ffffff;
    margin-bottom: 14px;
    line-height: 1.2;
}

.cta-bottom-banner p {
    color: #94a3b8;
    font-size: 17px;
    line-height: 1.6;
    max-width: 640px;
    margin: 0 auto 32px;
}

@media (max-width: 768px) {
    .cta-bottom-banner {
        padding: 36px 20px !important;
        border-radius: 20px !important;
        margin: 32px auto 48px !important;
    }

    .cta-bottom-banner h2 {
        font-size: 24px !important;
    }

    .cta-bottom-banner p {
        font-size: 14.5px !important;
        margin-bottom: 24px !important;
    }
}

/* ==========================================================================
   Community Chat / Salon des Profs Styles
   ========================================================================== */
.community-chat-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 0;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    box-shadow: var(--shadow-sm);
    height: 720px;
    max-height: 80vh;
    overflow: hidden;
}

@media (max-width: 860px) {
    .community-chat-layout {
        grid-template-columns: 1fr;
        height: auto;
        max-height: none;
    }
}

.chat-channels-sidebar {
    background: #f8fafc;
    border-right: 1px solid var(--border-color);
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.chat-channel-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.chat-channel-btn:hover {
    background: #f1f5f9;
}

.chat-channel-btn.active {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.chat-channel-btn .channel-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.chat-channel-btn .channel-name {
    font-size: 13.5px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.2;
}

.chat-channel-btn.active .channel-name {
    color: #2563eb;
}

.chat-channel-btn .channel-desc {
    font-size: 11px;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.chat-stream-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #ffffff;
    overflow: hidden;
}

.chat-stream-header {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
}

.chat-messages-stream {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: #fafafa;
}

.chat-msg-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 14px 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 90%;
    animation: fadeInMsg 0.2s ease;
}

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

.chat-msg-card.mine {
    align-self: flex-end;
    background: #eff6ff;
    border-color: #bfdbfe;
}

.chat-msg-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.chat-msg-author-badge {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-avatar-circle {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #2563eb;
    color: white;
    font-size: 11.5px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
}

.chat-avatar-circle.admin {
    background: linear-gradient(135deg, #7c3aed, #4f46e5);
}

.chat-msg-content {
    font-size: 13.5px;
    color: #1e293b;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

.chat-attached-set-card {
    background: #ffffff;
    border: 1px solid #93c5fd;
    border-radius: 10px;
    padding: 10px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 4px;
}

.chat-msg-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
}

.chat-like-btn {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 11.5px;
    font-weight: 700;
    color: #64748b;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.15s ease;
}

.chat-like-btn:hover {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #dc2626;
}

.chat-like-btn.liked {
    background: #fef2f2;
    border-color: #f87171;
    color: #dc2626;
}

.chat-composer-box {
    padding: 14px 18px;
    border-top: 1px solid var(--border-color);
    background: #ffffff;
}

/* ==============================================================================
   Active Pedagogy & Classroom Telemetry - Dedicated Components
   ============================================================================== */

/* 1. Classroom Choice Cards (A, B, C, D) */
.choice-card-telemetry {
    min-height: 96px;
    background: #ffffff;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--elevation-1);
    display: flex;
    align-items: center;
    padding: 16px 20px;
    gap: 16px;
    position: relative;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.choice-badge-indicator {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 800;
    gap: 4px;
    flex-shrink: 0;
}

.choice-badge-indicator.option-a {
    background: var(--option-a-tint);
    color: var(--option-a);
    border: 1.5px solid rgba(59, 130, 246, 0.3);
}

.choice-badge-indicator.option-b {
    background: var(--option-b-tint);
    color: var(--option-b);
    border: 1.5px solid rgba(16, 185, 129, 0.3);
}

.choice-badge-indicator.option-c {
    background: var(--option-c-tint);
    color: var(--option-c);
    border: 1.5px solid rgba(245, 158, 11, 0.3);
}

.choice-badge-indicator.option-d {
    background: var(--option-d-tint);
    color: var(--option-d);
    border: 1.5px solid rgba(139, 92, 246, 0.3);
}

/* Choice States */
.choice-card-telemetry.revealed-correct {
    background: var(--success-light) !important;
    border: 3px solid var(--success) !important;
    box-shadow: var(--aura-correct) !important;
}

.choice-card-telemetry.revealed-wrong {
    opacity: 0.55;
    border-color: #94a3b8 !important;
}

.choice-card-telemetry.mazur-debate {
    border: 2px dashed var(--secondary) !important;
    box-shadow: var(--aura-mazur);
    animation: pulseMazur 2s ease-in-out infinite;
}

@keyframes pulseMazur {
    0%, 100% {
        box-shadow: 0 0 12px rgba(99, 102, 241, 0.25);
    }
    50% {
        box-shadow: 0 0 24px rgba(99, 102, 241, 0.55);
    }
}

/* 2. Streak & Gamification Gauges */
.streak-flame-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    background: #fef3c7;
    color: var(--streak-flame);
    font-weight: 800;
    font-size: 14px;
    box-shadow: var(--aura-streak);
    border: 1px solid rgba(249, 115, 22, 0.25);
    font-variant-numeric: tabular-nums;
}

.xp-tier-meter {
    width: 100%;
    height: 12px;
    border-radius: var(--radius-full);
    background: #e2e8f0;
    overflow: hidden;
    position: relative;
}

.xp-tier-meter-bar {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #6366f1);
    border-radius: var(--radius-full);
    transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}




