/* ═══════════════════════════════════════════════════════════════
   FRENCHOIS — DESIGN SYSTEM GLOBAL
   style.css · v1.0 · Mars 2026
   ---------------------------------------------------------------
   À importer dans chaque page :
     <link rel="stylesheet" href="style.css">
   ═══════════════════════════════════════════════════════════════ */


/* ──────────────────────────────────────────────────────────────
   1. TOKENS CSS — Variables globales
   ────────────────────────────────────────────────────────────── */
:root {

  /* Niveaux de langue */
  --a1:  #e63946; --a1l: #fdecea; --a1d: #b02030;
  --a2:  #2a7dd1; --a2l: #deeeff; --a2d: #1a5fa0;
  --b1:  #2eaa6b; --b1l: #dcf5ea; --b1d: #1d7a4c;
  --b2:  #7c3aed; --b2l: #f3e8ff; --b2d: #5b21b6;

  /* Couleurs de leçons (sidebar nav) */
  --l0:  #7c3aed; --l0l: #ede9fe; --l0d: #5b21b6;
  --l1:  #e63946; --l1l: #fdecea; --l1d: #b02030;
  --l2:  #2a7dd1; --l2l: #deeeff; --l2d: #1a5fa0;
  --l3:  #e88c1a; --l3l: #fff3dc; --l3d: #b86a00;
  --l4:  #2eaa6b; --l4l: #dcf5ea; --l4d: #1d7a4c;
  --l5:  #8b5cf6; --l5l: #ede9fe; --l5d: #6d28d9;

  /* États sémantiques (cohérents avec tous les fichiers) */
  --ok:   #2eaa6b; --okl: #dcf5ea; --okd: #1d7a4c;
  --err:  #e63946; --errl: #fdecea; --errd: #b02030;
  --warn: #e88c1a; --warnl: #fff3dc; --warnd: #b86a00;

  /* Neutres */
  --bg:     #f7f4ef;
  --white:  #ffffff;
  --text:   #1c1c2e;
  --muted:  #7a7a8c;
  --border: #e4ddd4;

  /* Ombres */
  --shadow:    0 4px 24px rgba(0,0,0,.08);
  --shadow-lg: 0 8px 40px rgba(0,0,0,.12);

  /* Typographie */
  --font-display: 'Playfair Display', serif;
  --font-body:    'Nunito', sans-serif;

  /* Rayons */
  --r-sm:  8px;
  --r-md:  12px;
  --r-lg:  18px;
  --r-xl:  24px;

  /* Transitions */
  --t-fast:   0.15s ease;
  --t-normal: 0.2s ease;
  --t-slow:   0.3s ease;

  /* Z-index réservés (ne pas dépasser 99999 = bouton auth) */
  --z-fab:    9999;
  --z-modal:  10000;
  --z-auth:   99999;
}


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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}


/* ──────────────────────────────────────────────────────────────
   3. ANIMATIONS GLOBALES
   ────────────────────────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25%       { transform: translateX(-6px); }
  75%       { transform: translateX(6px); }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.2; }
}

@keyframes pop {
  from { transform: scale(0.97); opacity: 0.7; }
  to   { transform: scale(1);    opacity: 1; }
}

@keyframes ripple-pulse {
  0%, 100% { box-shadow: 0 0 0 0   rgba(255,255,255,.3); }
  50%       { box-shadow: 0 0 0 14px rgba(255,255,255,0); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

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


/* ──────────────────────────────────────────────────────────────
   4. LAYOUT — App, Sidebar, Main
   ────────────────────────────────────────────────────────────── */

/* Disposition côte-à-côte : sidebar + contenu principal */
.app {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
  width: 260px;
  flex-shrink: 0;
  background: var(--white);
  border-right: 1px solid var(--border);
  padding: 28px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar-logo {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  padding: 0 8px 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 10px;
  line-height: 1.3;
}

.sidebar-logo span { color: var(--a1); }

.sidebar-back {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  margin-bottom: 12px;
  transition: all var(--t-fast);
}

.sidebar-back:hover {
  border-color: var(--text);
  color: var(--text);
}

.nav-section {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  padding: 8px 12px 4px;
  margin-top: 8px;
}

/* ── Bouton nav sidebar ── */
.nav-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: all var(--t-fast);
  width: 100%;
  position: relative;
}

.nav-btn:hover   { background: var(--bg); color: var(--text); }
.nav-btn.active  { color: var(--white); }

.nav-btn .nav-icon  { font-size: 18px; width: 24px; text-align: center; }
.nav-btn .nav-badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 20px;
  background: rgba(255,255,255,0.25);
  color: inherit;
}

/* Couleurs par leçon (data-lesson) */
.nav-btn[data-lesson="0"].active  { background: var(--l0); }
.nav-btn[data-lesson="1"].active  { background: var(--l1); }
.nav-btn[data-lesson="2"].active  { background: var(--l2); }
.nav-btn[data-lesson="3"].active  { background: var(--l3); }
.nav-btn[data-lesson="4"].active  { background: var(--l4); }
.nav-btn[data-lesson="5"].active  { background: var(--l5); }

.nav-btn[data-lesson="0"]:not(.active):hover { background: var(--l0l); color: var(--l0d); }
.nav-btn[data-lesson="1"]:not(.active):hover { background: var(--l1l); color: var(--l1d); }
.nav-btn[data-lesson="2"]:not(.active):hover { background: var(--l2l); color: var(--l2d); }
.nav-btn[data-lesson="3"]:not(.active):hover { background: var(--l3l); color: var(--l3d); }
.nav-btn[data-lesson="4"]:not(.active):hover { background: var(--l4l); color: var(--l4d); }
.nav-btn[data-lesson="5"]:not(.active):hover { background: var(--l5l); color: var(--l5d); }

/* ── Header horizontal (pages vocabulaire/prononciation) ── */
.header {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 28px;
  background: var(--white);
  border-bottom: 1.5px solid var(--border);
}

.header-back {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color var(--t-normal);
}
.header-back:hover { color: var(--a1); }

.header-divider { color: var(--border); }

.header-badge {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 20px;
  background: var(--a1l);
  color: var(--a1);
}

.header-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

/* ── Zone principale ── */
.main {
  flex: 1;
  padding: 40px 36px;
  max-width: 900px;
}

/* Panneaux de leçon */
.lesson-panel         { display: none; }
.lesson-panel.active  { display: block; animation: fadeIn var(--t-slow) ease; }

/* Vues (onglets) */
.view         { display: none; }
.view.active  { display: block; animation: fadeIn var(--t-slow) ease; }


/* ──────────────────────────────────────────────────────────────
   5. EN-TÊTE DE LEÇON
   ────────────────────────────────────────────────────────────── */
.lesson-header {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 36px;
}

.lesson-icon-big {
  width: 64px;
  height: 64px;
  border-radius: var(--r-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  flex-shrink: 0;
}

.lesson-meta  { flex: 1; }

.lesson-tag {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 20px;
  display: inline-block;
  margin-bottom: 8px;
}

.lesson-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: 6px;
}

.lesson-desc {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
}


/* ──────────────────────────────────────────────────────────────
   6. CARTES D'EXERCICE
   ────────────────────────────────────────────────────────────── */
.ex-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 28px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.ex-title {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.ex-instr {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 20px;
  line-height: 1.5;
}

.ex-subtitle {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
}


/* ──────────────────────────────────────────────────────────────
   7. QCM (Questions à Choix Multiples)
   ────────────────────────────────────────────────────────────── */
.qcm-item  { margin-bottom: 22px; }
.q-label   { font-size: 11px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; margin-bottom: 6px; opacity: .6; }
.q-text    { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 12px; line-height: 1.5; }

.opts { display: flex; flex-direction: column; gap: 8px; }

.opt {
  padding: 11px 16px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-body);
  transition: all var(--t-fast);
  display: flex;
  align-items: center;
  gap: 10px;
}

.opt:hover:not(:disabled) { border-color: var(--text); background: var(--white); }
.opt:disabled  { cursor: default; }
.opt.correct   { border-color: var(--ok);  background: var(--okl);  color: var(--okd); }
.opt.wrong     { border-color: var(--err); background: var(--errl); color: var(--errd); }

/* Feedback sous la question */
.fb       { margin-top: 8px; padding: 8px 14px; border-radius: var(--r-sm); font-size: 13px; font-weight: 600; display: none; }
.fb.show  { display: block; }
.fb.ok    { background: var(--okl);  color: var(--okd); }
.fb.nope  { background: var(--errl); color: var(--errd); }


/* ──────────────────────────────────────────────────────────────
   8. EXERCICE MATCH (Association gauche/droite)
   ────────────────────────────────────────────────────────────── */
.match-wrap      { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.match-col-title { font-size: 11px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; text-align: center; }
.match-col       { display: flex; flex-direction: column; gap: 8px; }

.match-item {
  padding: 11px 16px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--border);
  background: var(--bg);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all var(--t-fast);
  font-family: var(--font-body);
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.match-item.selected   { border-color: var(--l2);  background: var(--l2l);  color: var(--l2d); }
.match-item.matched-ok { border-color: var(--ok);   background: var(--okl);  color: var(--okd);  pointer-events: none; }
.match-item.matched-err{ border-color: var(--err);  background: var(--errl); color: var(--errd); animation: shake var(--t-slow); }
.match-item.matched-ok { pointer-events: none; }

.match-score { margin-top: 14px; text-align: center; font-size: 14px; font-weight: 700; color: var(--muted); }


/* ──────────────────────────────────────────────────────────────
   9. EXERCICE FILL-IN-THE-BLANK
   ────────────────────────────────────────────────────────────── */
.fill-item     { margin-bottom: 16px; }
.fill-sentence { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 8px; line-height: 1.7; }

.fill-input {
  border: 2px solid var(--border);
  border-radius: var(--r-sm);
  padding: 8px 14px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  width: 100%;
  background: var(--bg);
  color: var(--text);
  outline: none;
  transition: border-color var(--t-fast);
}

.fill-input:focus { border-color: var(--l2); }
.fill-input.ok    { border-color: var(--ok);  background: var(--okl);  color: var(--okd); }
.fill-input.nope  { border-color: var(--err); background: var(--errl); color: var(--errd); }
.fill-hint        { font-size: 12px; color: var(--muted); margin-top: 4px; font-style: italic; }

/* Input fill inline (dans une phrase) */
.fi {
  border: 2px solid var(--border);
  border-radius: var(--r-sm);
  padding: 6px 12px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  min-width: 110px;
  background: var(--bg);
  color: var(--text);
  outline: none;
  transition: border-color var(--t-fast);
}
.fi:focus { border-color: var(--a2); }
.fi.ok    { border-color: var(--ok);  background: var(--okl);  color: var(--okd); }
.fi.nope  { border-color: var(--err); background: var(--errl); color: var(--errd); }
.fhint    { font-size: 12px; color: var(--muted); margin-top: 4px; font-style: italic; }


/* ──────────────────────────────────────────────────────────────
   10. PHONÉTIQUE — Cartes de sons
   ────────────────────────────────────────────────────────────── */
.phone-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
}

.phone-card {
  border-radius: 14px;
  border: 2px solid transparent;
  padding: 14px 10px;
  text-align: center;
  cursor: pointer;
  transition: all var(--t-fast);
  background: var(--bg);
}

.phone-card:hover        { transform: translateY(-2px); box-shadow: var(--shadow); }
.phone-card.playing      { border-color: currentColor; }

.phone-fr        { font-family: var(--font-display); font-size: 16px; font-weight: 700; margin-bottom: 2px; }
.phone-ipa       { font-size: 10px; opacity: .6; margin-bottom: 4px; font-style: italic; }
.phone-es        { font-size: 11px; color: var(--muted); }
.phone-play-icon { font-size: 14px; margin-bottom: 4px; }


/* ──────────────────────────────────────────────────────────────
   11. ENREGISTREUR / ZONE MICRO
   ────────────────────────────────────────────────────────────── */
.recorder-zone {
  border-radius: 14px;
  padding: 22px;
  text-align: center;
  margin-top: 16px;
}

.rec-word { font-family: var(--font-display); font-size: 36px; font-weight: 700; margin-bottom: 4px; }
.rec-ipa  { font-size: 13px; margin-bottom: 6px; font-style: italic; opacity: .7; }
.rec-es   { font-size: 13px; color: var(--muted); margin-bottom: 20px; }

.rec-dot  { width: 8px; height: 8px; border-radius: 50%; background: #fff; animation: blink 1s infinite; }
.rec-status { font-size: 13px; color: var(--muted); margin-top: 8px; min-height: 20px; }

.compare-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 14px;
  flex-wrap: wrap;
}

.compare-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px 18px;
  text-align: center;
  min-width: 120px;
}

.compare-label { font-size: 10px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }


/* ──────────────────────────────────────────────────────────────
   12. BOUTONS GÉNÉRAUX
   ────────────────────────────────────────────────────────────── */

/* Bouton primaire */
.btn-p {
  padding: 13px 28px;
  border-radius: var(--r-md);
  border: none;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: all var(--t-fast);
}
.btn-p:hover { transform: translateY(-1px); box-shadow: var(--shadow); }

/* Bouton secondaire */
.btn-s {
  padding: 11px 22px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--border);
  background: var(--white);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  color: var(--muted);
  transition: all var(--t-fast);
}
.btn-s:hover { border-color: var(--text); color: var(--text); }

/* Bouton icône générique */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: var(--r-md);
  border: none;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--t-fast);
}
.btn:disabled           { opacity: .4; cursor: not-allowed; }
.btn:hover:not(:disabled){ transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0,0,0,.15); }

/* Bouton vérification */
.check-btn {
  margin-top: 16px;
  padding: 12px 28px;
  border-radius: var(--r-md);
  border: none;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: all var(--t-fast);
}
.check-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }

/* Bouton mini */
.mini-btn {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-body);
  transition: all var(--t-fast);
}
.mini-btn:hover { border-color: var(--text); }

/* Bouton speak inline */
.speak-btn {
  margin-left: auto;
  background: none;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  padding: 6px 12px;
  cursor: pointer;
  font-size: 16px;
  transition: all var(--t-fast);
  flex-shrink: 0;
}
.speak-btn:hover { border-color: var(--text); }

/* Rangée de boutons */
.btn-row  { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-bottom: 12px; }
.brow     { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }


/* ──────────────────────────────────────────────────────────────
   13. FLASHCARD (module vocabulaire)
   ────────────────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(28,28,46,.08);
  transition: transform .3s cubic-bezier(.34,1.56,.64,1);
}

.card.pop { animation: pop .3s cubic-bezier(.34,1.56,.64,1); }

.card-top {
  background: linear-gradient(135deg, var(--a1) 0%, #c1121f 100%);
  padding: 32px 28px 28px;
  min-height: 190px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  text-align: center;
}

.card-top::after {
  content: '';
  position: absolute;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: rgba(255,255,255,.06);
  top: -70px; right: -50px;
  pointer-events: none;
}

.card-cat-tag {
  position: absolute; top: 12px; right: 14px;
  font-size: 10px; font-weight: 800; letter-spacing: .5px;
  text-transform: uppercase;
  background: rgba(255,255,255,.15);
  color: rgba(255,255,255,.85);
  padding: 3px 10px; border-radius: 20px;
}

.card-mode-label {
  font-size: 10px; font-weight: 800; letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(255,255,255,.6);
  margin-bottom: 12px; position: relative;
}

.card-word {
  font-family: var(--font-display);
  font-size: clamp(2rem, 7vw, 2.8rem);
  font-weight: 700; color: white;
  line-height: 1.15; position: relative;
}

.card-hint {
  margin-top: 10px; font-size: 12px;
  color: rgba(255,255,255,.55); position: relative;
}

.card-bottom { padding: 22px 22px 18px; }

/* Zone audio (mode dictée) */
.audio-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  position: relative;
}

.btn-listen {
  width: 68px; height: 68px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,.4);
  background: rgba(255,255,255,.18);
  color: white; font-size: 1.7rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--t-normal);
  backdrop-filter: blur(4px);
}
.btn-listen:hover    { background: rgba(255,255,255,.28); border-color: rgba(255,255,255,.7); transform: scale(1.06); }
.btn-listen:disabled { opacity: .5; cursor: wait; }
.btn-listen.playing  { animation: ripple-pulse 1.4s ease-in-out infinite; }

.listen-label { font-size: 11px; color: rgba(255,255,255,.55); font-weight: 700; letter-spacing: .5px; }

.btn-replay {
  background: rgba(255,255,255,.12);
  border: 1.5px solid rgba(255,255,255,.25);
  color: rgba(255,255,255,.75);
  font-size: 12px; font-weight: 700;
  padding: 4px 14px; border-radius: 20px;
  cursor: pointer; transition: all var(--t-fast);
  font-family: var(--font-body);
}
.btn-replay:hover    { background: rgba(255,255,255,.22); color: white; }
.btn-replay:disabled { opacity: .4; cursor: wait; }

/* Input réponse */
.input-row { display: flex; gap: 8px; }

.answer-input {
  flex: 1; padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  font-size: 15px;
  font-family: var(--font-body);
  outline: none;
  background: var(--bg);
  color: var(--text);
  transition: border-color var(--t-normal), background var(--t-normal);
  font-weight: 600;
}
.answer-input:focus    { border-color: var(--a1); background: var(--white); }
.answer-input.ok       { border-color: var(--ok);  background: var(--okl); }
.answer-input.err      { border-color: var(--err); background: var(--errl); }
.answer-input:disabled { opacity: .85; }

.btn-check {
  padding: 12px 16px;
  background: var(--a1);
  color: white;
  border: none;
  border-radius: var(--r-md);
  font-size: 16px; font-weight: 800;
  cursor: pointer;
  transition: background var(--t-fast), transform .1s;
  font-family: var(--font-body);
}
.btn-check:hover  { background: #c1121f; }
.btn-check:active { transform: scale(.95); }

.feedback {
  margin-top: 12px; padding: 10px 14px;
  border-radius: var(--r-md);
  font-size: 14px; font-weight: 600;
  display: none; align-items: center; gap: 8px;
  animation: fadein var(--t-normal) ease;
}
.feedback.ok  { display: flex; background: var(--okl);  color: var(--okd);  border: 1.5px solid #a7f3d0; }
.feedback.err { display: flex; background: var(--errl); color: var(--errd); border: 1.5px solid #fca5a5; }

.feedback-text strong { font-family: var(--font-display); font-size: 1.05rem; }
.feedback-text .fb-es { font-size: .85rem; font-weight: 600; opacity: .75; margin-left: 4px; }

.btn-next {
  width: 100%; margin-top: 10px; padding: 12px;
  background: var(--text); color: white;
  border: none; border-radius: var(--r-md);
  font-size: 14px; font-weight: 800;
  cursor: pointer; display: none;
  transition: opacity var(--t-fast);
  font-family: var(--font-body);
  letter-spacing: .3px;
}
.btn-next:hover  { opacity: .85; }
.btn-next.on     { display: block; animation: fadein var(--t-normal) ease; }


/* ──────────────────────────────────────────────────────────────
   14. SCOREBAR & SCORE BOX
   ────────────────────────────────────────────────────────────── */
.scorebar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  margin-bottom: 14px;
}

.score-pill        { display: flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 800; }
.score-pill.ok     { color: var(--ok); }
.score-pill.err    { color: var(--err); }
.streak            { font-size: 12px; color: #d97706; font-weight: 800; display: none; }
.streak.on         { display: block; }
.prog              { margin-left: auto; font-size: 11px; font-weight: 700; color: var(--muted); }

/* Score box (bilan exercice) */
.score-box        { border-radius: 16px; padding: 24px; text-align: center; margin-top: 20px; display: none; }
.score-box.show   { display: block; }
.score-emoji      { font-size: 40px; margin-bottom: 8px; }
.score-num, .sc-n { font-family: var(--font-display); font-size: 28px; font-weight: 700; margin-bottom: 4px; }
.score-msg, .sc-m { font-size: 14px; color: var(--muted); }
.sc-em            { font-size: 40px; margin-bottom: 8px; }

/* Barre de progression */
.progress-wrap  { margin-bottom: 28px; }
.progress-info  { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.progress-track { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.progress-fill  { height: 100%; border-radius: 3px; transition: width .4s ease; }

/* Phase bar (compréhension) */
.phase-bar { display: flex; gap: 8px; margin-bottom: 24px; }
.pdot {
  flex: 1; height: 5px; border-radius: 3px;
  background: var(--border); transition: all var(--t-slow);
}
.pdot.done { background: var(--ok); }

.pbadge { display: inline-block; font-size: 11px; font-weight: 800; padding: 4px 12px; border-radius: 20px; margin-bottom: 16px; }


/* ──────────────────────────────────────────────────────────────
   15. COMPOSANTS COMPRÉHENSION (lecture + tooltips)
   ────────────────────────────────────────────────────────────── */
.text-box {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 28px 32px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
  line-height: 2.1;
  font-size: 16px;
}
.text-box p              { margin-bottom: 14px; }
.text-box p:last-child   { margin-bottom: 0; }

/* Mots surlignés avec tooltip */
.hl {
  cursor: pointer;
  border-bottom: 1.5px dashed;
  position: relative;
  transition: opacity var(--t-fast);
}
.hl:hover { opacity: .8; }

.hl-tip {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #1c1c2e;
  color: white;
  font-size: 12px; font-weight: 700;
  padding: 5px 10px;
  border-radius: var(--r-sm);
  white-space: nowrap;
  z-index: 100;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--t-fast);
}
.hl:hover .hl-tip { opacity: 1; }

/* Bouton écoute texte */
.listen-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--r-md);
  border: none;
  font-family: var(--font-body);
  font-size: 13px; font-weight: 800;
  cursor: pointer;
  transition: all var(--t-fast);
  margin-bottom: 20px;
}
.listen-btn:hover { transform: translateY(-1px); }

/* Spinner de chargement IA */
.spin { display: inline-block; font-size: 48px; margin-bottom: 16px; animation: spin 1.5s linear infinite; }

.loading-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 60px 40px;
  text-align: center;
  box-shadow: var(--shadow);
}
.loading-title { font-family: var(--font-display); font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.loading-sub   { font-size: 14px; color: var(--muted); line-height: 1.7; }

/* Chips de sélection (type/thème) */
.chip-grid { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
  padding: 8px 16px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 13px; font-weight: 700;
  cursor: pointer;
  transition: all var(--t-fast);
}
.chip:hover      { border-color: var(--text); }
.chip.sel        { color: white; border-color: transparent; }

/* Onglets (tabs) */
.tabs { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-bottom: 20px; }

.tab {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 14px 10px 12px;
  cursor: pointer; text-align: center;
  transition: all var(--t-normal);
  color: inherit;
}
.tab:hover       { border-color: var(--a1); transform: translateY(-1px); }
.tab.active      { background: var(--a1); border-color: var(--a1); }

.tab-icon { font-size: 1.4rem; display: block; margin-bottom: 4px; }
.tab-name { font-size: 12px; font-weight: 800; color: var(--text); }
.tab-desc { font-size: 10px; color: var(--muted); margin-top: 2px; }
.tab.active .tab-name,
.tab.active .tab-desc { color: rgba(255,255,255,.9); }
.tab.active .tab-desc  { color: rgba(255,255,255,.65); }

/* Pills catégorie */
.cats { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.cat {
  padding: 4px 12px; border-radius: 20px;
  border: 1.5px solid var(--border); background: var(--white);
  font-size: 11px; font-weight: 700; cursor: pointer;
  transition: all var(--t-fast); color: var(--muted);
}
.cat:hover  { border-color: var(--a1); color: var(--a1); }
.cat.active { background: var(--a1); border-color: var(--a1); color: white; }

/* Grille de niveaux */
.level-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; margin-bottom: 40px; }
.level-card {
  border-radius: var(--r-lg);
  padding: 28px 22px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--t-normal);
  text-align: center;
}
.level-card:hover { transform: translateY(-3px); box-shadow: 0 12px 32px rgba(0,0,0,.1); }
.level-emoji      { font-size: 36px; margin-bottom: 10px; }
.level-name       { font-family: var(--font-display); font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.level-desc       { font-size: 12px; opacity: .75; line-height: 1.5; }

/* Items vocabulaire dans le reader */
.vitem { background: var(--white); border: 1.5px solid var(--border); border-radius: var(--r-md); padding: 16px 18px; margin-bottom: 10px; }
.vword { font-family: var(--font-display); font-size: 17px; font-weight: 700; margin-bottom: 2px; }
.ves   { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.vsent { font-size: 14px; font-weight: 600; margin-bottom: 8px; line-height: 1.9; }


/* ──────────────────────────────────────────────────────────────
   16. TABLEAUX (conjugaison, vocabulaire structuré)
   ────────────────────────────────────────────────────────────── */
.form-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.form-table th {
  background: var(--l4l); color: var(--l4d);
  font-weight: 800; padding: 10px 14px;
  text-align: left; font-size: 12px; letter-spacing: .5px;
}
.form-table td              { padding: 9px 14px; border-bottom: 1px solid var(--border); }
.form-table tr:last-child td{ border-bottom: none; }
.form-table tr:nth-child(even) td { background: var(--bg); }
.form-fr { font-weight: 700; }
.form-es { color: var(--muted); font-size: 13px; }


/* ──────────────────────────────────────────────────────────────
   17. MODAL ELEVENLABS (FAB + boîte)
   ────────────────────────────────────────────────────────────── */

/* FAB (floating action button) */
#el-fab {
  position: fixed;
  bottom: 22px; right: 22px;
  width: 46px; height: 46px;
  border-radius: 50%;
  background: #7c3aed;
  color: white; border: none;
  font-size: 20px; cursor: pointer;
  z-index: var(--z-fab);
  box-shadow: 0 4px 18px rgba(124,58,237,.45);
  display: flex; align-items: center; justify-content: center;
  transition: all var(--t-normal);
}
#el-fab:hover { transform: scale(1.1); }

/* Badge API (vocabulaire) */
.api-badge {
  position: fixed; bottom: 20px; right: 20px;
  padding: 6px 14px; border-radius: 20px;
  font-size: 11px; font-weight: 800;
  cursor: pointer; border: 1.5px solid;
  transition: all var(--t-normal);
  z-index: var(--z-fab);
  font-family: var(--font-body);
}
.api-badge.set   { background: var(--okl);  color: var(--okd);  border-color: #a7f3d0; }
.api-badge.unset { background: var(--errl); color: var(--errd); border-color: #fca5a5; }

/* Overlay modal */
#el-modal,
.overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: var(--z-modal);
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}
#el-modal.open,
.overlay.open { display: flex; }

/* Boîte EL */
#el-box,
.modal {
  background: var(--white);
  border-radius: var(--r-xl);
  padding: 28px;
  width: min(480px, 94vw);
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
  font-family: var(--font-body);
  border: 1.5px solid var(--border);
}

#el-box h2,
.modal h3 { font-family: var(--font-display); font-size: 20px; margin-bottom: 4px; }
#el-box p,
.modal p  { font-size: 12px; color: var(--muted); margin-bottom: 20px; line-height: 1.5; }

.el-label {
  font-size: 11px; font-weight: 800; letter-spacing: 1px;
  text-transform: uppercase; color: var(--muted);
  margin-bottom: 6px; display: block;
}

.el-input,
.modal input {
  width: 100%;
  border: 2px solid var(--border);
  border-radius: var(--r-md);
  padding: 10px 14px;
  font-family: var(--font-body);
  font-size: 14px; font-weight: 600;
  outline: none; margin-bottom: 14px;
}
.el-input:focus,
.modal input:focus { border-color: var(--a1); }

.el-select {
  width: 100%;
  border: 2px solid var(--border);
  border-radius: var(--r-md);
  padding: 10px 14px;
  font-family: var(--font-body);
  font-size: 14px; font-weight: 600;
  outline: none; margin-bottom: 18px;
  background: var(--bg);
}

.el-btns { display: flex; gap: 8px; flex-wrap: wrap; }

.el-btn {
  padding: 10px 18px; border-radius: var(--r-md);
  border: none; font-family: var(--font-body);
  font-size: 13px; font-weight: 800; cursor: pointer;
}

.el-status { margin-top: 12px; font-size: 13px; font-weight: 700; min-height: 20px; text-align: center; }

.modal-btn {
  width: 100%; padding: 12px;
  background: var(--a1); color: white;
  border: none; border-radius: var(--r-md);
  font-size: 15px; font-weight: 800;
  cursor: pointer; transition: background var(--t-fast);
  font-family: var(--font-body);
}
.modal-btn:hover { background: #c1121f; }


/* ──────────────────────────────────────────────────────────────
   18. UTILITAIRES & DIVERS
   ────────────────────────────────────────────────────────────── */
.speaking   { opacity: .65; pointer-events: none; }
.divider    { height: 1px; background: var(--border); margin: 28px 0; }
.word-pill  { padding: 6px 14px; border-radius: 20px; border: 1.5px solid var(--border); background: var(--bg); font-size: 13px; font-weight: 600; cursor: pointer; transition: all var(--t-fast); font-family: var(--font-body); }
.word-selector { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }

/* Liaison card */
.liaison-card    { border-radius: var(--r-md); padding: 16px 20px; margin-bottom: 10px; display: flex; align-items: center; gap: 16px; }
.liaison-text    { font-family: var(--font-display); font-size: 18px; font-weight: 700; }
.liaison-phonetic{ font-size: 13px; font-style: italic; margin-left: 8px; opacity: .7; }
.liaison-es      { font-size: 13px; color: var(--muted); }

/* Info-boxes colorées */
.info-box {
  border-radius: var(--r-md);
  padding: 14px 18px;
  margin-bottom: 16px;
  font-size: 14px;
  line-height: 1.6;
}

/* Reader title (compréhension) */
.reader-title { font-family: var(--font-display); font-size: 26px; font-weight: 700; line-height: 1.2; margin-bottom: 6px; }


/* ──────────────────────────────────────────────────────────────
   19. NAVIGATION MOBILE (mob-nav)
   ────────────────────────────────────────────────────────────── */
.mob-nav {
  display: none;
  overflow-x: auto;
  gap: 6px;
  padding: 12px 16px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.mob-nav-btn {
  flex-shrink: 0;
  padding: 7px 13px;
  border-radius: 20px;
  border: none;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  background: var(--bg);
  color: var(--muted);
  transition: background var(--t-fast), color var(--t-fast);
}
.mob-nav-btn.active { color: white; }

/* ──────────────────────────────────────────────────────────────
   20. READ ALOUD — Composant moteur.js buildReadAloud()
   ────────────────────────────────────────────────────────────── */
.ra-item {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  margin-bottom: 12px;
}
.ra-phrase {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
  line-height: 1.4;
}
.ra-translation {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 14px;
}
.ra-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 8px;
}
.ra-btn {
  border: none;
  border-radius: var(--r-sm);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font-body);
  transition: opacity var(--t-fast);
}
.ra-btn:hover { opacity: .85; }
.ra-status {
  font-size: 12px;
  color: var(--muted);
  min-height: 16px;
}
.ra-compare {
  display: none;
  gap: 8px;
  flex-wrap: wrap;
}
.ra-cmp-btn {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font-body);
  transition: border-color var(--t-fast);
}
.ra-cmp-btn:hover { border-color: var(--text); }

/* ──────────────────────────────────────────────────────────────
   21. GRAMMAR BOX — Encadrés grammaticaux (B1+)
   ────────────────────────────────────────────────────────────── */
.grammar-box {
  background: var(--l1l);
  border-left: 4px solid var(--l1);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  padding: 14px 18px;
  margin-bottom: 18px;
  font-size: 14px;
  line-height: 1.7;
}
.grammar-box strong {
  color: var(--l1d);
  font-family: var(--font-display);
  font-size: 15px;
}
.grammar-box .ex {
  margin-top: 6px;
  font-style: italic;
  color: var(--text);
  opacity: .85;
}

/* ──────────────────────────────────────────────────────────────
   22. DIALOGUE — Labels et traductions (a2-module*.html)
   ────────────────────────────────────────────────────────────── */
.dial-trad {
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
  margin-top: 2px;
}
.dial-section-label {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 14px 0 8px;
}

/* ──────────────────────────────────────────────────────────────
   23. RESPONSIVE — Mobile
   ────────────────────────────────────────────────────────────── */
@media (max-width: 700px) {
  .sidebar        { display: none; }
  .main           { padding: 20px 16px; }
  .level-grid     { grid-template-columns: 1fr; }
  .text-box       { padding: 18px 16px; }
  .match-wrap     { grid-template-columns: 1fr; }
  .tabs           { grid-template-columns: 1fr; gap: 6px; }
  .mob-nav        { display: flex; }
}

@media (max-width: 500px) {
  .card-top       { padding: 24px 18px; min-height: 160px; }
  .card-word      { font-size: 2rem; }
  .header-title   { display: none; }
  .phone-grid     { grid-template-columns: repeat(auto-fill, minmax(100px,1fr)); }
}

/* ──────────────────────────────────────────────────────────────
   20. READ ALOUD — Composant moteur.js buildReadAloud()
   ────────────────────────────────────────────────────────────── */
.ra-item {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  margin-bottom: 12px;
}
.ra-phrase {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
  line-height: 1.4;
}
.ra-translation {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 14px;
}
.ra-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 8px;
}
.ra-btn {
  border: none;
  border-radius: var(--r-sm);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font-body);
  transition: opacity var(--t-fast);
}
.ra-btn:hover { opacity: .85; }
.ra-status {
  font-size: 12px;
  color: var(--muted);
  min-height: 16px;
}
.ra-compare {
  display: none;
  gap: 8px;
  flex-wrap: wrap;
}
.ra-cmp-btn {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font-body);
  transition: border-color var(--t-fast);
}
.ra-cmp-btn:hover { border-color: var(--text); }

/* ──────────────────────────────────────────────────────────────
   21. GRAMMAR BOX — Encadrés grammaticaux (B1+)
   ────────────────────────────────────────────────────────────── */
.grammar-box {
  background: var(--l1l);
  border-left: 4px solid var(--l1);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  padding: 14px 18px;
  margin-bottom: 18px;
  font-size: 14px;
  line-height: 1.7;
}
.grammar-box strong {
  color: var(--l1d);
  font-family: var(--font-display);
  font-size: 15px;
}
.grammar-box .ex {
  margin-top: 6px;
  font-style: italic;
  color: var(--text);
  opacity: .85;
}

/* ──────────────────────────────────────────────────────────────
   22. DIALOGUE — Labels et traductions (a2-module*.html)
   ────────────────────────────────────────────────────────────── */
.dial-trad {
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
  margin-top: 2px;
}
.dial-section-label {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 14px 0 8px;
}

/* ──────────────────────────────────────────────────────────────
   23. RESPONSIVE — Mobile
   ────────────────────────────────────────────────────────────── */
@media (max-width: 700px) {
  .sidebar        { display: none; }
  .main           { padding: 20px 16px; }
  .level-grid     { grid-template-columns: 1fr; }
  .text-box       { padding: 18px 16px; }
  .match-wrap     { grid-template-columns: 1fr; }
  .tabs           { grid-template-columns: 1fr; gap: 6px; }
  .mob-nav        { display: flex; }
}

@media (max-width: 500px) {
  .card-top       { padding: 24px 18px; min-height: 160px; }
  .card-word      { font-size: 2rem; }
  .header-title   { display: none; }
  .phone-grid     { grid-template-columns: repeat(auto-fill, minmax(100px,1fr)); }
}
