:root {
  --bg: #F6F7FB;
  --surface: #FFFFFF;
  --surface-muted: #F0F1F8;
  --border: rgba(30, 34, 53, 0.09);
  --border-strong: rgba(30, 34, 53, 0.16);
  --text: #1E2235;
  --text-secondary: #5B5F76;
  --text-muted: #9397AC;

  --accent: #4C5FD5;
  --accent-hover: #3F50BE;
  --accent-bg: #EEF0FF;
  --accent-fg: #3745B0;

  --aqua: #D23D7A;
  --aqua-bg: #FCEAF1;
  --orange: #D9731C;
  --orange-bg: #FDEEE1;
  --slate: #6B7085;
  --slate-bg: #EEEFF5;

  --green: #2F9E52;
  --green-bg: #E7F7EC;
  --amber: #B9790F;
  --amber-bg: #FCF2DF;
  --red: #D9484A;
  --red-bg: #FDEBEC;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;

  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 1px rgba(16, 24, 40, 0.04);
  --shadow-md: 0 6px 16px rgba(16, 24, 40, 0.08);
  --shadow-lift: 0 10px 24px rgba(16, 24, 40, 0.12);

  --font: "Nunito", "Segoe UI", Tahoma, Arial, sans-serif;
  --font-display: "Baloo 2", "Nunito", "Segoe UI", Tahoma, Arial, sans-serif;

  /* Matière color (default fallback, overridden by .subj-* below) */
  --m: var(--accent);
  --m-bg: var(--accent-bg);
  --m-fg: var(--accent-fg);
  --m-hover: var(--accent-hover);
}

/* ---------- Matière color palette ---------- */
.subj-blue { --m: var(--accent); --m-bg: var(--accent-bg); --m-fg: var(--accent-fg); --m-hover: var(--accent-hover); }
.subj-orange { --m: #FF7A45; --m-bg: #FFF1E6; --m-fg: #B2501F; --m-hover: #E8652E; }
.subj-teal { --m: #1C8C8C; --m-bg: #E3F6F6; --m-fg: #136363; --m-hover: #167575; }
.subj-purple { --m: #8B4FC7; --m-bg: #F5EAFB; --m-fg: #6B3999; --m-hover: #7A3FB4; }
.subj-green { --m: #2F9E52; --m-bg: #E7F7EC; --m-fg: #1F7A3D; --m-hover: #278C47; }
.subj-red { --m: #E0524F; --m-bg: #FDEBEC; --m-fg: #B03A38; --m-hover: #C94744; }
.subj-amber { --m: #D99A1B; --m-bg: #FCF2DF; --m-fg: #9C6C0E; --m-hover: #C28A17; }
.subj-cyan { --m: #2AA7C9; --m-bg: #E7F6FA; --m-fg: #1D7A93; --m-hover: #2593B0; }
.subj-brown { --m: #9C6B4A; --m-bg: #F3EAE3; --m-fg: #754F35; --m-hover: #875D3F; }
.subj-pink { --m: #D6548F; --m-bg: #FCEAF1; --m-fg: #A83A6B; --m-hover: #C24A7E; }

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg); color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}
[v-cloak] { display: none; }
button, input { font-family: inherit; }

a, button, .leaf, .matiere-card, .todo-card, .choix-row, button.flashcard-btn {
  outline: none;
}
a:focus-visible, button:focus-visible, .leaf:focus-visible, .matiere-card:focus-visible,
.todo-card:focus-visible, .choix-row:focus-visible, input:focus-visible {
  box-shadow: 0 0 0 3px var(--accent-bg), 0 0 0 1px var(--accent);
  border-radius: var(--radius-sm);
}

#app { min-height: 100vh; }
.content { width: 100%; min-height: 100vh; }
.home-wrap { max-width: 820px; margin: 0 auto; padding: 12px 24px 60px; }

/* ---------- Skeleton loader ---------- */
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
.skeleton-line { background: var(--surface-muted); border-radius: var(--radius-sm); animation: pulse 1.4s ease-in-out infinite; }
.skeleton-title { width: 220px; height: 28px; margin-bottom: 24px; }
.skeleton-label { width: 140px; height: 14px; margin-bottom: 12px; }
.skeleton-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.skeleton-card { height: 96px; background: var(--surface-muted); border-radius: var(--radius-lg); animation: pulse 1.4s ease-in-out infinite; }

/* ---------- Typography / section labels ---------- */
.brand-logo { height: 128px; display: block; margin: 0 0 10px; direction: ltr; }
.brand-logo-small { height: 76px; margin: 0 0 20px; cursor: pointer; transition: opacity 0.15s ease; }
.brand-logo-small:hover { opacity: 0.8; }
.hello { font-family: var(--font-display); font-size: 26px; font-weight: 800; margin: 0 0 28px; letter-spacing: -0.01em; }
.hello-name { color: #FF7A45; }
.hello-wave { display: inline-block; }
.section-label { font-family: var(--font-display); font-size: 13px; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.04em; margin: 0 0 12px; }
.section-label.small { margin-top: 22px; }
.section-sublabel { font-size: 12px; font-weight: 600; color: var(--text-muted); margin: 14px 0 8px; text-transform: uppercase; letter-spacing: 0.03em; }
.empty, .menu-empty { font-size: 13px; color: var(--text-muted); padding: 8px 0; }

.empty-state { text-align: center; padding: 32px 20px; color: var(--text-muted); }
.empty-state i { font-size: 32px; color: var(--aqua); }
.empty-state p { margin: 8px 0 0; font-size: 14px; font-weight: 600; }

/* ---------- Home: subject cards ---------- */
.matiere-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.matiere-card {
  border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 22px 16px;
  text-align: center; cursor: pointer; background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.matiere-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); border-color: var(--border-strong); }
.matiere-card:active { transform: translateY(-1px) scale(0.99); }
.matiere-card-icon {
  width: 52px; height: 52px; margin: 0 auto 12px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center; font-size: 24px;
}
.matiere-card p { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 15px; }
.matiere-card-icon { background: var(--m-bg); color: var(--m); }

/* ---------- Home: nouveautés list ---------- */
.todo-list { display: flex; flex-direction: column; gap: 10px; }
.todo-card {
  display: flex; align-items: center; gap: 12px; background: var(--surface);
  border: 1px solid var(--border); border-inline-start: 4px solid var(--m);
  border-radius: var(--radius); padding: 12px 14px; cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.todo-card:hover { transform: translateX(2px); box-shadow: var(--shadow-md); }
.todo-icon {
  width: 38px; height: 38px; border-radius: 11px; flex-shrink: 0;
  background: var(--m-bg); color: var(--m);
  display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.todo-text { flex: 1; min-width: 0; }
.todo-title { margin: 0; font-family: var(--font-display); font-size: 14.5px; font-weight: 700; }
.todo-sub { margin: 2px 0 0; font-size: 12.5px; color: var(--text-secondary); }
.todo-chevron { font-size: 16px; color: var(--text-muted); flex-shrink: 0; }

.badge { font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px; flex-shrink: 0; }
.badge-reference { background: var(--slate-bg); color: var(--slate); }
.badge-entrainement { background: var(--aqua-bg); color: var(--aqua); }
.badge-evaluation { background: var(--orange-bg); color: var(--orange); }

/* ---------- Matière screen layout ---------- */
.matiere-screen { display: flex; gap: 0; width: 100%; min-height: 100vh; align-items: stretch; }
.matiere-menu {
  width: 260px; flex-shrink: 0; border-inline-end: 1px solid var(--border);
  padding: 20px 14px; background: var(--surface); overflow-y: auto;
}
.matiere-titre-row { display: flex; align-items: center; gap: 10px; margin: 0 0 18px; }
.matiere-titre-icon {
  width: 34px; height: 34px; border-radius: 10px; background: var(--m-bg); color: var(--m);
  display: flex; align-items: center; justify-content: center; font-size: 17px; flex-shrink: 0;
}
.matiere-titre { font-family: var(--font-display); font-size: 17px; font-weight: 800; margin: 0; }

.menu-section { margin-bottom: 2px; }
.menu-section-header {
  display: flex; align-items: center; gap: 7px; padding: 8px 6px; font-size: 13px; font-weight: 700;
  font-family: var(--font-display);
  cursor: pointer; border-radius: var(--radius-sm); transition: background 0.15s ease;
}
.menu-section-header:hover { background: var(--surface-muted); }
.menu-section-header i { font-size: 14px; color: var(--text-muted); }
.menu-section-body { margin-inline-start: 16px; margin-bottom: 6px; }
.leaf {
  display: flex; align-items: center; gap: 7px; padding: 7px 8px; font-size: 13px;
  color: var(--text-secondary); cursor: pointer; border-radius: var(--radius-sm);
  transition: background 0.15s ease, color 0.15s ease;
}
.leaf:hover { background: var(--surface-muted); }
.leaf.selected { background: var(--m-bg); color: var(--m-fg); font-weight: 700; }
.leaf-icon { font-size: 14px; color: var(--m); }
.chapitre-leaf { font-family: var(--font-display); font-weight: 700; color: var(--text); }
.chapitre-body { margin-inline-start: 16px; }
.activite-leaf { font-size: 12.5px; }
.pedagogie-group { margin-bottom: 2px; }
.pedagogie-label { font-size: 10.5px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; padding: 6px 8px 2px; }

/* ---------- Content panel ---------- */
.matiere-content { flex: 1; min-width: 0; padding: 36px 28px; display: flex; flex-direction: column; align-items: center; }
.reference-frame { width: 100%; max-width: 920px; height: calc(100vh - 80px); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.mindmap-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(17, 20, 32, 0.55);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.mindmap-popup {
  width: min(1100px, 100%); height: min(760px, 90vh);
  background: var(--surface); border-radius: var(--radius-xl);
  box-shadow: 0 24px 60px rgba(16, 24, 40, 0.35);
  display: flex; flex-direction: column; overflow: hidden;
}
.mindmap-overlay-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.mindmap-close {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text-secondary); font-size: 16px;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  transition: background 0.15s ease;
}
.mindmap-close:hover { background: var(--surface-muted); }
.mindmap-overlay-body { position: relative; flex: 1; min-height: 0; }
#jsmind-container { width: 100%; height: 100%; background: var(--surface); cursor: grab; direction: ltr; }
#jsmind-container:active { cursor: grabbing; }
.mindmap-zoom-controls {
  position: absolute; inset-inline-end: 20px; bottom: 20px; z-index: 10; display: flex; flex-direction: column; gap: 8px;
}
.mindmap-zoom-controls button {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border-strong);
  background: var(--surface); box-shadow: var(--shadow-md); color: var(--text);
  font-size: 18px; display: flex; align-items: center; justify-content: center; cursor: pointer;
  transition: background 0.15s ease;
}
.mindmap-zoom-controls button:hover { background: var(--surface-muted); }
#jsmind-container jmnode {
  font-family: var(--font) !important;
  font-size: 13px !important; font-weight: 700 !important;
  background: var(--m-bg) !important;
  color: var(--m-fg) !important;
  border: none !important;
  border-radius: 10px !important;
  box-shadow: none !important;
  padding: 7px 14px !important;
  transition: background 0.15s ease, color 0.15s ease;
}
#jsmind-container jmnode.root {
  background: var(--text) !important;
  color: #fff !important;
  font-weight: 800 !important;
  font-size: 15px !important;
  padding: 12px 20px !important;
}
#jsmind-container jmnode:hover { background: var(--m) !important; color: #fff !important; }
#jsmind-container jmexpander {
  border-color: var(--border-strong) !important;
  color: var(--text-muted) !important;
  background: var(--surface) !important;
}
.placeholder { color: var(--text-muted); font-size: 14px; margin: 60px auto; text-align: center; }

.activite-titre { font-family: var(--font-display); font-size: 19px; font-weight: 800; margin: 0; }
.activite-detail-header { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 20px; }
.activite-icon-badge {
  width: 46px; height: 46px; border-radius: 14px; flex-shrink: 0;
  background: var(--m-bg); color: var(--m);
  display: flex; align-items: center; justify-content: center; font-size: 21px;
}
.activite-sub { font-size: 13px; color: var(--text-secondary); margin: 4px 0 0; display: flex; align-items: center; gap: 6px; font-weight: 600; }
.activite-detail { width: 100%; max-width: 460px; }

/* ---------- Buttons ---------- */
.btn-primary {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; max-width: 420px; margin-inline: auto;
  background: var(--m); color: #fff; border: none; border-radius: var(--radius);
  font-size: 15px; font-weight: 700; padding: 13px; cursor: pointer; margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
  transition: background 0.18s ease, transform 0.1s ease, box-shadow 0.18s ease;
}
.btn-primary:hover:not(:disabled) { background: var(--m-hover); box-shadow: var(--shadow-md); }
.btn-primary:active:not(:disabled) { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }

.btn-secondary {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; max-width: 420px; margin-inline: auto;
  background: var(--surface); color: var(--text); border: 1px solid var(--border-strong);
  border-radius: var(--radius); font-size: 15px; font-weight: 700; padding: 13px; cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.btn-secondary:hover { background: var(--surface-muted); border-color: var(--text-muted); }

.btn-ghost {
  background: var(--amber-bg); border: none; border-radius: var(--radius);
  font-size: 13px; font-weight: 700; padding: 9px 14px; color: var(--amber); cursor: pointer;
  display: flex; align-items: center; gap: 6px;
  transition: background 0.15s ease, transform 0.1s ease;
}
.btn-ghost:hover { background: #F9E6C4; }
.btn-ghost:active { transform: scale(0.98); }

/* ---------- Tentatives / résultats ---------- */
.tentatives-list { display: flex; flex-direction: column; gap: 8px; max-width: 420px; margin-inline: auto; }
.tentative-row { display: flex; align-items: center; justify-content: space-between; border: 1px solid var(--border); border-radius: var(--radius); padding: 11px 14px; background: var(--surface); box-shadow: var(--shadow-sm); }
.tentative-date { margin: 0; font-size: 13px; font-weight: 700; }
.tentative-duree { margin: 0; font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 4px; }

.score { font-size: 15px; font-weight: 800; }
.score.good { color: var(--green); }
.score.mid { color: var(--amber); }
.score.bad { color: var(--red); }

.flash-bar-wrap { min-width: 150px; }
.flash-bar { display: flex; gap: 2px; height: 7px; border-radius: 4px; overflow: hidden; }
.flash-bar-easy { background: var(--green); }
.flash-bar-medium { background: #E0A233; }
.flash-bar-hard { background: var(--red); }
.flash-bar-legend { margin: 5px 0 0; font-size: 11px; color: var(--text-muted); font-weight: 600; }

/* ---------- Player (quiz / flashcards / examen) ---------- */
.player { width: 100%; max-width: 480px; }
.player-top { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--text-muted); font-weight: 700; margin-bottom: 8px; }
.progress-bar { height: 8px; background: var(--surface-muted); border-radius: 999px; overflow: hidden; margin-bottom: 24px; }
.progress-fill { height: 100%; background: var(--m); border-radius: 999px; transition: width 0.35s ease; }

.question-enonce { font-size: 18px; font-weight: 800; line-height: 1.5; margin: 0 0 4px; white-space: pre-line; }
.question-hint-type { font-size: 13px; color: var(--text-secondary); margin: 0 0 16px; font-weight: 600; }

.choix-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.choix-row {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  border: 1.5px solid var(--border); border-radius: var(--radius); padding: 13px 14px 13px 44px;
  font-size: 14.5px; font-weight: 600; cursor: pointer; background: var(--surface);
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
}
.choix-row:hover { border-color: var(--m); background: var(--m-bg); }
.choix-row:active { transform: scale(0.995); }
.choix-row input[type="radio"], .choix-row input[type="checkbox"] {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 20px; height: 20px; margin: 0; opacity: 0; cursor: pointer;
}
.choix-indicator {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 20px; height: 20px; border: 2px solid var(--border-strong); border-radius: 6px;
  background: var(--surface); flex-shrink: 0; transition: all 0.15s ease;
}
.choix-indicator.round { border-radius: 50%; }
.choix-row input:checked + .choix-indicator { border-color: var(--m); background: var(--m); }
.choix-row input:checked + .choix-indicator::after {
  content: ''; position: absolute; left: 6px; top: 2px; width: 5px; height: 10px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.choix-texte { flex: 1; }
.choix-icon { font-size: 18px; flex-shrink: 0; }
.choix-icon.correct { color: var(--green); }
.choix-icon.incorrect { color: var(--red); }

.choix-row.correct { border-color: var(--green); background: var(--green-bg); color: var(--green); }
.choix-row.correct .choix-indicator { border-color: var(--green); background: var(--green); }
.choix-row.incorrect { border-color: var(--red); background: var(--red-bg); color: var(--red); }
.choix-row.incorrect .choix-indicator { border-color: var(--red); background: var(--red); }
.choix-row.missed { border-color: var(--green); border-style: dashed; background: var(--surface); color: var(--green); }

.hint-zone { margin-bottom: 16px; }
.hint-text { font-size: 13.5px; color: var(--amber); background: var(--amber-bg); border-radius: var(--radius); padding: 10px 12px; margin: 8px 0 0; font-weight: 600; line-height: 1.5; white-space: pre-line; }

.explication-box { background: var(--m-bg); border-radius: var(--radius); padding: 14px; margin-bottom: 18px; }
.explication-label { margin: 0 0 4px; font-size: 12px; font-weight: 800; color: var(--m-fg); text-transform: uppercase; letter-spacing: 0.03em; }
.explication-box p:last-child { margin: 0; font-size: 14px; line-height: 1.5; color: var(--text); white-space: pre-line; }

/* ---------- End screens ---------- */
.end-screen { text-align: center; padding-top: 16px; }
.end-icon-circle {
  width: 72px; height: 72px; margin: 0 auto; border-radius: 50%;
  background: var(--aqua-bg); display: flex; align-items: center; justify-content: center;
}
.end-icon-circle-success { background: var(--green-bg); }
.end-icon { font-size: 32px; color: var(--aqua); }
.end-icon-circle-success .end-icon { color: var(--green); }
.end-title { font-size: 19px; font-weight: 800; margin: 16px 0 4px; }
.end-score { font-size: 38px; font-weight: 900; color: var(--green); margin: 0 0 18px; letter-spacing: -0.02em; }
.end-stats { display: flex; justify-content: center; gap: 24px; font-size: 13px; color: var(--text-secondary); font-weight: 700; margin-bottom: 22px; }
.end-stats i { margin-inline-end: 4px; }
.end-bar { max-width: 280px; margin: 0 auto 20px; }

/* ---------- Flashcards (3D flip) ---------- */
.flashcard-btn {
  display: block; width: 100%; border: none; background: none; padding: 0; margin-bottom: 16px;
  cursor: pointer; perspective: 1400px;
}
.flashcard-btn:disabled { cursor: default; }
.flashcard-inner {
  position: relative; display: block; width: 100%; min-height: 190px;
  transition: transform 0.5s cubic-bezier(0.4, 0.2, 0.2, 1);
  transform-style: preserve-3d;
}
.flashcard-btn.flipped .flashcard-inner { transform: rotateY(180deg); }
.flashcard-face {
  position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  border-radius: var(--radius-lg); padding: 30px 22px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  box-shadow: var(--shadow-sm);
}
.flashcard-front { background: var(--surface); border: 1.5px solid var(--border); }
.flashcard-btn:not(:disabled):hover .flashcard-front { border-color: var(--m); box-shadow: var(--shadow-md); }
.flashcard-back { background: var(--m-bg); border: 1.5px solid var(--m); transform: rotateY(180deg); }
.flashcard-recto { font-size: 20px; font-weight: 800; margin: 0; text-align: center; }
.flashcard-tap-hint { font-size: 12.5px; color: var(--text-muted); font-weight: 700; display: flex; align-items: center; gap: 6px; margin: 0; }
.flashcard-label { font-size: 12px; color: var(--m); margin: 0; text-transform: uppercase; letter-spacing: 0.03em; font-weight: 800; }
.flashcard-verso { font-size: 17px; line-height: 1.55; margin: 0; color: var(--m-fg); font-weight: 700; text-align: center; }

.rate-label { text-align: center; font-size: 13px; color: var(--text-secondary); margin-bottom: 10px; font-weight: 700; }
.rate-row { display: flex; gap: 10px; }
.btn-rate {
  flex: 1; border: 1.5px solid; border-radius: var(--radius); font-size: 13.5px; font-weight: 800;
  padding: 11px; cursor: pointer; background: var(--surface);
  transition: background 0.15s ease, transform 0.1s ease;
}
.btn-rate:active { transform: scale(0.97); }
.btn-rate.hard { border-color: var(--red); color: var(--red); }
.btn-rate.hard:hover { background: var(--red-bg); }
.btn-rate.medium { border-color: #E0A233; color: var(--amber); }
.btn-rate.medium:hover { background: var(--amber-bg); }
.btn-rate.easy { border-color: var(--green); color: var(--green); }
.btn-rate.easy:hover { background: var(--green-bg); }

/* ---------- Examen ---------- */
.examen-top { display: flex; justify-content: flex-end; margin-bottom: 10px; }
.examen-chrono {
  font-size: 13px; font-weight: 800; color: var(--text-secondary);
  display: flex; align-items: center; gap: 6px;
  background: var(--surface-muted); border-radius: 999px; padding: 6px 14px;
}
.examen-chrono.low { color: var(--red); background: var(--red-bg); }
.examen-titre { font-size: 19px; font-weight: 800; margin: 0 0 18px; }
.examen-questions { display: flex; flex-direction: column; gap: 16px; margin-bottom: 22px; }
.examen-question { border-bottom: 1px solid var(--border); padding-bottom: 12px; }
.examen-question-num { margin: 0 0 6px; font-size: 11.5px; font-weight: 800; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; }
.examen-enonce { margin: 0; font-size: 14.5px; line-height: 1.6; font-weight: 600; white-space: pre-line; }
.examen-bareme { margin: 4px 0 0; font-size: 12px; color: var(--text-muted); font-weight: 700; }
.examen-fin-msg { font-size: 14.5px; color: var(--text-secondary); margin: 0 0 22px; font-weight: 600; }
.examen-resultats { margin: 20px auto 0; max-width: 420px; width: 100%; }
.examen-commentaire { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; font-size: 13.5px; background: var(--surface); }

/* ---------- Corrigé d'examen (consultation, pas de player) ---------- */
.corrige-detail { max-width: 560px; }
.corrige-question { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 14px; background: var(--surface); box-shadow: var(--shadow-sm); }
.corrige-question-num { margin: 0 0 6px; font-size: 11.5px; font-weight: 800; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; }
.corrige-enonce { margin: 0 0 12px; font-size: 14.5px; line-height: 1.6; font-weight: 600; white-space: pre-line; }
.corrige-solution-label { margin: 0 0 4px; font-size: 11.5px; font-weight: 800; color: var(--green); text-transform: uppercase; letter-spacing: 0.03em; }
.corrige-solution { margin: 0 0 10px; font-size: 14.5px; line-height: 1.55; font-weight: 700; color: var(--green); white-space: pre-line; }
.corrige-explication { margin: 0; font-size: 13.5px; line-height: 1.55; color: var(--text-secondary); white-space: pre-line; }

@media (max-width: 767px) {
  .home-wrap { padding: 12px 16px 48px; }
  .matiere-screen { flex-direction: column; }
  .matiere-menu { width: auto; max-height: 48vh; border-inline-end: none; border-bottom: 1px solid var(--border); }
  .matiere-content { padding: 20px 16px; }
}

/* ---------- Auth (login / changement de mot de passe obligatoire) ---------- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl); box-shadow: var(--shadow-lift); padding: 32px 28px; text-align: center; }
.auth-card .brand-logo { margin: 0 auto 18px; }
.auth-title { font-family: var(--font-display); font-size: 19px; font-weight: 800; margin: 0 0 6px; }
.auth-sub { font-size: 13.5px; color: var(--text-secondary); margin: 0 0 22px; line-height: 1.5; }
.auth-error { display: flex; align-items: center; gap: 8px; background: var(--red-bg); color: var(--red); font-size: 13px; font-weight: 700; border-radius: var(--radius); padding: 10px 12px; margin-bottom: 16px; text-align: start; }
.auth-form { text-align: start; }
.form-group { margin-bottom: 16px; text-align: start; }
.form-label { display: block; font-size: 12.5px; font-weight: 700; color: var(--text-secondary); margin-bottom: 6px; }
.form-input {
  width: 100%; border: 1.5px solid var(--border-strong); border-radius: var(--radius); background: var(--surface);
  padding: 11px 13px; font-size: 14.5px; color: var(--text); transition: border-color 0.15s ease;
}
.form-input:focus { border-color: var(--accent); outline: none; }
.pw-rules { list-style: none; margin: 14px 0 0; padding: 0; text-align: start; display: flex; flex-direction: column; gap: 6px; }
.pw-rules li { font-size: 12.5px; color: var(--text-muted); display: flex; align-items: center; gap: 7px; font-weight: 600; }
.pw-rules li.ok { color: var(--green); }
.pw-rules li i { font-size: 15px; }

/* ---------- Error toast (échec d'enregistrement d'une tentative, etc.) ---------- */
.toast-error {
  position: fixed; bottom: 20px; inset-inline-start: 50%; transform: translateX(-50%);
  background: var(--red); color: #fff; font-size: 13.5px; font-weight: 700;
  border-radius: var(--radius); padding: 12px 18px; box-shadow: var(--shadow-lift);
  display: flex; align-items: center; gap: 10px; z-index: 200; max-width: min(420px, 90vw);
}
.toast-error button { background: none; border: none; color: #fff; cursor: pointer; font-size: 16px; display: flex; flex-shrink: 0; }

/* ---------- Logout ---------- */
.logout-btn {
  display: flex; align-items: center; gap: 6px; background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 12.5px; font-weight: 700; padding: 6px 2px; margin-top: 10px;
  transition: color 0.15s ease;
}
.logout-btn:hover { color: var(--red); }
.home-header-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
