/* ============================================================
   FORMATION TÉLÉPILOTE — ÉDITION INTERACTIVE
   Thème "cockpit HUD" sombre — cyan / ambre
   ============================================================ */

:root {
  --bg: #070b14;
  --bg2: #0a1120;
  --panel: #0d1524;
  --card: #111c30;
  --card2: #16233c;
  --line: #1e2c47;
  --cyan: #38bdf8;
  --cyan-dim: rgba(56, 189, 248, .12);
  --amber: #fbbf24;
  --amber-dim: rgba(251, 191, 36, .12);
  --green: #34d399;
  --green-dim: rgba(52, 211, 153, .12);
  --red: #f87171;
  --red-dim: rgba(248, 113, 113, .12);
  --violet: #a78bfa;
  --text: #e2e8f0;
  --muted: #8ba2c0;
  --sidebar-w: 268px;
  --radius: 14px;
  --font-head: "Space Grotesk", "Bahnschrift", "Segoe UI Semibold", "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", Consolas, "Courier New", monospace;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}

/* Fond étoilé / grille subtile */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 70% -10%, rgba(56,189,248,.08), transparent 60%),
    radial-gradient(ellipse 60% 40% at 10% 110%, rgba(167,139,250,.06), transparent 60%),
    repeating-linear-gradient(0deg, transparent 0 39px, rgba(56,189,248,.025) 39px 40px),
    repeating-linear-gradient(90deg, transparent 0 39px, rgba(56,189,248,.025) 39px 40px);
  pointer-events: none;
  z-index: 0;
}

::selection { background: rgba(56,189,248,.35); }

/* ================= SIDEBAR ================= */
#sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--panel), var(--bg2));
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform .35s cubic-bezier(.4,0,.2,1);
}

.brand {
  padding: 22px 20px 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-icon {
  width: 42px; height: 42px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 8px rgba(56,189,248,.5));
}
.brand h1 {
  font-family: var(--font-head);
  font-size: 15px;
  letter-spacing: .5px;
  line-height: 1.25;
  text-transform: uppercase;
}
.brand h1 span { color: var(--cyan); }
.brand small { color: var(--muted); font-size: 11px; letter-spacing: 1px; }

#nav {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.nav-label {
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
  padding: 14px 10px 6px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  margin: 2px 0;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
  transition: background .2s, color .2s, transform .15s;
  position: relative;
}
.nav-item:hover { background: rgba(56,189,248,.07); color: var(--text); transform: translateX(3px); }
.nav-item.active {
  background: var(--cyan-dim);
  color: var(--cyan);
  box-shadow: inset 0 0 0 1px rgba(56,189,248,.3);
}
.nav-item .n-ico { font-size: 16px; width: 22px; text-align: center; flex-shrink: 0; }
.nav-item .n-check {
  margin-left: auto;
  font-size: 12px;
  color: var(--green);
  opacity: 0;
  transform: scale(0);
  transition: all .3s cubic-bezier(.68,-.55,.27,1.55);
}
.nav-item.done .n-check { opacity: 1; transform: scale(1); }

.sidebar-foot {
  padding: 16px 18px;
  border-top: 1px solid var(--line);
}
.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 7px;
}
.progress-label b { color: var(--cyan); }
.progress-track {
  height: 6px;
  background: var(--line);
  border-radius: 99px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--cyan), var(--green));
  transition: width .8s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 0 10px rgba(56,189,248,.6);
}
#resetBtn {
  margin-top: 12px;
  width: 100%;
  padding: 7px;
  font-size: 11px;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  transition: all .2s;
}
#resetBtn:hover { color: var(--red); border-color: var(--red); }

/* Bouton menu mobile */
#menuBtn {
  display: none;
  position: fixed;
  top: 14px; left: 14px;
  z-index: 200;
  width: 44px; height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--cyan);
  font-size: 20px;
  cursor: pointer;
}

/* ================= MAIN ================= */
#main {
  margin-left: var(--sidebar-w);
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

.view {
  display: none;
  padding: 44px clamp(20px, 5vw, 64px) 90px;
  max-width: 1120px;
  margin: 0 auto;
  animation: viewIn .5s cubic-bezier(.4,0,.2,1);
}
.view.active { display: block; }

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

/* ================= TYPO / BLOCS ================= */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--cyan);
  background: var(--cyan-dim);
  border: 1px solid rgba(56,189,248,.25);
  padding: 5px 14px;
  border-radius: 99px;
  margin-bottom: 16px;
}
.view h2 {
  font-family: var(--font-head);
  font-size: clamp(26px, 3.4vw, 38px);
  line-height: 1.15;
  margin-bottom: 10px;
  letter-spacing: .3px;
}
.view h2 em { font-style: normal; color: var(--cyan); }
.lead { color: var(--muted); font-size: 17px; max-width: 720px; margin-bottom: 34px; }

h3.sec {
  font-family: var(--font-head);
  font-size: 21px;
  margin: 48px 0 6px;
  display: flex;
  align-items: center;
  gap: 12px;
}
h3.sec::before {
  content: "";
  width: 26px; height: 3px;
  background: linear-gradient(90deg, var(--cyan), transparent);
  border-radius: 2px;
}
.sec-sub { color: var(--muted); font-size: 14px; margin-bottom: 18px; }

/* Révélation au scroll */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .6s ease, transform .6s cubic-bezier(.4,0,.2,1); }
.reveal.in { opacity: 1; transform: none; }

/* Cartes */
.grid { display: grid; gap: 16px; margin: 18px 0; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.g4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

.card {
  background: linear-gradient(160deg, var(--card), var(--bg2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  position: relative;
  overflow: hidden;
  transition: transform .25s, border-color .25s, box-shadow .25s;
}
.card:hover {
  transform: translateY(-4px);
  border-color: rgba(56,189,248,.45);
  box-shadow: 0 14px 34px -14px rgba(56,189,248,.25);
}
.card .c-ico { font-size: 28px; margin-bottom: 10px; display: block; }
.card h4 { font-family: var(--font-head); font-size: 16.5px; margin-bottom: 8px; }
.card p, .card li { font-size: 13.8px; color: var(--muted); }
.card ul { padding-left: 18px; margin-top: 6px; }
.card li { margin: 3px 0; }
.card li b, .card p b { color: var(--text); }
.card .tag {
  display: inline-block;
  font-size: 10.5px;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 99px;
  margin-bottom: 10px;
}
.tag.cyan  { background: var(--cyan-dim);  color: var(--cyan); }
.tag.amber { background: var(--amber-dim); color: var(--amber); }
.tag.green { background: var(--green-dim); color: var(--green); }
.tag.red   { background: var(--red-dim);   color: var(--red); }

.card.accent-top::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--cyan), var(--violet));
}

/* Callout "info essentielle ajoutée" */
.plus {
  border: 1px dashed rgba(251,191,36,.5);
  background: var(--amber-dim);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin: 22px 0;
  font-size: 14px;
}
.plus .plus-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-head);
  color: var(--amber);
  font-size: 13px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.plus p, .plus li { color: #d8c9a3; }
.plus ul { padding-left: 20px; }
.plus b { color: var(--amber); }

/* Callout attention */
.warn {
  border-left: 4px solid var(--red);
  background: var(--red-dim);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 16px 20px;
  margin: 20px 0;
  font-size: 14px;
}
.warn b { color: var(--red); }

.note {
  border-left: 4px solid var(--cyan);
  background: var(--cyan-dim);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 16px 20px;
  margin: 20px 0;
  font-size: 14px;
}
.note b { color: var(--cyan); }

/* Tables */
.tbl-wrap { overflow-x: auto; margin: 18px 0; border-radius: var(--radius); border: 1px solid var(--line); }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  background: var(--bg2);
  min-width: 560px;
}
th {
  font-family: var(--font-head);
  text-align: left;
  padding: 12px 16px;
  background: var(--card2);
  color: var(--cyan);
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  white-space: nowrap;
}
td { padding: 11px 16px; border-top: 1px solid var(--line); color: var(--muted); vertical-align: top; }
td b, td strong { color: var(--text); }
tr:hover td { background: rgba(56,189,248,.04); }

/* ================= HERO / ACCUEIL ================= */
.hero {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 40px;
  align-items: center;
  margin-bottom: 30px;
}
.hero h2 { font-size: clamp(30px, 4vw, 46px); }
.hero .lead { margin-bottom: 26px; }

.hero-stats { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 8px; }
.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 20px;
  text-align: center;
  min-width: 96px;
}
.stat b {
  display: block;
  font-family: var(--font-head);
  font-size: 24px;
  color: var(--cyan);
}
.stat span { font-size: 11px; color: var(--muted); letter-spacing: 1px; text-transform: uppercase; }

/* Scène drone animé */
.drone-scene {
  position: relative;
  height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.drone-wrap { animation: hover-bob 3.4s ease-in-out infinite; will-change: transform; }
@keyframes hover-bob {
  0%, 100% { transform: translateY(0) rotate(-1.5deg); }
  50%      { transform: translateY(-20px) rotate(1.5deg); }
}
.drone-shadow {
  position: absolute;
  bottom: 26px; left: 50%;
  width: 180px; height: 22px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse, rgba(0,0,0,.55), transparent 70%);
  animation: shadow-pulse 3.4s ease-in-out infinite;
}
@keyframes shadow-pulse {
  0%, 100% { transform: translateX(-50%) scale(1); opacity: .8; }
  50%      { transform: translateX(-50%) scale(.8); opacity: .45; }
}
.prop { transform-origin: center; animation: spin .18s linear infinite; }
.prop.slow { animation-duration: .3s; }
@keyframes spin { to { transform: rotate(360deg); } }

.signal-ring {
  position: absolute;
  border: 1.5px solid rgba(56,189,248,.4);
  border-radius: 50%;
  animation: ring-out 2.6s ease-out infinite;
  pointer-events: none;
}
@keyframes ring-out {
  from { width: 40px; height: 40px; opacity: .9; }
  to   { width: 300px; height: 300px; opacity: 0; }
}

/* Cartes modules accueil */
.mod-card { cursor: pointer; }
.mod-card .mod-num {
  font-family: var(--font-head);
  font-size: 12px;
  color: var(--cyan);
  letter-spacing: 2px;
}
.mod-card .mod-go {
  margin-top: 12px;
  font-size: 13px;
  color: var(--cyan);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: gap .2s;
}
.mod-card:hover .mod-go { gap: 12px; }
.mod-card .done-badge {
  position: absolute;
  top: 14px; right: 14px;
  font-size: 18px;
  display: none;
}
.mod-card.done .done-badge { display: block; }

/* ================= WIDGETS ================= */

/* Diagramme architecture segments */
.seg-diagram { display: flex; flex-wrap: wrap; gap: 10px; align-items: stretch; margin: 20px 0; }
.seg {
  flex: 1;
  min-width: 150px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 14px;
  text-align: center;
  cursor: pointer;
  transition: all .25s;
  position: relative;
}
.seg:hover, .seg.open { border-color: var(--cyan); background: var(--cyan-dim); transform: translateY(-3px); }
.seg .s-ico { font-size: 26px; }
.seg h5 { font-family: var(--font-head); font-size: 13px; margin-top: 6px; }
.seg small { color: var(--muted); font-size: 11px; }
#segDetail {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 22px;
  font-size: 14px;
  color: var(--muted);
  min-height: 64px;
  transition: all .3s;
}
#segDetail b { color: var(--cyan); }

/* Chaîne animée (flux d'énergie / contrôle) */
.chain {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  justify-content: center;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 16px;
  margin: 20px 0;
}
.chain-node {
  background: var(--card2);
  border: 1px solid rgba(56,189,248,.35);
  border-radius: 12px;
  padding: 12px 16px;
  text-align: center;
  font-size: 13px;
  min-width: 92px;
  animation: node-glow 2.4s ease-in-out infinite;
}
.chain-node b { display: block; font-family: var(--font-head); color: var(--cyan); font-size: 14px; }
.chain-node small { color: var(--muted); font-size: 11px; }
.chain-node:nth-child(3) { animation-delay: .3s; }
.chain-node:nth-child(5) { animation-delay: .6s; }
.chain-node:nth-child(7) { animation-delay: .9s; }
.chain-node:nth-child(9) { animation-delay: 1.2s; }
.chain-node:nth-child(11) { animation-delay: 1.5s; }
@keyframes node-glow {
  0%, 100% { box-shadow: 0 0 0 rgba(56,189,248,0); }
  50%      { box-shadow: 0 0 18px rgba(56,189,248,.4); border-color: var(--cyan); }
}
.chain-arrow {
  color: var(--cyan);
  font-size: 20px;
  animation: arrow-pulse 1.2s ease-in-out infinite;
}
@keyframes arrow-pulse {
  0%, 100% { opacity: .35; transform: translateX(0); }
  50%      { opacity: 1; transform: translateX(4px); }
}

/* NDVI slider */
.ndvi-box { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin: 18px 0; }
.ndvi-bar {
  height: 14px;
  border-radius: 99px;
  background: linear-gradient(90deg, #3b82f6 0%, #93c5fd 46%, #d6b370 52%, #eab308 62%, #84cc16 78%, #16a34a 100%);
  margin: 14px 0 4px;
}
input[type="range"] {
  width: 100%;
  accent-color: var(--cyan);
  cursor: pointer;
}
.ndvi-read {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 14px;
  flex-wrap: wrap;
}
#ndviSwatch {
  width: 54px; height: 54px;
  border-radius: 12px;
  border: 2px solid var(--line);
  transition: background .2s;
  flex-shrink: 0;
}
#ndviValue { font-family: var(--font-head); font-size: 28px; min-width: 90px; }
#ndviLabel { color: var(--muted); font-size: 14px; }

/* Simulateur sticks */
.sim-box {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  margin: 18px 0;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 26px;
  align-items: center;
}
.joystick {
  width: 130px; height: 130px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #1a2740, #0b1322);
  border: 2px solid var(--line);
  position: relative;
  touch-action: none;
  box-shadow: inset 0 4px 16px rgba(0,0,0,.6);
}
.joystick::before, .joystick::after {
  content: "";
  position: absolute;
  background: rgba(56,189,248,.15);
}
.joystick::before { left: 50%; top: 8px; bottom: 8px; width: 1px; }
.joystick::after  { top: 50%; left: 8px; right: 8px; height: 1px; }
.knob {
  position: absolute;
  width: 46px; height: 46px;
  border-radius: 50%;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle at 35% 30%, #67d5ff, #0e7bb8);
  box-shadow: 0 4px 14px rgba(56,189,248,.5), inset 0 -3px 8px rgba(0,0,0,.4);
  cursor: grab;
  transition: none;
}
.knob.spring { transition: left .25s cubic-bezier(.34,1.56,.64,1), top .25s cubic-bezier(.34,1.56,.64,1); }
.stick-lab { text-align: center; font-size: 11px; color: var(--muted); letter-spacing: 1px; text-transform: uppercase; margin-top: 10px; }
.stick-lab b { color: var(--cyan); display: block; font-size: 12px; }

.sim-stage {
  height: 230px;
  perspective: 700px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(56,189,248,.06), transparent 55%),
    repeating-linear-gradient(0deg, transparent 0 24px, rgba(56,189,248,.06) 24px 25px);
}
#droneModel { transition: transform .12s linear; transform-style: preserve-3d; will-change: transform; }
.sim-telemetry {
  display: grid;
  gap: 8px;
  font-size: 12px;
  min-width: 150px;
}
.tel-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 12px;
  color: var(--muted);
}
.tel-row b { color: var(--cyan); font-family: var(--font-head); min-width: 52px; text-align: right; }

/* Onglets modes de vol */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0 0; }
.tab-btn {
  padding: 9px 18px;
  border-radius: 10px 10px 0 0;
  border: 1px solid var(--line);
  border-bottom: none;
  background: var(--bg2);
  color: var(--muted);
  font-size: 13.5px;
  cursor: pointer;
  transition: all .2s;
  font-family: var(--font-head);
}
.tab-btn.active { background: var(--card2); color: var(--cyan); border-color: rgba(56,189,248,.4); }
.tab-panel {
  display: none;
  background: var(--card2);
  border: 1px solid rgba(56,189,248,.25);
  border-radius: 0 var(--radius) var(--radius) var(--radius);
  padding: 22px 24px;
  animation: viewIn .35s ease;
  font-size: 14px;
}
.tab-panel.active { display: block; }
.tab-panel p { color: var(--muted); margin: 6px 0; }
.tab-panel b { color: var(--text); }
.difficulty { display: inline-flex; gap: 3px; margin-left: 10px; }
.difficulty i { width: 10px; height: 10px; border-radius: 2px; background: var(--line); font-style: normal; }
.difficulty i.on { background: var(--amber); box-shadow: 0 0 6px rgba(251,191,36,.6); }

/* PID canvas */
.pid-box { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin: 18px 0; }
#pidCanvas { width: 100%; height: 220px; border-radius: 10px; background: #050910; border: 1px solid var(--line); }
.pid-sliders { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 18px; margin-top: 18px; }
.pid-sliders label { font-size: 13px; color: var(--muted); display: block; }
.pid-sliders label b { color: var(--cyan); font-family: var(--font-head); }
.pid-sliders .pv { float: right; color: var(--text); font-family: var(--font-head); }

/* Timeline RTH */
.rth-line { display: flex; flex-direction: column; gap: 0; margin: 18px 0; }
.rth-step {
  display: flex;
  gap: 18px;
  padding: 0 0 26px 0;
  position: relative;
  opacity: .35;
  transition: opacity .5s;
}
.rth-step.lit { opacity: 1; }
.rth-step::before {
  content: "";
  position: absolute;
  left: 19px; top: 40px; bottom: 0;
  width: 2px;
  background: var(--line);
}
.rth-step:last-child::before { display: none; }
.rth-dot {
  width: 40px; height: 40px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--card2);
  border: 2px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-head);
  color: var(--muted);
  transition: all .4s;
  z-index: 1;
}
.rth-step.lit .rth-dot {
  border-color: var(--green);
  color: var(--green);
  box-shadow: 0 0 16px rgba(52,211,153,.5);
}
.rth-step h5 { font-family: var(--font-head); font-size: 15px; }
.rth-step p { font-size: 13.5px; color: var(--muted); }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 10px;
  border: 1px solid rgba(56,189,248,.4);
  background: var(--cyan-dim);
  color: var(--cyan);
  font-family: var(--font-head);
  font-size: 14px;
  letter-spacing: .5px;
  cursor: pointer;
  transition: all .2s;
}
.btn:hover { background: rgba(56,189,248,.22); transform: translateY(-2px); box-shadow: 0 8px 20px -8px rgba(56,189,248,.5); }
.btn.green { border-color: rgba(52,211,153,.4); background: var(--green-dim); color: var(--green); }
.btn.green:hover { background: rgba(52,211,153,.22); box-shadow: 0 8px 20px -8px rgba(52,211,153,.5); }
.btn.ghost { border-color: var(--line); background: transparent; color: var(--muted); }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; }

/* Comparateur brushed/brushless */
.vs-switch { display: flex; gap: 0; margin: 18px 0 0; width: fit-content; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.vs-switch button {
  padding: 11px 26px;
  border: none;
  background: var(--bg2);
  color: var(--muted);
  font-family: var(--font-head);
  font-size: 14px;
  cursor: pointer;
  transition: all .25s;
}
.vs-switch button.active { background: var(--cyan); color: #04121e; }
.vs-pane { display: none; animation: viewIn .35s ease; }
.vs-pane.active { display: block; }

/* Kv slider */
.kv-box { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin: 18px 0; }
.kv-visual { display: flex; align-items: center; justify-content: center; gap: 40px; height: 130px; margin-bottom: 8px; }
.kv-prop-wrap { text-align: center; }
#kvProp { transform-origin: center; }
#kvOut { text-align: center; margin-top: 10px; font-size: 14px; color: var(--muted); }
#kvOut b { color: var(--cyan); font-family: var(--font-head); font-size: 18px; }

/* Calculatrices */
.calc {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  margin: 18px 0;
}
.calc h4 { font-family: var(--font-head); margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }
.calc .formula {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--amber);
  background: rgba(0,0,0,.3);
  border-radius: 8px;
  padding: 10px 14px;
  margin: 10px 0 16px;
  overflow-x: auto;
  white-space: nowrap;
}
.calc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.calc-grid label { font-size: 12px; color: var(--muted); display: block; }
.calc input[type="number"], .calc select {
  width: 100%;
  margin-top: 5px;
  padding: 10px 12px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  font-size: 15px;
  font-family: var(--font-head);
}
.calc input:focus, .calc select:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(56,189,248,.15); }
.calc-out {
  margin-top: 18px;
  padding: 16px 20px;
  border-radius: 12px;
  background: var(--green-dim);
  border: 1px solid rgba(52,211,153,.3);
  font-size: 14px;
  color: var(--muted);
}
.calc-out b { font-family: var(--font-head); color: var(--green); font-size: 22px; }
.calc-out.bad { background: var(--red-dim); border-color: rgba(248,113,113,.35); }
.calc-out.bad b { color: var(--red); }

/* Redondance moteurs */
.frame-pick { display: flex; gap: 10px; flex-wrap: wrap; margin: 16px 0; }
.frame-pick button {
  padding: 10px 20px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg2);
  color: var(--muted);
  cursor: pointer;
  font-family: var(--font-head);
  font-size: 13.5px;
  transition: all .2s;
}
.frame-pick button.active { border-color: var(--cyan); color: var(--cyan); background: var(--cyan-dim); }
.frame-stage { display: flex; align-items: center; gap: 30px; flex-wrap: wrap; }
#frameSvg { flex-shrink: 0; }
.motor-dot { cursor: pointer; transition: all .2s; }
.motor-dot:hover { filter: brightness(1.4); }
#frameResult {
  flex: 1;
  min-width: 240px;
  padding: 16px 20px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg2);
  font-size: 14px;
  color: var(--muted);
}
#frameResult b { font-family: var(--font-head); }
#frameResult.ok b { color: var(--green); }
#frameResult.deg b { color: var(--amber); }
#frameResult.crash b { color: var(--red); }

/* Batterie animation */
.batt-anim { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin: 18px 0; }
.batt-cell-visual { position: relative; flex-shrink: 0; }
.electron {
  position: absolute;
  top: 0; left: 0;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
  offset-rotate: 0deg;
}
.batt-controls { flex: 1; min-width: 220px; }
.batt-desc { font-size: 13.5px; color: var(--muted); margin-top: 12px; }
.batt-desc b { color: var(--cyan); }

/* Gauge stockage */
.gauge-row { display: flex; gap: 14px; flex-wrap: wrap; margin: 16px 0; }
.gauge {
  flex: 1;
  min-width: 160px;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}
.gauge .g-bar {
  height: 90px;
  width: 34px;
  margin: 10px auto;
  border: 2px solid var(--line);
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  background: var(--card);
}
.gauge .g-fill {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  border-radius: 0 0 6px 6px;
  transition: height 1s ease;
}
.gauge h5 { font-family: var(--font-head); font-size: 13px; }
.gauge small { color: var(--muted); font-size: 11.5px; display: block; }
.gauge .g-val { font-family: var(--font-head); font-size: 17px; }

/* Accordéon diagnostic */
.acc { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin: 18px 0; }
.acc-item + .acc-item { border-top: 1px solid var(--line); }
.acc-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 20px;
  background: var(--bg2);
  border: none;
  color: var(--text);
  font-size: 14.5px;
  font-family: var(--font-body);
  cursor: pointer;
  text-align: left;
  transition: background .2s;
}
.acc-head:hover { background: var(--card2); }
.acc-head .a-ico { font-size: 18px; }
.acc-head .a-chev { margin-left: auto; color: var(--cyan); transition: transform .3s; }
.acc-item.open .a-chev { transform: rotate(180deg); }
.acc-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height .4s ease;
  background: var(--card);
}
.acc-item.open .acc-body { max-height: 300px; }
.acc-body-in { padding: 16px 22px; font-size: 13.5px; color: var(--muted); }
.acc-body-in b { color: var(--amber); }
.acc-body-in .sol { color: var(--green); }

/* Checklist interactive */
.checklist { display: grid; gap: 8px; margin: 16px 0; }
.chk {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 16px;
  cursor: pointer;
  transition: all .2s;
  font-size: 14px;
  color: var(--muted);
  user-select: none;
}
.chk:hover { border-color: rgba(56,189,248,.4); }
.chk .box {
  width: 22px; height: 22px;
  flex-shrink: 0;
  border-radius: 6px;
  border: 2px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: transparent;
  transition: all .25s;
}
.chk.on { color: var(--text); background: var(--green-dim); border-color: rgba(52,211,153,.35); }
.chk.on .box { background: var(--green); border-color: var(--green); color: #04120c; }
#chkScore { font-family: var(--font-head); color: var(--green); }

/* Règles d'or */
.rules { counter-reset: rule; display: grid; gap: 12px; margin: 18px 0; }
.rule {
  counter-increment: rule;
  display: flex;
  gap: 18px;
  align-items: center;
  background: linear-gradient(120deg, var(--card), var(--bg2));
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 22px;
  transition: all .25s;
}
.rule:hover { border-color: var(--amber); transform: translateX(6px); }
.rule::before {
  content: counter(rule);
  font-family: var(--font-head);
  font-size: 26px;
  color: var(--amber);
  min-width: 34px;
  text-align: center;
}
.rule p { font-size: 14.5px; }
.rule b { color: var(--amber); }

/* Flashcards */
.flash-stage { display: flex; flex-direction: column; align-items: center; gap: 22px; margin: 30px 0; }
.flash-card {
  width: min(560px, 100%);
  height: 300px;
  perspective: 1200px;
  cursor: pointer;
}
.flash-inner {
  width: 100%; height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform .6s cubic-bezier(.4,0,.2,1);
}
.flash-card.flipped .flash-inner { transform: rotateY(180deg); }
.flash-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 34px;
  gap: 12px;
}
.flash-face.front {
  background: linear-gradient(150deg, var(--card2), var(--bg2));
  border: 1px solid rgba(56,189,248,.35);
}
.flash-face.back {
  background: linear-gradient(150deg, #1b2a1f, var(--bg2));
  border: 1px solid rgba(52,211,153,.4);
  transform: rotateY(180deg);
}
.flash-face .f-hint { font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); }
.flash-face .f-q { font-family: var(--font-head); font-size: 22px; line-height: 1.4; }
.flash-face.back .f-q { color: var(--green); }
.flash-nav { display: flex; gap: 14px; align-items: center; }
#flashCount { font-family: var(--font-head); color: var(--muted); min-width: 70px; text-align: center; }

/* Examen */
.exam-shell { max-width: 760px; }
.exam-progress { display: flex; gap: 5px; margin: 22px 0; flex-wrap: wrap; }
.exam-progress i {
  width: 18px; height: 6px;
  border-radius: 99px;
  background: var(--line);
  transition: background .3s;
}
.exam-progress i.cur { background: var(--cyan); }
.exam-progress i.ok  { background: var(--green); }
.exam-progress i.ko  { background: var(--red); }
.q-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  animation: viewIn .4s ease;
}
.q-card .q-num { font-size: 12px; color: var(--cyan); letter-spacing: 2px; text-transform: uppercase; font-family: var(--font-head); }
.q-card h4 { font-family: var(--font-head); font-size: 19px; margin: 10px 0 20px; line-height: 1.4; }
.q-opts { display: grid; gap: 10px; }
.q-opt {
  text-align: left;
  padding: 14px 18px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--bg2);
  color: var(--text);
  font-size: 14.5px;
  cursor: pointer;
  transition: all .2s;
  font-family: var(--font-body);
}
.q-opt:hover:not(:disabled) { border-color: var(--cyan); background: var(--cyan-dim); transform: translateX(4px); }
.q-opt.correct { border-color: var(--green); background: var(--green-dim); color: var(--green); }
.q-opt.wrong   { border-color: var(--red);   background: var(--red-dim);   color: var(--red); }
.q-opt:disabled { cursor: default; opacity: .75; }
.q-opt.correct, .q-opt.wrong { opacity: 1; }
.q-expl {
  margin-top: 16px;
  padding: 14px 18px;
  border-radius: 10px;
  background: var(--cyan-dim);
  border-left: 3px solid var(--cyan);
  font-size: 13.5px;
  color: var(--muted);
  display: none;
}
.q-expl.show { display: block; animation: viewIn .3s ease; }
.q-next { margin-top: 20px; display: none; }
.q-next.show { display: inline-flex; }

.exam-result { text-align: center; padding: 40px 20px; animation: viewIn .5s ease; }
.score-ring { position: relative; width: 180px; height: 180px; margin: 0 auto 24px; }
.score-ring svg { transform: rotate(-90deg); }
.score-ring .ring-bg { fill: none; stroke: var(--line); stroke-width: 12; }
.score-ring .ring-val {
  fill: none;
  stroke: var(--green);
  stroke-width: 12;
  stroke-linecap: round;
  transition: stroke-dashoffset 1.4s cubic-bezier(.4,0,.2,1);
}
.score-ring .ring-txt {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: var(--font-head);
}
.score-ring .ring-txt b { font-size: 40px; color: var(--green); }
.score-ring .ring-txt span { font-size: 12px; color: var(--muted); letter-spacing: 1px; }
.exam-verdict { font-family: var(--font-head); font-size: 22px; margin-bottom: 8px; }
.exam-sub { color: var(--muted); margin-bottom: 26px; }

/* Glossaire */
#glossSearch {
  width: 100%;
  padding: 15px 20px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  font-size: 16px;
  margin: 8px 0 24px;
}
#glossSearch:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 4px rgba(56,189,248,.12); }
.gloss-item {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 10px;
  transition: border-color .2s;
}
.gloss-item:hover { border-color: rgba(56,189,248,.4); }
.gloss-item h5 { font-family: var(--font-head); color: var(--cyan); font-size: 15px; margin-bottom: 4px; }
.gloss-item p { font-size: 13.5px; color: var(--muted); }
.gloss-empty { text-align: center; color: var(--muted); padding: 40px; display: none; }

/* Bouton fin de module */
.module-end {
  margin-top: 56px;
  padding: 28px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(120deg, var(--card), var(--bg2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.module-end p { color: var(--muted); font-size: 14px; }
.module-end .btn.done-state { border-color: rgba(52,211,153,.5); background: var(--green-dim); color: var(--green); }

/* Confetti simple */
.confetti {
  position: fixed;
  top: -12px;
  width: 9px; height: 14px;
  z-index: 999;
  pointer-events: none;
  animation: fall linear forwards;
}
@keyframes fall {
  to { transform: translateY(105vh) rotate(720deg); opacity: .2; }
}

/* Fréquences */
.freq-rows { display: grid; gap: 10px; margin: 18px 0; }
.freq-row { display: grid; grid-template-columns: 110px 1fr 200px; gap: 14px; align-items: center; font-size: 13px; }
.freq-row .f-name { font-family: var(--font-head); color: var(--cyan); text-align: right; }
.freq-row .f-bar { height: 12px; border-radius: 99px; background: var(--line); overflow: hidden; }
.freq-row .f-bar i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--cyan), var(--violet));
  animation: freq-in 1.2s cubic-bezier(.4,0,.2,1) both;
}
@keyframes freq-in { from { width: 0 !important; } }
.freq-row .f-use { color: var(--muted); }

/* ================= ICÔNES (Lucide) ================= */
svg.lucide {
  width: 1.1em;
  height: 1.1em;
  vertical-align: -0.18em;
  stroke-width: 2;
  flex-shrink: 0;
}
#menuBtn svg.lucide { width: 22px; height: 22px; vertical-align: middle; }
.nav-item .n-ico { display: inline-flex; justify-content: center; }
.nav-item .n-ico svg.lucide { width: 17px; height: 17px; }
.card .c-ico { color: var(--cyan); }
.card .c-ico svg.lucide { width: 30px; height: 30px; stroke-width: 1.8; }
.seg .s-ico { color: var(--cyan); display: flex; justify-content: center; }
.seg .s-ico svg.lucide { width: 26px; height: 26px; stroke-width: 1.8; }
.acc-head .a-ico { color: var(--amber); display: inline-flex; }
.acc-head .a-ico svg.lucide { width: 18px; height: 18px; }
td svg.lucide, th svg.lucide { color: var(--cyan); width: 16px; height: 16px; margin-right: 4px; }
.btn svg.lucide { width: 16px; height: 16px; }
.plus-head svg.lucide { width: 15px; height: 15px; }
.note > b > svg.lucide, .warn > b > svg.lucide { margin-right: 3px; }
.warn svg.lucide { color: var(--red); }
.note svg.lucide { color: var(--cyan); }
.calc h4 svg.lucide, .ndvi-box h4 svg.lucide { color: var(--cyan); width: 19px; height: 19px; }
.card h4 svg.lucide { color: var(--cyan); width: 18px; height: 18px; margin-right: 3px; }
.gauge h5 svg.lucide { width: 15px; height: 15px; }
.done-badge { color: var(--green); }
.done-badge svg.lucide { width: 21px; height: 21px; }
.eyebrow svg.lucide { width: 13px; height: 13px; }
.chain-node b svg.lucide { width: 15px; height: 15px; margin-right: 2px; }
.stick-lab svg.lucide { color: var(--cyan); }
.vs-switch button svg.lucide { width: 15px; height: 15px; margin-right: 4px; }
.exam-verdict svg.lucide { width: 22px; height: 22px; margin-right: 6px; }

/* ================= RESPONSIVE ================= */
@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; }
  .drone-scene { height: 240px; order: -1; }
  .sim-box { grid-template-columns: 1fr; justify-items: center; }
  .freq-row { grid-template-columns: 80px 1fr; }
  .freq-row .f-use { grid-column: 2; }
}
@media (max-width: 860px) {
  #sidebar { transform: translateX(-100%); box-shadow: 20px 0 60px rgba(0,0,0,.5); }
  #sidebar.open { transform: translateX(0); }
  #menuBtn { display: block; }
  #main { margin-left: 0; }
  .view { padding-top: 76px; }
}
