/* ==========================================================================
   Formation Manaboo : présentation, module, capsule.
   Les mêmes pages servent la vitrine (visiteurs, public/css/vitrine.css) et l'espace connecté (public/css/shell.css) :
   les jetons de couleur sont posés sur .fm--vitrine et .fm--app, le reste ne dépend que d'eux.
   ========================================================================== */

.fm--vitrine {
  --fm-ui: var(--ui);
  --fm-mono: var(--mono);
  --fm-accent: var(--violet);
  --fm-accent-fonce: var(--violet-fonce);
  --fm-titre: var(--encre);
  --fm-texte: var(--texte);
  --fm-doux: var(--texte-doux);
  --fm-fond: var(--blanc);
  --fm-brume: var(--brume);
  --fm-teinte: var(--lavande);
  --fm-bord: var(--ligne);
  --fm-ombre: 0 1px 2px rgba(30, 27, 75, .05), 0 14px 34px -22px rgba(30, 27, 75, .28);
  --fm-base: 16px;
}
.fm--app {
  --fm-ui: var(--fs-ui);
  --fm-mono: var(--fs-mono);
  --fm-accent: var(--accent);
  --fm-accent-fonce: var(--accent-2);
  --fm-titre: var(--text);
  --fm-texte: var(--text-2);
  --fm-doux: var(--text-3);
  --fm-fond: var(--surface);
  --fm-brume: var(--surface-2);
  --fm-teinte: var(--accent-soft);
  --fm-bord: var(--border);
  --fm-ombre: var(--shadow);
  --fm-base: 14.5px;
}

.fm-page { max-width: 1200px; margin: 0 auto; padding: 48px 32px 96px; }
@media (max-width: 640px) { .fm-page { padding: 28px 20px 64px; } }

.fm { font-family: var(--fm-ui); font-size: var(--fm-base); line-height: 1.55; color: var(--fm-texte); }
.fm *, .fm *::before, .fm *::after { box-sizing: border-box; }
/* :where() garde la remise à zéro à la spécificité la plus basse : les classes de la page (marges comprises) l'emportent toujours */
:where(.fm) :is(h1, h2, h3, p, ul, ol) { margin: 0; padding: 0; }
:where(.fm) :is(ul, ol) { list-style: none; }
.fm img { display: block; max-width: 100%; }
.fm p a, .fm .fm-lien { color: var(--fm-accent); font-weight: 600; text-decoration: none; }
.fm p a:hover, .fm .fm-lien:hover { color: var(--fm-accent-fonce); text-decoration: underline; }
.fm a:focus-visible, .fm button:focus-visible { outline: 2px solid var(--fm-accent); outline-offset: 3px; border-radius: 6px; }
.fm-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Tête de page ---------- */
.fm-tete { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; margin-bottom: 40px; }
.fm-tete h1 { color: var(--fm-titre); font-weight: 800; text-wrap: balance; }
.fm--vitrine .fm-tete h1 { font-size: clamp(36px, 4.4vw, 58px); line-height: 1.04; letter-spacing: -0.036em; max-width: 17em; }
.fm--app .fm-tete h1 { font-size: 26px; line-height: 1.15; letter-spacing: -0.03em; }
.fm-chapo { max-width: 40em; font-size: 1.2em; line-height: 1.6; }
.fm--app .fm-chapo { font-size: 1.05em; }
.fm-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }
.fm-etiquettes { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* ---------- Boutons ---------- */
.fm .fm-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 22px; border-radius: 12px; border: 1.5px solid transparent; font: 600 1.02em/1.2 var(--fm-ui); text-decoration: none; cursor: pointer; transition: background-color .15s, border-color .15s, color .15s; }
.fm--app .fm-btn { padding: 10px 16px; border-radius: 10px; font-size: 1em; }
.fm .fm-btn--primaire { background: var(--fm-accent); color: var(--accent-ink, #fff); }
.fm .fm-btn--primaire:hover { background: var(--fm-accent-fonce); color: var(--accent-ink, #fff); text-decoration: none; }
.fm .fm-btn--contour { background: var(--fm-fond); color: var(--fm-titre); border-color: var(--fm-bord); }
.fm .fm-btn--contour:hover { border-color: var(--fm-accent); color: var(--fm-titre); text-decoration: none; }
.fm--vitrine .fm-btn--primaire { color: #fff; }

/* ---------- Pastilles et badges ---------- */
.fm-pastille, .fm-badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; line-height: 1.4; white-space: nowrap; }
.fm-pastille { font-family: var(--fm-mono); font-weight: 500; }
.fm-pastille--ok { background: color-mix(in srgb, #2FB6A3 16%, transparent); color: #17695e; }
.fm-pastille--cours { background: color-mix(in srgb, #E8A13A 18%, transparent); color: #865a0f; }
.fm-pastille--venir { background: var(--fm-teinte); color: var(--fm-doux); }
.fm-badge { background: var(--fm-brume); color: var(--fm-texte); border: 1px solid var(--fm-bord); }
.fm-badge--offert, .fm-badge--accorde { background: #DCFCE7; color: #166534; border-color: transparent; }
.fm-badge--gratuit { background: var(--fm-teinte); color: var(--fm-accent); border-color: transparent; }
:root[data-theme="dark"] .fm-pastille--ok { color: #6fdccb; }
:root[data-theme="dark"] .fm-pastille--cours { color: #f0c673; }
:root[data-theme="dark"] .fm-badge--offert, :root[data-theme="dark"] .fm-badge--accorde { background: color-mix(in srgb, #2FB6A3 18%, transparent); color: #6fdccb; }

/* ---------- Titres de section ---------- */
.fm-section { margin-top: 56px; }
.fm-section:first-of-type { margin-top: 0; }
.fm-section > h2, .fm-bloc > h2 { color: var(--fm-titre); font-weight: 800; letter-spacing: -0.025em; text-wrap: balance; }
.fm-section > h2 { font-size: clamp(24px, 2.6vw, 32px); line-height: 1.15; }
.fm--app .fm-section > h2 { font-size: 20px; }
.fm-section__intro { max-width: 42em; margin-top: 10px; }
.fm-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; margin-top: 28px; }

/* ---------- Trois points ---------- */
.fm-points { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 28px; margin-bottom: 56px; }
.fm-point { display: flex; flex-direction: column; gap: 8px; padding-top: 18px; border-top: 2px solid var(--fm-accent); }
.fm-point svg { color: var(--fm-accent); }
.fm-point h2 { color: var(--fm-titre); font-size: 1.2em; font-weight: 700; }
.fm-point p { line-height: 1.6; }

/* ---------- Carte d'un module ---------- */
.fm-carte { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 22px; background: var(--fm-fond); border: 1px solid var(--fm-bord); border-radius: 16px; transition: border-color .15s; }
.fm-carte:hover, .fm-carte:focus-within { border-color: var(--fm-accent); }
.fm-carte__tete { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.fm-carte__num { font-family: var(--fm-mono); font-size: 12.5px; font-weight: 500; color: var(--fm-doux); }
.fm-carte__titre { color: var(--fm-titre); font-size: 1.22em; line-height: 1.25; font-weight: 700; letter-spacing: -0.015em; }
.fm .fm-carte__lien { color: var(--fm-titre); text-decoration: none; }
.fm .fm-carte__lien:hover { color: var(--fm-accent); text-decoration: none; }
.fm .fm-carte__lien::after { content: ""; position: absolute; inset: 0; border-radius: 16px; }
.fm-carte__accroche { flex-grow: 1; line-height: 1.55; }
.fm-carte__pied { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 4px; }
.fm-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--fm-doux); font-size: .92em; }
.fm-meta li { display: inline-flex; align-items: center; gap: 6px; }
.fm-meta--grand { font-size: 1em; }

/* ---------- Mots d'information ---------- */
.fm-note { margin-top: 56px; padding: 24px 26px; background: var(--fm-brume); border: 1px solid var(--fm-bord); border-radius: 16px; }
.fm-note h2 { color: var(--fm-titre); font-size: 1.15em; font-weight: 700; margin-bottom: 6px; }
.fm-note p { max-width: 48em; line-height: 1.65; }
.fm-note p + p { margin-top: 8px; }
.fm-petit { margin-top: 28px; max-width: 52em; font-size: .88em; line-height: 1.6; color: var(--fm-doux); }
.fm-mention { margin-top: 28px; padding: 14px 18px; border-left: 3px solid var(--fm-accent); background: var(--fm-brume); border-radius: 0 12px 12px 0; font-size: .92em; line-height: 1.6; }

/* ---------- Fil d'Ariane ---------- */
.fm-fil { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-bottom: 22px; font-size: .92em; color: var(--fm-doux); }
.fm-fil a { color: var(--fm-texte); font-weight: 500; text-decoration: none; }
.fm-fil a:hover { color: var(--fm-accent); text-decoration: underline; }
.fm-fil svg { opacity: .6; }

/* ---------- Page d'un module ---------- */
.fm-colonnes { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.fm-principal, .fm-lateral { display: flex; flex-direction: column; gap: 32px; min-width: 0; }
.fm-bloc { padding: 24px 26px; background: var(--fm-fond); border: 1px solid var(--fm-bord); border-radius: 16px; }
.fm-bloc > h2 { font-size: 1.15em; margin-bottom: 10px; }
.fm-bloc p { line-height: 1.65; }
.fm-bloc p + p, .fm-bloc p + .fm-actions { margin-top: 10px; }
.fm-bloc .fm-actions { margin-top: 14px; }
.fm-bloc--nu { padding: 0; background: transparent; border: 0; }
.fm-bloc--nu > h2 { font-size: clamp(22px, 2.2vw, 28px); margin-bottom: 14px; }
.fm--app .fm-bloc--nu > h2 { font-size: 18px; }
.fm-tests { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.fm-tests a { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border: 1px solid var(--fm-bord); border-radius: 12px; color: var(--fm-titre); font-weight: 600; text-decoration: none; }
.fm-tests a:hover { border-color: var(--fm-accent); color: var(--fm-titre); text-decoration: none; }
.fm-tests svg { color: var(--fm-doux); flex: none; }
.fm-bloc .fm-petit { margin-top: 12px; }
@media (max-width: 900px) { .fm-colonnes { grid-template-columns: 1fr; } }

/* ---------- Liste des capsules ---------- */
.fm-liste { display: flex; flex-direction: column; gap: 10px; }
.fm-ligne a { display: flex; align-items: center; gap: 16px; padding: 10px; background: var(--fm-fond); border: 1px solid var(--fm-bord); border-radius: 14px; color: var(--fm-titre); text-decoration: none; }
.fm-ligne a:hover { border-color: var(--fm-accent); color: var(--fm-titre); text-decoration: none; }
.fm-ligne.is-courante a { border-color: var(--fm-accent); background: var(--fm-teinte); }
.fm-ligne__vignette { flex: none; position: relative; width: 128px; aspect-ratio: 16 / 9; border-radius: 9px; overflow: hidden; background: var(--fm-brume); }
.fm-ligne__vignette img { width: 100%; height: 100%; object-fit: cover; }
.fm-ligne.is-verrou .fm-ligne__vignette img { filter: saturate(.5) brightness(.9); }
.fm-ligne__texte { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.fm-ligne__num { font-family: var(--fm-mono); font-size: 12px; color: var(--fm-doux); }
.fm-ligne__titre { font-weight: 700; line-height: 1.3; }
.fm-ligne__duree { display: inline-flex; align-items: center; gap: 5px; font-size: .88em; color: var(--fm-doux); }
.fm-ligne__etat { flex: none; display: inline-flex; align-items: center; color: var(--fm-doux); }
.fm-reste { margin-top: 12px; font-size: .92em; color: var(--fm-doux); }
.fm-liste--compacte .fm-ligne__vignette { width: 88px; }
.fm-liste--compacte .fm-ligne a { gap: 12px; padding: 8px; }
.fm-liste--compacte .fm-ligne__titre { font-size: .95em; }
@media (max-width: 560px) {
  .fm-ligne__vignette { width: 96px; }
  .fm-liste--compacte .fm-ligne__vignette { width: 80px; }
}

/* ---------- Page d'une capsule ---------- */
.fm-visionneuse { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.fm-visionneuse__principal { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.fm-visionneuse__liste { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.fm-visionneuse__liste h2 { color: var(--fm-titre); font-size: 1.1em; font-weight: 700; }
.fm-visionneuse h1 { color: var(--fm-titre); font-weight: 800; letter-spacing: -0.03em; line-height: 1.12; text-wrap: balance; }
.fm--vitrine .fm-visionneuse h1 { font-size: clamp(26px, 3vw, 38px); }
.fm--app .fm-visionneuse h1 { font-size: 22px; }
.fm-lecteur { position: relative; aspect-ratio: 16 / 9; background: #0B0B1E; border-radius: 14px; overflow: hidden; box-shadow: var(--fm-ombre); }
.fm-lecteur video { position: absolute; inset: 0; width: 100%; height: 100%; display: block; background: #000; }
.fm-pas { display: flex; flex-wrap: wrap; gap: 10px; }
.fm-visionneuse .fm-bloc { margin-top: 4px; }
@media (max-width: 960px) { .fm-visionneuse { grid-template-columns: 1fr; } }

/* ---------- Capsule dont l'accès n'est pas encore ouvert ---------- */
.fm-verrou { position: relative; display: flex; align-items: center; justify-content: center; aspect-ratio: 16 / 9; min-height: 300px; border-radius: 14px; overflow: hidden; background: #1E1B4B; color: #fff; text-align: center; box-shadow: var(--fm-ombre); }
.fm-verrou__image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(4px) brightness(.32); transform: scale(1.05); }
.fm-verrou__contenu { position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 24px 22px; max-width: 34em; }
.fm-verrou__contenu h2 { font-size: 1.35em; font-weight: 700; line-height: 1.25; }
.fm-verrou__contenu p { color: rgba(255, 255, 255, .86); line-height: 1.55; }
.fm-verrou__contenu .fm-actions { justify-content: center; }
.fm .fm-verrou .fm-btn--contour { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .45); }
.fm .fm-verrou .fm-btn--contour:hover { border-color: #fff; color: #fff; }
.fm .fm-verrou .fm-btn--primaire { background: #fff; color: #1E1B4B; }
.fm .fm-verrou .fm-btn--primaire:hover { background: #EEEDFD; color: #1E1B4B; }
.fm .fm-verrou .fm-lien { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.fm .fm-verrou .fm-lien:hover { color: #EEEDFD; }
/* Sur téléphone, la boîte épouse son contenu au lieu de garder la proportion 16/9 : rien n'est rogné ni collé au bord */
@media (max-width: 640px) {
  .fm-verrou { aspect-ratio: auto; min-height: 0; }
  .fm-verrou__contenu { padding: 32px 20px; }
}

/* ---------- Module précédent et suivant ---------- */
.fm-voisins { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px; margin-top: 56px; }
.fm-voisins a { display: flex; flex-direction: column; gap: 2px; max-width: 24em; padding: 14px 18px; border: 1px solid var(--fm-bord); border-radius: 14px; color: var(--fm-titre); text-decoration: none; background: var(--fm-fond); }
.fm-voisins a:hover { border-color: var(--fm-accent); color: var(--fm-titre); text-decoration: none; }
.fm-voisins small { font-family: var(--fm-mono); font-size: 12px; color: var(--fm-doux); }
.fm-voisins strong { font-weight: 700; line-height: 1.3; }
.fm-voisins__suivant { margin-left: auto; text-align: right; }

/* ---------- Achat des modules ---------- */
/* De l'air entre l'avis réservé aux administrateurs et ce qui le suit */
.fm-mention + .fm-erreurs, .fm-mention + #fm-achat, .fm-mention + .fm-bloc { margin-top: 24px; }
.fm-erreurs { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 22px; padding: 14px 18px; border-radius: 12px; background: color-mix(in srgb, #E0708A 12%, transparent); border: 1px solid color-mix(in srgb, #E0708A 30%, transparent); color: #b03651; font-size: .95em; line-height: 1.55; }
.fm-erreurs svg { flex: none; margin-top: 2px; }
.fm-erreurs ul { margin: 0; padding: 0; list-style: none; }
:root[data-theme="dark"] .fm-erreurs { color: #f0a0b3; }
.fm-choix { display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0; border: 0; min-width: 0; }
.fm-choix > legend { padding: 0; margin-bottom: 12px; color: var(--fm-titre); font-weight: 800; letter-spacing: -0.02em; font-size: 1.15em; }
.fm-choix__item { display: flex; align-items: flex-start; gap: 14px; padding: 16px 18px; background: var(--fm-fond); border: 1px solid var(--fm-bord); border-radius: 14px; cursor: pointer; transition: border-color .15s, background-color .15s; }
.fm-choix__item:hover { border-color: var(--fm-accent); }
.fm-choix__item:has(input:checked) { border-color: var(--fm-accent); background: var(--fm-teinte); }
.fm-choix__item input { flex: none; width: 18px; height: 18px; margin: 3px 0 0; accent-color: var(--fm-accent); cursor: pointer; }
.fm-choix__texte { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.fm-choix__num { font-family: var(--fm-mono); font-size: 12.5px; color: var(--fm-doux); }
.fm-choix__titre { color: var(--fm-titre); font-weight: 700; line-height: 1.3; }
.fm-choix__accroche { line-height: 1.55; }
.fm-choix__meta { font-size: .9em; color: var(--fm-doux); line-height: 1.5; }
.fm-recap { display: flex; flex-direction: column; gap: 10px; }
.fm-recap > h2 { margin-bottom: 2px; }
.fm-recap .fm-recap__ligne { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 0; }
.fm-recap__ligne strong { color: var(--fm-titre); font-variant-numeric: tabular-nums; }
.fm-recap__total { padding-top: 10px; border-top: 1px solid var(--fm-bord); font-size: 1.15em; }
.fm-consent { display: flex; align-items: flex-start; gap: 10px; margin-top: 6px; font-size: .9em; line-height: 1.55; cursor: pointer; }
.fm-consent input { flex: none; width: 17px; height: 17px; margin: 3px 0 0; accent-color: var(--fm-accent); cursor: pointer; }
.fm-consent a { color: var(--fm-accent); font-weight: 600; }
.fm .fm-recap__payer { width: 100%; margin-top: 6px; }
.fm .fm-recap__payer:disabled { opacity: .55; cursor: not-allowed; }
.fm-recap .fm-petit { margin-top: 4px; }
.fm-vente { margin-top: 4px; font-size: .95em; line-height: 1.6; }
.fm-vente strong { color: var(--fm-titre); }
.fm-badge--vente { background: var(--fm-teinte); color: var(--fm-accent); border-color: transparent; }
/* Offre d'achat dans la boîte sombre d'une capsule verrouillée */
.fm-verrou .fm-vente strong { color: #fff; }
.fm-verrou .fm-petit { margin-top: 0; color: rgba(255, 255, 255, .75); }
@media (min-width: 901px) { .fm-recap { position: sticky; top: 24px; } }

@media (prefers-reduced-motion: reduce) { .fm * { transition: none !important; } }
