/* public/css/formations.css
   Lecteur de QCM « Mes Formations » INTÉGRÉ À LA SPA (overlay), porté de
   frontend/src/formations/formations.css. Toutes les classes sont préfixées .fm-
   (lecteur/accordéon) et .fmq- (overlay) pour ne pas heurter le design system DA. */

:root {
  --fm-violet:    #7C3AED;
  --fm-violet-d:  #6D28D9;
  --fm-violet-bg: #F5F3FF;
  --fm-ink:       #14121F;
  --fm-muted:     #475569;
  --fm-line:      #E7E3F5;
  --fm-ok:        #16A34A;
  --fm-ok-bg:     #ECFDF5;
  --fm-ko:        #DC2626;
  --fm-ko-bg:     #FEF2F2;
  --fm-amber:     #D97706;
}

/* ── Overlay plein écran ── */
.fmq-overlay {
  position: fixed; inset: 0; z-index: 4000; display: none;
  background: #FBFAFF; overflow-y: auto; padding: 40px 20px 60px;
  font-family: 'DM Sans', system-ui, sans-serif; color: var(--fm-ink);
}
.fmq-card { max-width: 860px; margin: 0 auto; }
.fmq-summary { background: #fff; border: 1px solid var(--fm-line); border-radius: 16px; padding: 18px; margin-bottom: 16px; }

/* ── Badges déclencheurs (carte doc + en-tête doc) ── */
.badge-formation {
  display: inline-flex; align-items: center; gap: 4px; cursor: pointer;
  background: var(--fm-violet-bg) !important; color: var(--fm-violet-d) !important;
  border: 1px solid #c4b5fd !important;
}
.badge-formation:hover { background: #ede9fe !important; }
.fm-cta {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 8px;
  font-family: 'DM Sans', sans-serif; font-weight: 700; font-size: 13px;
  border-radius: 10px; padding: 7px 14px; cursor: pointer;
  background: var(--fm-violet); color: #fff; border: 1px solid var(--fm-violet-d);
  box-shadow: 0 2px 0 var(--fm-violet-d);
}
.fm-cta:hover { background: var(--fm-violet-d); }

/* ── Titres / textes ── */
.fm-h1, .fm-h2 { font-family: 'Syne', 'DM Sans', sans-serif; font-weight: 800; letter-spacing: -0.01em; margin: 0; color: var(--fm-ink); }
.fm-h1 { font-size: 30px; }
.fm-h2 { font-size: 20px; margin: 28px 0 14px; }
.fm-sub { color: var(--fm-muted); margin: 6px 0 0; font-size: 14px; }
.fm-back { background: none; border: none; color: var(--fm-violet-d); font-weight: 700; cursor: pointer; padding: 0; margin-bottom: 10px; font-size: 14px; }
.fm-empty { text-align: center; color: var(--fm-muted); padding: 40px 20px; }
.fm-error { background: var(--fm-ko-bg); color: var(--fm-ko); border: 1px solid #f3c8c8; border-radius: 12px; padding: 12px 16px; margin: 14px 0; font-size: 14px; }

/* ── Boutons ── */
.fm-btn { font-family: 'DM Sans', sans-serif; font-weight: 700; font-size: 14px; border-radius: 12px; padding: 10px 18px; cursor: pointer; border: 1px solid transparent; transition: transform .06s ease, box-shadow .12s ease, background .12s ease; }
.fm-btn:active { transform: translateY(1px); }
.fm-btn-primary { background: var(--fm-violet); color: #fff; box-shadow: 0 2px 0 var(--fm-violet-d); }
.fm-btn-primary:hover { background: var(--fm-violet-d); }
.fm-btn-ghost { background: #fff; color: var(--fm-violet-d); border-color: var(--fm-line); }
.fm-btn-ghost:hover { background: var(--fm-violet-bg); }
.fm-btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── Chips ── */
.fm-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--fm-violet-bg); color: var(--fm-violet-d); }
.fm-chip-amber { background: #FFF7ED; color: var(--fm-amber); }
.fm-chip-grey  { background: #F3F4F6; color: var(--fm-muted); }

/* ── Lecteur de QCM ── */
.fm-player { max-width: 820px; margin: 0 auto; }
.fm-player-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 8px; }
.fm-timer { font-family: 'DM Mono', monospace; font-weight: 700; font-size: 18px; color: var(--fm-violet-d); }
.fm-timer.fm-timer-low { color: var(--fm-ko); }
.fm-progress { height: 8px; background: var(--fm-line); border-radius: 999px; overflow: hidden; margin: 8px 0 18px; }
.fm-progress > div { height: 100%; background: linear-gradient(90deg, var(--fm-violet), #a78bfa); transition: width .25s ease; }
.fm-dots { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.fm-dot { width: 26px; height: 26px; border-radius: 8px; border: 1px solid var(--fm-line); background: #fff; font-size: 12px; font-weight: 700; cursor: pointer; color: var(--fm-muted); }
.fm-dot.cur { border-color: var(--fm-violet); color: var(--fm-violet-d); box-shadow: 0 0 0 2px var(--fm-violet-bg); }
.fm-dot.done { background: var(--fm-violet-bg); color: var(--fm-violet-d); }

.fm-qcard { background: #fff; border: 1px solid var(--fm-line); border-radius: 16px; padding: 22px; }
.fm-q-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.fm-scenario { background: #FAFAFB; border-left: 3px solid var(--fm-violet); border-radius: 8px; padding: 12px 14px; margin-bottom: 14px; font-size: 14px; line-height: 1.5; }
.fm-q-text { font-size: 17px; font-weight: 600; line-height: 1.45; margin-bottom: 6px; }
.fm-pre { background: var(--fm-violet-bg); border-radius: 10px; padding: 12px 14px; margin: 12px 0; font-size: 13.5px; line-height: 1.5; }

.fm-opts { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.fm-opt { display: flex; gap: 12px; align-items: flex-start; border: 1.5px solid var(--fm-line); border-radius: 12px; padding: 12px 14px; cursor: pointer; background: #fff; transition: border-color .12s, background .12s; text-align: left; width: 100%; }
.fm-opt:hover { border-color: #c4b5fd; }
.fm-opt.sel { border-color: var(--fm-violet); background: var(--fm-violet-bg); }
.fm-opt.correct { border-color: var(--fm-ok); background: var(--fm-ok-bg); }
.fm-opt.wrong { border-color: var(--fm-ko); background: var(--fm-ko-bg); }
.fm-opt.disabled { cursor: default; }
.fm-opt-letter { flex: 0 0 28px; height: 28px; border-radius: 8px; background: var(--fm-violet-bg); color: var(--fm-violet-d); font-weight: 800; display: flex; align-items: center; justify-content: center; font-size: 13px; }
.fm-opt.correct .fm-opt-letter { background: var(--fm-ok); color: #fff; }
.fm-opt.wrong .fm-opt-letter { background: var(--fm-ko); color: #fff; }
.fm-opt-body { flex: 1; min-width: 0; }
.fm-opt-text { font-size: 14.5px; line-height: 1.4; }
.fm-just { display: block; font-size: 13px; margin-top: 6px; line-height: 1.45; }
.fm-just.pos { color: var(--fm-ok); }
.fm-just.neg { color: var(--fm-ko); }

.fm-hint { margin-top: 16px; background: #FFFBEB; border: 1px solid #FDE68A; border-radius: 12px; padding: 12px 14px; }
.fm-hint-t { font-weight: 800; font-family: 'Syne', sans-serif; font-size: 14px; color: var(--fm-amber); margin-bottom: 4px; }
.fm-hint-h { font-size: 13.5px; line-height: 1.5; color: #4b3a16; }

.fm-player-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 18px; }

/* ── Résultats ── */
.fm-result { max-width: 720px; margin: 0 auto; text-align: center; }
.fm-result-score { font-family: 'Syne', sans-serif; font-weight: 800; font-size: 56px; line-height: 1; margin: 8px 0; }
.fm-result.pass .fm-result-score { color: var(--fm-ok); }
.fm-result.fail .fm-result-score { color: var(--fm-ko); }
.fm-result-badge { display: inline-block; font-weight: 800; padding: 6px 16px; border-radius: 999px; font-size: 15px; }
.fm-result.pass .fm-result-badge { background: var(--fm-ok-bg); color: var(--fm-ok); }
.fm-result.fail .fm-result-badge { background: var(--fm-ko-bg); color: var(--fm-ko); }
.fm-review { text-align: left; margin-top: 26px; }
.fm-review-row { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--fm-line); font-size: 14px; }
.fm-review-row .fm-rev-ic { font-weight: 800; }
.fm-review-row.ok .fm-rev-ic { color: var(--fm-ok); }
.fm-review-row.ko .fm-rev-ic { color: var(--fm-ko); }

/* ── Accordéon résumé de cours ── */
.fm-acc { display: flex; flex-direction: column; gap: 8px; }
.fm-acc-item { border: 1px solid var(--fm-line); border-radius: 12px; overflow: hidden; }
.fm-acc-item.open { border-color: #c4b5fd; }
.fm-acc-head { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 10px; background: var(--fm-violet-bg); color: var(--fm-violet-d); border: none; cursor: pointer; font-family: 'Syne', sans-serif; font-weight: 700; font-size: 14px; padding: 11px 14px; text-align: left; }
.fm-acc-head:hover { background: #ede9fe; }
.fm-acc-body { padding: 14px; font-size: 14px; line-height: 1.55; color: var(--fm-ink); }
.fm-acc-body strong { color: var(--fm-violet-d); }
.fm-acc-body ul { margin: 6px 0; padding-left: 20px; }
.fm-acc-body img { max-width: 100%; height: auto; border-radius: 8px; display: block; border: 1px solid var(--fm-line); }
.fm-illus { margin: 12px 0; padding: 8px; background: #fafafe; border: 1px solid var(--fm-line); border-radius: 10px; max-width: 460px; }
.fm-illus img { max-width: 100%; width: auto; max-height: 320px; object-fit: contain; margin: 0 auto; border: none; }
.fm-illus figcaption { font-size: 12px; color: var(--fm-muted); margin-top: 5px; font-style: italic; text-align: center; }
