/* ==========================================================================
   QI METRIX 2026 - Ultra-Modern Dark SaaS Design System (Linear / Vercel Aesthetic)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600;700;800&family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
    /* Color Palette - Tactile Deep Dark */
    --bg-main: #090a0f;
    --bg-card: rgba(17, 20, 29, 0.65);
    --bg-card-solid: #11131c;
    --bg-card-hover: rgba(26, 30, 44, 0.85);
    
    /* 1px Micro-borders */
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.22);
    --border-active: rgba(6, 182, 212, 0.5);

    /* Neon Accents */
    --accent-cyan: #06b6d4;
    --accent-teal: #00f2fe;
    --accent-violet: #6366f1;
    --accent-purple: #8b5cf6;
    --accent-magenta: #f43f5e;
    --accent-gold: #fbbf24;
    --accent-green: #10b981;

    /* Text Colors */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-dark: #0f172a;

    /* Typography */
    --font-heading: 'Outfit', 'Geist', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Radii */
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-full: 9999px;

    /* Shadows & Effects */
    --glow-cyan: 0 0 35px -5px rgba(6, 182, 212, 0.35);
    --glow-violet: 0 0 35px -5px rgba(99, 102, 241, 0.35);
    --shadow-card: 0 20px 40px -15px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    --glass-blur: blur(20px);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

::selection {
    background: rgba(6, 182, 212, 0.3);
    color: #ffffff;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #090a0f;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-body);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Backlight Glow Spotlights */
body::before {
    content: '';
    position: fixed;
    top: -250px;
    left: 50%;
    transform: translateX(-50%);
    width: 900px;
    height: 600px;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.14) 0%, rgba(99, 102, 241, 0.08) 45%, rgba(0, 0, 0, 0) 70%);
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: '';
    position: fixed;
    bottom: -200px;
    right: -100px;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.12) 0%, rgba(244, 63, 94, 0.05) 50%, rgba(0, 0, 0, 0) 70%);
    pointer-events: none;
    z-index: 0;
}

/* Subtle Grid Background Pattern */
.bg-grid-overlay {
    position: fixed;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
    z-index: 0;
    opacity: 0.6;
}

/* Header Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border-color);
    background: rgba(9, 10, 15, 0.75);
    backdrop-filter: var(--glass-blur);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-logo {
    font-size: 1.6rem;
    filter: drop-shadow(0 0 8px rgba(6, 182, 212, 0.5));
    transition: transform 0.3s ease;
}

.nav-brand:hover .brand-logo {
    transform: rotate(10deg) scale(1.1);
}

.brand-name {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    background: linear-gradient(135deg, #ffffff 0%, #a5f3fc 60%, var(--accent-cyan) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-tag {
    font-size: 0.72rem;
    font-family: var(--font-mono);
    font-weight: 600;
    background: rgba(6, 182, 212, 0.1);
    color: var(--accent-cyan);
    padding: 0.2rem 0.65rem;
    border-radius: var(--radius-full);
    border: 1px solid rgba(6, 182, 212, 0.3);
    letter-spacing: 0.05em;
    box-shadow: 0 0 12px rgba(6, 182, 212, 0.2);
}

.btn-icon {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    backdrop-filter: var(--glass-blur);
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--border-hover);
    transform: scale(1.08);
}

/* Container Principal */
.main-container {
    flex: 1;
    max-width: 1040px;
    width: 100%;
    margin: 2.5rem auto;
    padding: 0 1.5rem;
    position: relative;
    z-index: 1;
}

/* Écrans (Screens) */
.screen {
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.45s cubic-bezier(0.16, 1, 0.3, 1), transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.screen.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* Écran d'accueil - Design Bento Grid Linear/Vercel */
.welcome-hero {
    text-align: center;
    margin-bottom: 3rem;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1.1rem;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #c084fc;
    border-radius: var(--radius-full);
    font-size: 0.82rem;
    font-family: var(--font-mono);
    font-weight: 600;
    letter-spacing: 0.03em;
    margin-bottom: 1.5rem;
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.15);
}

.welcome-hero h1 {
    font-family: var(--font-heading);
    font-size: 3.2rem;
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: -0.02em;
    margin-bottom: 1.2rem;
    color: #ffffff;
}

.text-gradient {
    background: linear-gradient(135deg, #00f2fe 0%, var(--accent-cyan) 40%, var(--accent-violet) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 30px rgba(6, 182, 212, 0.3));
}

.hero-subtitle {
    font-size: 1.12rem;
    color: var(--text-secondary);
    max-width: 680px;
    margin: 0 auto;
    line-height: 1.65;
}

/* Features Grid - Style Bento Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-bottom: 3rem;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 2rem 1.6rem;
    border-radius: var(--radius-lg);
    backdrop-filter: var(--glass-blur);
    box-shadow: var(--shadow-card);
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    border-color: var(--border-hover);
    box-shadow: 0 25px 50px -15px rgba(0, 0, 0, 0.8), 0 0 30px rgba(6, 182, 212, 0.15);
}

.feature-card:hover::before {
    opacity: 1;
}

.feature-icon {
    font-size: 2.2rem;
    margin-bottom: 1.2rem;
    display: inline-block;
    filter: drop-shadow(0 0 10px rgba(6, 182, 212, 0.4));
    transition: transform 0.3s ease;
}

.feature-card:hover .feature-icon {
    transform: scale(1.12);
}

.feature-card h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.6rem;
    color: #ffffff;
}

.feature-card p {
    font-size: 0.92rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.action-bar {
    text-align: center;
}

/* Buttons System */
.btn-primary {
    background: linear-gradient(135deg, var(--accent-cyan) 0%, var(--accent-violet) 100%);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 1.1rem 2.8rem;
    font-family: var(--font-heading);
    font-size: 1.08rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    border-radius: var(--radius-full);
    cursor: pointer;
    box-shadow: 0 4px 25px rgba(6, 182, 212, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.btn-primary:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 35px rgba(6, 182, 212, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.4);
    border-color: rgba(255, 255, 255, 0.4);
}

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

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 0.9rem 2rem;
    font-family: var(--font-heading);
    font-size: 0.98rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    cursor: pointer;
    backdrop-filter: var(--glass-blur);
    transition: all 0.25s ease;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

/* Card Box containers */
.card-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    backdrop-filter: var(--glass-blur);
    box-shadow: var(--shadow-card);
}

.card-box h2 {
    font-family: var(--font-heading);
    font-size: 1.9rem;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 0.5rem;
}

.card-box p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 0.98rem;
}

/* Form Groups & Inputs */
.form-group {
    margin-bottom: 2rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.input-styled {
    width: 100%;
    max-width: 220px;
    padding: 0.85rem 1.25rem;
    background: var(--bg-card-solid);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: #ffffff;
    font-size: 1.15rem;
    font-family: var(--font-mono);
    font-weight: 600;
    transition: all 0.25s ease;
}

.input-styled:focus {
    outline: none;
    border-color: var(--accent-cyan);
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.25);
}

/* Mode Selector Grid */
.mode-selector-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.mode-card {
    background: var(--bg-card-solid);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.6rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

.mode-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-3px);
}

.mode-card.selected {
    border-color: var(--accent-cyan);
    background: rgba(6, 182, 212, 0.08);
    box-shadow: 0 0 30px rgba(6, 182, 212, 0.25), inset 0 1px 0 rgba(6, 182, 212, 0.3);
}

.mode-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
}

.mode-title {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
    color: #ffffff;
}

.mode-time {
    font-size: 0.8rem;
    font-family: var(--font-mono);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
}

/* Écran Quiz */
.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.8rem;
    gap: 1.5rem;
}

.progress-container {
    flex: 1;
}

.progress-text {
    font-size: 0.85rem;
    font-family: var(--font-mono);
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.progress-bar-bg {
    height: 8px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-full);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-cyan), var(--accent-violet));
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.6);
    transition: width 0.35s ease;
}

.domain-badge {
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--accent-cyan);
    background: rgba(6, 182, 212, 0.1);
    color: var(--accent-cyan);
    font-size: 0.88rem;
    font-weight: 600;
    backdrop-filter: var(--glass-blur);
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.2);
}

.timer-box {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--bg-card-solid);
    border: 1px solid var(--border-color);
    padding: 0.55rem 1.2rem;
    border-radius: var(--radius-full);
}

.timer-display {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--accent-cyan);
}

.timer-display.urgent {
    color: var(--accent-magenta);
    animation: pulseGlow 0.8s infinite alternate;
}

@keyframes pulseGlow {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(1.1); opacity: 1; text-shadow: 0 0 12px rgba(244, 63, 94, 0.8); }
}

.quiz-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    backdrop-filter: var(--glass-blur);
    box-shadow: var(--shadow-card);
}

.question-title {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 2rem;
    line-height: 1.45;
}

.visual-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 2.2rem;
    padding: 1.5rem;
    background: rgba(11, 13, 20, 0.9);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.6);
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.1rem;
}

.option-card {
    background: var(--bg-card-solid);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.1rem 1.3rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    color: var(--text-primary);
    font-family: var(--font-body);
}

.option-card:hover {
    border-color: var(--accent-cyan);
    background: rgba(6, 182, 212, 0.08);
    transform: translateY(-3px);
    box-shadow: 0 10px 25px -10px rgba(6, 182, 212, 0.3);
}

.option-index {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--accent-cyan);
    flex-shrink: 0;
}

.option-text {
    font-size: 1rem;
    line-height: 1.4;
    text-align: left;
    color: var(--text-primary);
}

/* Présentation séquentielle des empans (Gwm) : un stimulus à la fois */
.span-box {
    text-align: center;
    padding: 1.5rem;
    min-width: 260px;
}

.span-label {
    display: block;
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 1.2rem;
    letter-spacing: 0.04em;
}

.span-stage {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 110px;
}

.span-card {
    width: 96px;
    height: 110px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 3.4rem;
    font-weight: 800;
    color: #ffffff;
    transition: background 0.12s ease, border-color 0.12s ease;
}

.span-card.span-live {
    background: rgba(99, 102, 241, 0.16);
    border: 2px solid var(--accent-violet);
    box-shadow: 0 0 34px rgba(99, 102, 241, 0.45);
}

.span-card.span-blank {
    background: rgba(255, 255, 255, 0.02);
    border: 2px dashed var(--border-color);
    box-shadow: none;
}

.span-card.span-done {
    background: rgba(16, 185, 129, 0.14);
    border: 2px solid var(--accent-green);
    color: var(--accent-green);
    font-size: 2.6rem;
}

/* Loader Computing Screen */
.computing-box {
    text-align: center;
    padding: 5rem 2rem;
}

.loader-spinner {
    width: 75px;
    height: 75px;
    border: 3px solid rgba(255, 255, 255, 0.05);
    border-top: 3px solid var(--accent-cyan);
    border-right: 3px solid var(--accent-violet);
    border-radius: 50%;
    animation: spin 1s cubic-bezier(0.68, -0.55, 0.27, 1.55) infinite;
    margin: 0 auto 2.5rem;
    box-shadow: 0 0 30px rgba(6, 182, 212, 0.3);
}

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

/* Dashboard des Résultats - Bento Grid & High End Hero */
.results-hero {
    background: linear-gradient(135deg, rgba(17, 20, 32, 0.95) 0%, rgba(25, 16, 45, 0.95) 100%);
    border: 1px solid var(--border-hover);
    border-radius: var(--radius-lg);
    padding: 3rem 2.5rem;
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 25px 50px -15px rgba(0, 0, 0, 0.8), 0 0 40px rgba(6, 182, 212, 0.15);
}

.results-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: 50%;
    transform: translateX(-50%);
    width: 500px;
    height: 300px;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.25) 0%, rgba(0, 0, 0, 0) 70%);
    pointer-events: none;
}

.hero-title-small {
    font-size: 0.88rem;
    font-family: var(--font-mono);
    letter-spacing: 0.15em;
    color: var(--accent-cyan);
    text-transform: uppercase;
    margin-bottom: 0.75rem;
}

.fsiq-display {
    font-family: var(--font-heading);
    font-size: 6rem;
    font-weight: 800;
    line-height: 1;
    background: linear-gradient(135deg, #ffffff 0%, #a5f3fc 40%, var(--accent-cyan) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.75rem;
    filter: drop-shadow(0 0 35px rgba(6, 182, 212, 0.4));
}

.classification-badge {
    display: inline-block;
    padding: 0.55rem 1.8rem;
    border-radius: var(--radius-full);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.15rem;
    margin-bottom: 1.8rem;
    letter-spacing: 0.02em;
    backdrop-filter: var(--glass-blur);
}

/* Libellés WAIS-5 : extremely-high / very-high / high-average / average /
   low-average / very-low / extremely-low */
.classification-badge.level-extremely-high {
    background: rgba(251, 191, 36, 0.12);
    color: var(--accent-gold);
    border: 1px solid var(--accent-gold);
    box-shadow: 0 0 25px rgba(251, 191, 36, 0.25);
}

.classification-badge.level-very-high, .classification-badge.level-high-average {
    background: rgba(6, 182, 212, 0.12);
    color: var(--accent-teal);
    border: 1px solid var(--accent-cyan);
    box-shadow: 0 0 25px rgba(6, 182, 212, 0.25);
}

.classification-badge.level-average {
    background: rgba(99, 102, 241, 0.12);
    color: #c084fc;
    border: 1px solid var(--accent-violet);
    box-shadow: 0 0 25px rgba(99, 102, 241, 0.25);
}

/* Bandes basses : rendu sobre et non alarmiste, sans halo coloré. */
.classification-badge.level-low-average,
.classification-badge.level-very-low,
.classification-badge.level-extremely-low {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.fsiq-stats-row {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.stat-item {
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.8rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.35rem;
}

.stat-value {
    font-weight: 700;
    font-family: var(--font-mono);
    font-size: 1.2rem;
    color: #ffffff;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 1.45rem;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.gauss-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2.2rem;
    margin-bottom: 2rem;
    backdrop-filter: var(--glass-blur);
    box-shadow: var(--shadow-card);
}

/* Grille des domaines CHC (Style Bento Cards) */
.chc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2.5rem;
}

.chc-card {
    background: var(--bg-card-solid);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.6rem;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-card);
}

.chc-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-3px);
    box-shadow: 0 15px 30px -10px rgba(0, 0, 0, 0.8), 0 0 20px rgba(6, 182, 212, 0.1);
}

.chc-card-header {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 1.2rem;
}

.chc-icon {
    font-size: 1.6rem;
    filter: drop-shadow(0 0 8px rgba(6, 182, 212, 0.4));
}

.chc-titles {
    flex: 1;
}

.chc-name {
    display: block;
    font-weight: 700;
    font-size: 1rem;
    color: #ffffff;
}

.chc-acronym {
    font-size: 0.78rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
}

.chc-score-badge {
    padding: 0.35rem 0.9rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-weight: 800;
    font-size: 1.15rem;
    color: #ffffff;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
}

.chc-progress-bar {
    height: 7px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.chc-progress-fill {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width 0.5s ease;
}

.chc-card-footer {
    display: flex;
    justify-content: space-between;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

/* Neuro Analysis Card */
.neuro-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2.2rem;
    margin-bottom: 2rem;
    backdrop-filter: var(--glass-blur);
    box-shadow: var(--shadow-card);
}

.neuro-p {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 1.2rem;
}

.heterogeneity-note {
    background: rgba(6, 182, 212, 0.08);
    border-left: 4px solid var(--accent-cyan);
    padding: 1.2rem 1.4rem;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.8rem;
    color: var(--text-primary);
}

.results-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2.5rem;
    padding-top: 1.8rem;
    border-top: 1px solid var(--border-color);
}

.history-section {
    margin-top: 3rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2.2rem;
    backdrop-filter: var(--glass-blur);
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    margin-top: 1.2rem;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.4rem;
    background: var(--bg-card-solid);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    transition: border-color 0.2s ease;
}

.history-item:hover {
    border-color: var(--border-hover);
}

.history-score {
    font-weight: 800;
    font-family: var(--font-mono);
    color: var(--accent-cyan);
    font-size: 1.1rem;
}

/* ==========================================================================
   STYLE D'IMPRESSION ET EXPORT PDF CLINIQUE
   ========================================================================== */
/* ==========================================================================
   Navigation, énoncé oral, saisie libre, traçabilité du score
   ========================================================================== */

.nav-link {
    background: none;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0.4rem 0.6rem;
    border-radius: var(--radius-sm);
    transition: color 0.25s ease, background 0.25s ease;
}

.nav-link:hover {
    color: var(--accent-cyan);
    background: rgba(6, 182, 212, 0.08);
}

.nav-icon-btn {
    font-size: 1.15rem;
    line-height: 1;
}

.mode-desc {
    font-size: 0.88rem;
    color: var(--text-secondary);
}

/* Liens de l'écran Références (remplacent des styles inline qui pointaient
   vers une variable --primary jamais définie). */
.ref-link {
    color: var(--accent-cyan);
    text-decoration: none;
    border-bottom: 1px solid rgba(6, 182, 212, 0.35);
    transition: color 0.2s ease, border-color 0.2s ease;
}

.ref-link:hover {
    color: var(--accent-teal);
    border-bottom-color: var(--accent-teal);
}

.speech-note {
    margin-top: 1.2rem;
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}

/* Indicateur d'énoncé oral */
.oral-indicator {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    margin: 0 auto 1.5rem;
    padding: 0.9rem 1.4rem;
    max-width: 460px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--accent-cyan);
    background: rgba(6, 182, 212, 0.08);
    border: 1px solid var(--border-active);
    border-radius: var(--radius-full);
}

.oral-indicator.done {
    color: var(--accent-green);
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.4);
}

.oral-pulse {
    font-size: 1.2rem;
    animation: oral-pulse 1.1s ease-in-out infinite;
}

@keyframes oral-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.45; transform: scale(1.18); }
}

/* Saisie libre (empans de chiffres / séquences lettres-chiffres) */
.text-answer-box {
    display: none;
    flex-direction: column;
    gap: 0.7rem;
    max-width: 520px;
    margin: 0 auto;
}

.text-answer-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: left;
}

.text-answer-row {
    display: flex;
    gap: 0.8rem;
    align-items: stretch;
}

.text-answer-input {
    flex: 1;
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-align: center;
}

/* Le letter-spacing du champ rendait le texte indicatif illisible/tronqué. */
.text-answer-input::placeholder {
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 400;
    letter-spacing: normal;
    color: var(--text-muted);
}

.text-answer-hint {
    font-size: 0.82rem;
    color: var(--text-muted);
    text-align: left;
}

/* Traçabilité du QIT sous le score principal */
.fsiq-formula {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-top: 1.6rem;
    padding: 1rem 1.2rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    text-align: left;
}

.formula-line {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    line-height: 1.5;
    color: var(--text-secondary);
}

.formula-line.warn {
    font-family: var(--font-body);
    color: var(--accent-gold);
}

.chc-card-detail {
    margin-top: 0.6rem;
    font-size: 0.78rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

@media print {
    body {
        background: #ffffff !important;
        color: #000000 !important;
    }
    .fsiq-formula {
        background: #ffffff !important;
        border: 1px solid #cccccc !important;
        page-break-inside: avoid;
    }
    .formula-line, .formula-line.warn, .chc-card-detail {
        color: #444444 !important;
    }
    body::before, body::after, .bg-grid-overlay {
        display: none !important;
    }
    .navbar, .btn-primary, .btn-secondary, .results-footer, .history-section {
        display: none !important;
    }
    .main-container {
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    .results-hero, .gauss-card, .chc-card, .neuro-card {
        background: #ffffff !important;
        color: #000000 !important;
        border: 1px solid #cccccc !important;
        box-shadow: none !important;
        page-break-inside: avoid;
    }
    .fsiq-display {
        -webkit-text-fill-color: #000000 !important;
        color: #000000 !important;
    }
    .text-secondary, .stat-label, .chc-acronym {
        color: #555555 !important;
    }
}

/* Responsive Mobile */
@media (max-width: 768px) {
    .features-grid {
        grid-template-columns: 1fr;
    }
    .welcome-hero h1 { font-size: 2.2rem; }
    .fsiq-display { font-size: 4rem; }
    .fsiq-stats-row { flex-direction: column; gap: 1rem; }
    .results-footer { flex-direction: column; gap: 1.2rem; align-items: stretch; }
    .results-footer div { text-align: center; }
}

/* Pied de page global */
.app-footer {
    background: rgba(9, 10, 15, 0.9);
    color: var(--text-primary);
    border-top: 1px solid var(--border-color);
    padding: 3.5rem 1.5rem;
    margin-top: 5rem;
    text-align: center;
    position: relative;
    z-index: 1;
    backdrop-filter: var(--glass-blur);
}

.footer-content {
    max-width: 900px;
    margin: 0 auto;
}

.disclaimer {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.65;
    margin-bottom: 2rem;
    background: rgba(255, 255, 255, 0.03);
    padding: 1.4rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.credits {
    font-size: 0.95rem;
    margin-bottom: 0.8rem;
    color: var(--text-primary);
}

.links {
    font-size: 0.9rem;
}

.links a {
    color: var(--accent-cyan);
    text-decoration: none;
    transition: color 0.2s ease;
}

.links a:hover {
    color: #ffffff;
    text-decoration: underline;
}

@media print {
    .app-footer {
        display: none !important;
    }
}
