/* =====================================================================
   Formation (public/formation.js) — 08/11/2026
   Accueil (reprendre, progression, parcours et modules en lignes), lecteur (vidéo + liste des leçons), gestion.
   Mêmes jetons que le reste de l'appli : --bg, --surface, --line, --fg, --muted, --accent.
   ===================================================================== */
.fo-root { display: flex; flex-direction: column; gap: 18px; padding-bottom: 40px; }
.fo-simwrap { padding-bottom: 40px; }
.fo-crumb { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; font-size: 13px; color: var(--muted); }
.fo-crumb > span::before { content: "›"; margin-right: 8px; color: var(--muted-2); }
.fo-crumb .linkish { font-size: 13px; }
.fo-bar { display: block; height: 4px; border-radius: 4px; background: var(--surface-3); overflow: hidden; min-width: 60px; }
.fo-bar i { display: block; height: 100%; border-radius: 4px; background: var(--accent); transition: width .4s var(--ease, ease-out); }
.fo-bar.thin { height: 3px; margin-top: 5px; min-width: 0; }

/* haut de page : reprendre + chiffres */
.fo-top { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 14px; align-items: stretch; }
.fo-resume { display: grid; grid-template-columns: 132px minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: inherit; font: inherit; text-align: left; cursor: pointer; transition: border-color .15s, background .15s; }
.fo-resume:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.fo-resume.none { grid-template-columns: 1fr; cursor: default; }
.fo-thumb { position: relative; width: 132px; aspect-ratio: 16 / 9; border-radius: 8px; background: var(--surface-3) center / cover no-repeat; display: grid; place-items: center; }
.fo-thumb .i { width: 22px; height: 22px; color: #fff; padding: 9px; box-sizing: content-box; border-radius: 50%; background: rgba(0, 0, 0, .55); }
.fo-rt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.fo-rt small { font-size: 11.5px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; color: var(--accent); }
.fo-rt b { font-size: 15px; font-weight: 650; color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fo-rt > span { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fo-rt .fo-bar { margin-top: 6px; max-width: 260px; }
.fo-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
.fo-kpis .v-kpi { border-bottom: 1px solid var(--line); }
.fo-kpis .v-kpi:nth-child(2n) { border-right: 0; }
.fo-kpis .v-kpi:nth-last-child(-n + 2) { border-bottom: 0; }
.fo-kpis .v-kpi b { font-size: 18px; }
.fo-kpis .fo-bar { margin-top: 2px; }

/* parcours et modules : des lignes, pas des cartes */
.fo-path { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); overflow: hidden; }
.fo-path > header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.fo-path h2 { margin: 0; font-size: 15px; font-weight: 650; }
.fo-path header p { margin: 3px 0 0; font-size: 12.5px; color: var(--muted); }
.fo-ph { display: flex; align-items: center; gap: 12px; flex: none; }
.fo-ph small { font-size: 12px; color: var(--muted); white-space: nowrap; }
.fo-ph .fo-bar { width: 120px; }
.fo-mod { display: grid; grid-template-columns: 34px minmax(0, 1fr) 150px 190px 0 auto; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.fo-mod:last-child { border-bottom: 0; }
.fo-mod:hover { background: var(--surface-2); }
.fo-n { font-size: 12.5px; font-weight: 650; color: var(--muted-2); font-variant-numeric: tabular-nums; }
.fo-n .i { width: 17px; height: 17px; color: var(--accent); }
.fo-mt { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.fo-mt b { font-size: 13.5px; font-weight: 600; color: var(--fg); }
.fo-mt small { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fo-meta { font-size: 12.5px; color: var(--fg-2); white-space: nowrap; }
.fo-mp { display: flex; align-items: center; gap: 10px; }
.fo-mp .fo-bar { flex: 1; }
.fo-none { margin: 0; padding: 14px 16px; font-size: 13px; color: var(--muted); }

/* lecteur */
.fo-player { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.fo-main { min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.fo-frame { border-radius: 12px; overflow: hidden; background: #000; border: 1px solid var(--line); aspect-ratio: 16 / 9; }
.fo-video { display: block; width: 100%; height: 100%; background: #000; }
.fo-frame.vert { aspect-ratio: 9 / 16; width: min(100%, calc(78vh * 9 / 16)); max-height: 78vh; margin: 0 auto; }
.fo-frame.vert .fo-video { object-fit: contain; }
.fo-info { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.fo-it { min-width: 0; }
.fo-it h2 { margin: 0; font-size: 18px; font-weight: 650; }
.fo-im { margin: 4px 0 0; font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.fo-nav { display: flex; gap: 8px; flex-wrap: wrap; }
.fo-desc { margin: 0; max-width: 72ch; font-size: 13.5px; line-height: 1.55; color: var(--fg-2); }
.fo-side { position: sticky; top: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); max-height: calc(100vh - 160px); display: flex; flex-direction: column; overflow: hidden; }
.fo-side > header { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.fo-side > header b { font-size: 13.5px; } .fo-side > header small { font-size: 12px; color: var(--muted); }
#fo-list { overflow-y: auto; padding: 6px; }
.fo-sm > small { display: block; padding: 10px 8px 4px; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted-2); }
.fo-li { width: 100%; display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 8px; border: 0; border-radius: 8px; background: none; color: var(--fg-2); font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.fo-li:hover { background: var(--surface-2); color: var(--fg); }
.fo-li.on { background: var(--surface-3); color: var(--fg); font-weight: 600; }
.fo-li small { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.fo-ck { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--line); }
.fo-li.done .fo-ck { border-color: transparent; background: color-mix(in srgb, var(--ok) 20%, transparent); }
.fo-ck .i { width: 11px; height: 11px; color: var(--ok); }
.fo-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.fo-lt { min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* gestion */
.fo-adm-h { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.fo-adm-h .grow { flex: 1; }
.fo-adm-h .btn-main { display: inline-flex; align-items: center; gap: 6px; } .fo-adm-h .btn-main .i { width: 14px; height: 14px; }
.fo-acts { white-space: nowrap; text-align: right; }
.fo-acts .icon-btn { width: 28px; height: 28px; min-height: 28px; }
.fo-note { margin: 10px 0 0; font-size: 12px; }
.fo-ed { display: flex; flex-direction: column; gap: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.fo-grid2 { display: grid; grid-template-columns: 1fr 1.6fr; gap: 12px; }
.fo-grid2 label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 550; color: var(--fg-2); }
.fo-acc { display: flex; align-items: center; gap: 6px 16px; flex-wrap: wrap; margin: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.fo-acc legend { padding: 0 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
.fo-acc .check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.fo-acc small { flex-basis: 100%; font-size: 12px; }
.fo-sep { width: 1px; height: 18px; background: var(--line); }
.fo-emod { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.fo-emh { display: grid; grid-template-columns: 30px minmax(0, 1fr) minmax(0, 1.4fr) 28px 28px 28px; align-items: center; gap: 8px; padding: 10px 12px; background: var(--bg-2); border-bottom: 1px solid var(--line); }
.fo-emh .icon-btn, .fo-lacts .icon-btn { width: 28px; height: 28px; min-height: 28px; }
.fo-ls { display: flex; flex-direction: column; padding: 4px 12px 10px; }
.fo-el { display: grid; grid-template-columns: 22px minmax(0, 1fr) minmax(0, 1.3fr) 70px auto; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.fo-el .fo-wide { grid-column: 2 / -1; }
.fo-lnum { font-size: 12px; color: var(--muted-2); text-align: center; }
.fo-dur { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }
.fo-lacts { display: inline-flex; gap: 2px; }
.fo-ls .linkish { align-self: flex-start; margin-top: 8px; display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; }
.fo-ls .linkish .i, .fo-ed > .btn-ghost .i { width: 13px; height: 13px; }
.fo-ed > .btn-ghost { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; }
.fo-edf { display: flex; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
html body .app .fo-ed input, html body .app .fo-ed select { height: 34px !important; min-height: 34px !important; font-size: 13px !important; }
.fo-tt td small, .fo-at td small { display: block; }
.fo-tc { display: flex; align-items: center; gap: 8px; min-width: 120px; } .fo-tc .fo-bar { flex: 1; } .fo-tc small { font-size: 12px; color: var(--fg-2); }

@media (max-width: 1100px) {
  .fo-top { grid-template-columns: minmax(0, 1fr); }
  .fo-player { grid-template-columns: minmax(0, 1fr); }
  .fo-side { position: static; max-height: none; }
  .fo-mod { grid-template-columns: 30px minmax(0, 1fr) 140px auto; }
  .fo-mod > .fo-meta:not(.fo-mp), .fo-mod > span:empty { display: none; }
}
@media (max-width: 760px) {
  .fo-resume { grid-template-columns: 96px minmax(0, 1fr); }
  .fo-resume .btn-main { display: none; }
  .fo-thumb { width: 96px; }
  .fo-path > header { flex-direction: column; align-items: flex-start; }
  .fo-ph .fo-bar { width: 80px; }
  .fo-mod { grid-template-columns: 26px minmax(0, 1fr) auto; row-gap: 6px; }
  .fo-mod > .fo-mp { grid-column: 2 / 3; grid-row: 2; }
  .fo-mod > .btn-ghost { grid-row: 1 / span 2; grid-column: 3; }
  .fo-frame { border-radius: 0; margin: 0 -12px; border-left: 0; border-right: 0; }
  .fo-nav { width: 100%; } .fo-nav .btn-main { flex: 1; }
  .fo-grid2 { grid-template-columns: 1fr; }
  .fo-emh { grid-template-columns: 26px minmax(0, 1fr) 28px 28px 28px; } .fo-emh [data-fm="desc"] { grid-column: 2 / -1; grid-row: 2; }
  .fo-el { grid-template-columns: 18px minmax(0, 1fr) auto; } .fo-el [data-fl="src"] { grid-column: 2 / -1; grid-row: 2; } .fo-el .fo-dur { grid-column: 3; grid-row: 1; }
  .fo-el .fo-lacts { grid-column: 2 / -1; grid-row: 5; justify-self: end; }
}
@media (prefers-reduced-motion: reduce) { .fo-bar i { transition: none; } }
html body .app .fo-acc .check input[type="checkbox"] { width: 16px !important; height: 16px !important; min-height: 16px !important; margin: 0; flex: none; }
@media (pointer: coarse) { .fo-emh .icon-btn, .fo-lacts .icon-btn, .fo-acts .icon-btn { width: 36px !important; height: 36px !important; min-height: 36px !important; } .fo-emh { grid-template-columns: 26px minmax(0, 1fr) 36px 36px 36px; } }
