:root {
    --bg-primary: #0a0e17;
    --bg-secondary: #111827;
    --bg-card: #1a2332;
    --bg-card-hover: #1f2b3d;
    --bg-nav: rgba(10, 14, 23, 0.95);
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent: #64748b;
    --accent-dim: #475569;
    --accent-glow: rgba(100, 116, 139, 0.18);
    --accent-blue: #3b82f6;
    --accent-purple: #8b5cf6;
    --accent-red: #ef4444;
    --accent-orange: #f59e0b;
    --accent-cyan: #06b6d4;
    --accent-green: #22c55e;
    --border: #1e293b;
    --border-light: #334155;
    --gradient-start: #64748b;
    --gradient-end: #94a3b8;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    --radius: 12px;
    --radius-sm: 10px;
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--gradient-end); }

code {
    font-family: 'JetBrains Mono', monospace;
    background: rgba(100, 116, 139, 0.15);
    color: var(--gradient-end);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85em;
}

pre {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 20px;
    overflow-x: auto;
    margin: 16px 0;
}

pre code { background: none; padding: 0; color: var(--text-primary); font-size: 0.85em; line-height: 1.8; }

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

/* ===== NAVBAR ===== */
.navbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
    background: var(--bg-nav); backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border); transition: var(--transition);
}
.navbar.scrolled { box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5); }
.nav-container {
    max-width: 1400px; margin: 0 auto; padding: 0 24px;
    display: flex; align-items: center; justify-content: space-between;
    height: 70px; gap: 12px;
}
.nav-back {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 38px; height: 38px; border: 1px solid var(--border-light);
    border-radius: 8px; color: var(--text-primary); font-size: 1.2em; padding: 0 10px;
}
.nav-back:hover { border-color: var(--accent); color: var(--gradient-end); }

/* ===== HARMONISATION VISUELLE HORIZON 5 (audit septembre 2026) ===== */
/* Bloc additif : uniformise sans changer l'accent de la formation. */
/* Boutons : paddings et radius unifies */
.btn { padding: 14px 32px; border-radius: 10px; gap: 8px; text-decoration: none; }
/* Cartes : radius 12px */
.course-card, .module, .modal, .memo-card, .install-card, .quiz-q, .flash-card, .schema-card, .first-steps-box, .coach-zone { border-radius: 12px; }
/* Transitions unifiees a 0.25s */
.btn, .course-card, .nav-link, .dropdown-content a, .nav-back, .quiz-opt, .q-opt, .qs-chip { transition: all 0.25s ease; }
/* Focus clavier visible */
:focus-visible { outline: 2px solid var(--gradient-end); outline-offset: 3px; border-radius: 4px; }
/* Details et summary : curseur pointeur et espacement */
details summary { cursor: pointer; margin: 4px 0; }
/* Composants communs */
.course-section { margin-top: 24px; }
.course-section h4 { margin-bottom: 10px; font-size: 1.1rem; }
.course-section p { margin-bottom: 12px; font-size: 0.95rem; color: var(--text-secondary); }
.course-section ul { margin: 0 0 12px 20px; }
.course-section ul li { margin-bottom: 6px; font-size: 0.93rem; }
.course-code { font-family: 'JetBrains Mono', monospace; font-size: 0.85em; padding: 2px 6px; border-radius: 4px; }
.course-note { border-radius: 8px; padding: 14px 16px; margin: 14px 0; font-size: 0.9rem; }
/* Contraste : l'accent brut (#64748b, 4.06:1) est insuffisant en texte courant, */
/* les liens utilisent --gradient-end (#94a3b8, 7.53:1), les boutons gardent le degrade. */
a { color: var(--gradient-end); }
.disclaimer { margin-top: 8px; font-size: 0.85em; color: var(--text-secondary); line-height: 1.6; }
/* Tableaux : defilement horizontal sur petit ecran */
.table-responsive { overflow-x: auto; }
/* Responsive minimal : hamburger, grilles en 1 colonne, tableaux scrollables */
@media (max-width: 768px) {
    .course-grid, .install-grid, .memo-grid, .level-grid, .courses-grid, .footer-grid { grid-template-columns: 1fr; }
    table.memo, .cmd-table, .exam-table { display: block; width: 100%; overflow-x: auto; }
    .hero { padding: 100px 16px 60px; }
    .section { padding: 60px 16px; }
    .nav-menu.open, .nav-menu.active { display: flex; }
}
.nav-logo { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--text-primary); white-space: nowrap; }
.logo-icon {
    font-family: 'JetBrains Mono', monospace; background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    color: #0a0e17; font-weight: 700; padding: 4px 10px; border-radius: 8px;
}
.logo-text { font-size: 1.05em; }
.nav-menu { display: flex; align-items: center; gap: 4px; }
.nav-link { color: var(--text-secondary); font-weight: 500; padding: 8px 12px; border-radius: 8px; font-size: 0.92em; white-space: nowrap; }
.nav-link:hover, .nav-link.active { color: var(--text-primary); background: var(--accent-glow); }
.nav-dropdown { position: relative; }
.dropdown-content {
    display: none; position: absolute; top: 100%; left: 0; min-width: 200px;
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm);
    box-shadow: var(--shadow); padding: 8px; z-index: 1001;
}
.nav-dropdown:hover .dropdown-content { display: block; }
.dropdown-content a { display: block; padding: 10px 14px; border-radius: 6px; color: var(--text-secondary); font-size: 0.9em; }
.dropdown-content a:hover { background: var(--accent-glow); color: var(--text-primary); }
.nav-search { position: relative; }
.nav-search input {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px;
    color: var(--text-primary); padding: 8px 14px; width: 200px; font-size: 0.9em; outline: none;
}
.nav-search input:focus { border-color: var(--accent); }
.search-results {
    position: absolute; top: 110%; right: 0; width: 320px; max-height: 380px; overflow-y: auto;
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm);
    box-shadow: var(--shadow); display: none; z-index: 1002;
}
.search-results.visible { display: block; }
.search-results a { display: block; padding: 10px 14px; color: var(--text-secondary); font-size: 0.88em; border-bottom: 1px solid var(--border); }
.search-results a:hover { background: var(--accent-glow); color: var(--text-primary); }
.hamburger { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 8px; }
.hamburger span { width: 24px; height: 2px; background: var(--text-primary); border-radius: 2px; transition: var(--transition); }
@media (max-width: 1100px) {
    .hamburger { display: flex; }
    .nav-menu {
        display: none; position: absolute; top: 70px; left: 0; right: 0; flex-direction: column;
        background: var(--bg-nav); border-bottom: 1px solid var(--border); padding: 16px; align-items: stretch;
    }
    .nav-menu.active { display: flex; }
    .nav-search { display: none; }
}

/* ===== HERO ===== */
.hero { position: relative; min-height: 92vh; display: flex; align-items: center; justify-content: center; text-align: center; padding: 120px 24px 60px; overflow: hidden; }
.hero-bg { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 30%, rgba(100,116,139,0.16), transparent 65%); }
.matrix-rain { position: absolute; inset: 0; opacity: 0.5; overflow: hidden; }
.matrix-rain canvas { width: 100%; height: 100%; }
.hero-content { position: relative; z-index: 2; max-width: 900px; }
.hero-badge {
    display: inline-block; background: var(--accent-glow); border: 1px solid var(--border-light);
    color: var(--gradient-end); padding: 8px 20px; border-radius: 30px; font-size: 0.88em; font-weight: 600; margin-bottom: 24px;
}
.hero-title { font-size: clamp(2.2em, 5vw, 3.6em); font-weight: 900; line-height: 1.15; margin-bottom: 20px; }
.hero-title .highlight { background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hero-subtitle { color: var(--text-secondary); font-size: 1.15em; margin-bottom: 36px; }
.hero-stats { display: flex; justify-content: center; gap: 40px; flex-wrap: wrap; margin-bottom: 40px; }
.stat { display: flex; flex-direction: column; }
.stat-number { font-family: 'JetBrains Mono', monospace; font-size: 2em; font-weight: 700; color: var(--gradient-end); }
.stat-label { color: var(--text-secondary); font-size: 0.9em; }
.hero-buttons { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.btn { display: inline-block; padding: 14px 32px; border-radius: 10px; font-weight: 700; font-size: 1em; cursor: pointer; border: 1px solid transparent; transition: var(--transition); }
.btn-primary { background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end)); color: #0a0e17; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(100,116,139,0.35); color: #0a0e17; }
.btn-outline { border-color: var(--border-light); color: var(--text-primary); background: transparent; }
.btn-outline:hover { border-color: var(--accent); background: var(--accent-glow); color: var(--text-primary); }
.btn-small { padding: 8px 18px; font-size: 0.88em; }

/* ===== SECTIONS / CARDS ===== */
.section { padding: 70px 0; }
.section-title { font-size: 2em; font-weight: 800; text-align: center; margin-bottom: 12px; }
.section-desc { color: var(--text-secondary); text-align: center; max-width: 760px; margin: 0 auto 40px; }
.course-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 22px; }
.course-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; transition: var(--transition); display: block; }
.course-card:hover { border-color: var(--accent); transform: translateY(-4px); box-shadow: var(--shadow); }
.course-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.course-icon { font-size: 1.6em; }
.course-tag { font-size: 0.78em; font-weight: 700; background: var(--accent-glow); color: var(--gradient-end); border: 1px solid var(--border-light); padding: 4px 14px; border-radius: 20px; }
.course-card h3 { margin-bottom: 10px; font-size: 1.25em; }
.course-card p { color: var(--text-secondary); font-size: 0.95em; }
.install-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 22px; }
.install-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; }
.install-card h3 { margin: 12px 0 8px; }
.install-card p { color: var(--text-secondary); font-size: 0.93em; margin-bottom: 16px; }
.install-icon { font-size: 1.8em; }
.install-steps .step { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 0.92em; color: var(--text-secondary); }
.step-num {
    flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--accent-glow);
    color: var(--gradient-end); font-family: 'JetBrains Mono', monospace; font-size: 0.85em; font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center;
}
.first-steps-box { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; margin-top: 24px; }
.first-steps-box h3 { margin-bottom: 12px; }

/* ===== MODULES / ACCORDEONS ===== */
.module { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); margin: 18px 0; overflow: hidden; }
.module-header { padding: 20px 24px; cursor: pointer; display: flex; align-items: center; gap: 14px; user-select: none; }
.module-header:hover { background: var(--bg-card-hover); }
.module-num {
    flex-shrink: 0; font-family: 'JetBrains Mono', monospace; font-weight: 700; background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    color: #0a0e17; width: 42px; height: 42px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center;
}
.module-header h3 { flex: 1; font-size: 1.1em; }
.module-toggle { font-family: 'JetBrains Mono', monospace; color: var(--accent); font-size: 1.3em; }
.module-body { display: none; padding: 0 24px 24px; border-top: 1px solid var(--border); }
.module.open .module-body { display: block; }
.module-body h4 { color: var(--gradient-end); margin: 20px 0 10px; font-size: 1.05em; }
.module-body p, .module-body li { color: var(--text-secondary); font-size: 0.95em; }
.module-body ul, .module-body ol { margin: 10px 0 10px 22px; }
.module-body li { margin: 6px 0; }
.exam-trap {
    background: rgba(245, 158, 11, 0.08); border: 1px solid var(--accent-orange); border-left: 4px solid var(--accent-orange);
    border-radius: var(--radius-sm); padding: 14px 18px; margin: 16px 0; font-size: 0.93em; color: var(--text-primary);
}
.exam-trap strong { color: var(--accent-orange); }
.def-box {
    background: var(--bg-secondary); border: 1px solid var(--border-light); border-left: 4px solid var(--accent);
    border-radius: var(--radius-sm); padding: 14px 18px; margin: 14px 0; font-size: 0.93em;
}
.def-box strong { color: var(--gradient-end); }
.example-box {
    background: rgba(34, 197, 94, 0.06); border: 1px solid rgba(34,197,94,0.35); border-left: 4px solid var(--accent-green);
    border-radius: var(--radius-sm); padding: 14px 18px; margin: 14px 0; font-size: 0.93em; color: var(--text-secondary);
}
.example-box strong { color: #4ade80; }
table.memo { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 0.92em; }
table.memo th, table.memo td { border: 1px solid var(--border-light); padding: 10px 12px; text-align: left; }
table.memo th { background: var(--bg-secondary); color: var(--gradient-end); }
table.memo td { color: var(--text-secondary); }

/* ===== QUIZ ===== */
.quiz-selector { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-bottom: 28px; }
.quiz-tab { background: var(--bg-card); border: 1px solid var(--border); color: var(--text-secondary); padding: 10px 22px; border-radius: 8px; cursor: pointer; font-size: 0.92em; font-weight: 600; }
.quiz-tab.active, .quiz-tab:hover { border-color: var(--accent); color: var(--text-primary); background: var(--accent-glow); }
.quiz-container { max-width: 860px; margin: 0 auto; }
.quiz-q { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin: 16px 0; }
.quiz-q h4 { margin-bottom: 14px; font-size: 1.02em; }
.quiz-q h4 .qn { font-family: 'JetBrains Mono', monospace; color: var(--gradient-end); margin-right: 8px; }
.quiz-opt { display: block; width: 100%; text-align: left; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-primary); padding: 11px 15px; margin: 8px 0; cursor: pointer; font-size: 0.94em; }
.quiz-opt:hover { border-color: var(--accent); }
.quiz-opt.selected { border-color: var(--accent); background: var(--accent-glow); }
.quiz-opt.good { border-color: var(--accent-green); background: rgba(34,197,94,0.12); }
.quiz-opt.bad { border-color: var(--accent-red); background: rgba(239,68,68,0.1); }
.quiz-exp { display: none; background: var(--bg-primary); border: 1px solid var(--border); border-radius: 6px; padding: 10px 14px; margin-top: 10px; font-size: 0.9em; color: var(--text-secondary); }
.quiz-exp.visible { display: block; }
.quiz-submit { text-align: center; margin: 24px 0; }
.quiz-score { max-width: 860px; margin: 0 auto; background: var(--bg-card); border: 1px solid var(--accent); border-radius: var(--radius); padding: 24px; text-align: center; font-size: 1.15em; }

/* ===== TERMINAL ===== */
.section-term { padding-top: 120px; }
.term-layout { display: grid; grid-template-columns: 1fr 300px; gap: 18px; align-items: start; }
@media (max-width: 950px) { .term-layout { grid-template-columns: 1fr; } }
.term-main {
    background: #05080f; border: 1px solid var(--border-light); border-radius: var(--radius);
    min-height: 480px; max-height: 640px; overflow-y: auto; padding: 18px 20px;
    font-family: 'JetBrains Mono', monospace; font-size: 0.9em; line-height: 1.65;
}
.term-line { white-space: pre-wrap; word-break: break-word; color: #cbd5e1; }
.term-line .p-green { color: #4ade80; }
.term-line .p-cyan { color: #94a3b8; }
.term-line .p-yellow { color: #fbbf24; }
.term-line .p-red { color: #f87171; }
.term-input-row { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.term-prompt { color: #94a3b8; font-weight: 700; white-space: nowrap; }
.term-input {
    flex: 1; background: transparent; border: none; outline: none; color: #e2e8f0;
    font-family: 'JetBrains Mono', monospace; font-size: 1em;
}
.term-side { display: flex; flex-direction: column; gap: 14px; }
.coach-zone { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; font-size: 0.9em; color: var(--text-secondary); min-height: 180px; }
.coach-zone h4 { color: var(--gradient-end); margin-bottom: 8px; }
.term-quickstart { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 16px; }
.qs-label { color: var(--text-secondary); font-size: 0.9em; }
.qs-chip { background: var(--bg-card); border: 1px solid var(--border-light); color: var(--text-primary); border-radius: 20px; padding: 6px 16px; cursor: pointer; font-family: 'JetBrains Mono', monospace; font-size: 0.85em; }
.qs-chip:hover { border-color: var(--accent); background: var(--accent-glow); }
.term-placeholder { color: var(--text-muted); }

/* ===== FOOTER ===== */
.footer { background: var(--bg-secondary); border-top: 1px solid var(--border); padding: 50px 0 0; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 28px; margin-bottom: 30px; }
.footer-col h4 { margin-bottom: 14px; font-size: 1em; }
.footer-col a { display: block; color: var(--text-secondary); font-size: 0.9em; margin: 6px 0; }
.footer-col a:hover { color: var(--gradient-end); }
.footer-col p { color: var(--text-secondary); font-size: 0.9em; }
.legal-text { font-size: 0.85em; }
.footer-bottom { border-top: 1px solid var(--border); padding: 20px 0; text-align: center; }
.footer-bottom p { color: var(--text-secondary); font-size: 0.85em; }
.footer-bottom .disclaimer { color: var(--text-muted); font-size: 0.78em; margin-top: 8px; font-style: italic; }
.footer-bottom a { color: var(--gradient-end); }

/* ===== DIVERS ===== */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 2000; align-items: center; justify-content: center; padding: 20px; }
.modal-overlay.visible { display: flex; }
.modal { background: var(--bg-card); border: 1px solid var(--border-light); border-radius: var(--radius); max-width: 700px; width: 100%; max-height: 85vh; overflow-y: auto; padding: 30px; position: relative; }
.modal-close { position: absolute; top: 12px; right: 16px; background: none; border: none; color: var(--text-secondary); font-size: 1.6em; cursor: pointer; }
.check-item { display: flex; gap: 10px; align-items: flex-start; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 16px; margin: 10px 0; cursor: pointer; font-size: 0.93em; color: var(--text-secondary); }
.check-item input { width: 18px; height: 18px; margin-top: 3px; accent-color: #64748b; flex-shrink: 0; }
.check-item.done { opacity: 0.75; }
.check-item.done span.txt { text-decoration: line-through; }
.progress-wrap { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 24px; margin: 20px 0; }
.progress-bar { background: var(--bg-primary); border: 1px solid var(--border); border-radius: 8px; height: 16px; overflow: hidden; margin-top: 10px; }
.progress-bar > div { height: 100%; background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end)); transition: width 0.4s; }
.flash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.flash-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; min-height: 170px; cursor: pointer; transition: var(--transition); text-align: center; display: flex; flex-direction: column; justify-content: center; }
.flash-card:hover { border-color: var(--accent); }
.flash-card .f-q { font-weight: 700; font-size: 1.02em; }
.flash-card .f-a { display: none; color: var(--text-secondary); font-size: 0.92em; margin-top: 12px; }
.flash-card.flipped .f-a { display: block; }
.flash-card.flipped .f-q { color: var(--gradient-end); }
.schema-box { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; margin: 22px 0; }
.schema-box h3 { margin-bottom: 6px; }
.schema-box p.desc { color: var(--text-secondary); font-size: 0.92em; margin-bottom: 16px; }
.schema-box svg { width: 100%; height: auto; display: block; }
.warn-box { background: rgba(245,158,11,0.08); border: 1px solid var(--accent-orange); border-radius: var(--radius-sm); padding: 16px 20px; margin: 18px 0; font-size: 0.93em; }
.warn-box strong { color: var(--accent-orange); }
.info-box { background: var(--accent-glow); border: 1px solid var(--border-light); border-radius: var(--radius-sm); padding: 16px 20px; margin: 18px 0; font-size: 0.93em; color: var(--text-secondary); }
.page-head { padding: 120px 0 10px; text-align: center; }
.breadcrumb { text-align: center; color: var(--text-muted); font-size: 0.88em; margin-bottom: 8px; }
.breadcrumb a { color: var(--gradient-end); }
