/*
 * Decassel — charte : marron profond (structure, textes forts), orange foncé
 * (actions), orange clair (fonds et repères). Polices système uniquement :
 * aucune requête vers un service tiers (RGPD), affichage immédiat.
 */
:root {
  --brown-900: #33200f;
  --brown-800: #4a2f1a;
  --brown-600: #7a4f2f;
  --orange-700: #ab4708;
  --orange-600: #c9580d;
  --orange-400: #ef9a4c;
  --orange-200: #f9cfa3;
  --orange-100: #fde7d0;
  --orange-50: #fff6ec;
  --white: #ffffff;
  --text: #2b1d13;
  --muted: #6d5444;
  --line: #ecdccc;
  --done: #2e7a4d;
  --done-bg: #e5f2ea;
  --danger: #b3261e;
  --focus: #1f5fbf;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: Charter, "Bitstream Charter", "Iowan Old Style", "Sitka Text", Cambria, Georgia, serif;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(51, 32, 15, .06), 0 8px 24px rgba(51, 32, 15, .06);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--white); color: var(--text); font: 17px/1.55 var(--font); }
a { color: var(--orange-700); text-underline-offset: 2px; }
a:hover { color: var(--brown-800); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
img, video, iframe { max-width: 100%; height: auto; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; z-index: 50; background: var(--white); padding: .5rem 1rem; }

.wrap { max-width: 1160px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 760px; }

h1, h2, h3 { color: var(--brown-900); line-height: 1.15; letter-spacing: -.015em; }
h1 { font-size: clamp(2rem, 4.2vw, 3.1rem); font-weight: 800; margin: 0 0 1rem; }
h2 { font-size: clamp(1.45rem, 2.6vw, 2rem); font-weight: 800; margin: 0 0 1rem; }
h3 { font-size: 1.15rem; font-weight: 750; margin: 0 0 .4rem; }
p { margin: 0 0 1rem; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 62ch; }

/* ---------------------------------------------------------------- en-tête */
.site-header { position: sticky; top: 0; z-index: 20; background: rgba(255, 255, 255, .97); border-bottom: 1px solid var(--line); backdrop-filter: saturate(1.2) blur(6px); }
.site-header .wrap { display: flex; align-items: center; gap: 1.5rem; min-height: 70px; }
.logo { display: flex; align-items: baseline; gap: .35rem; text-decoration: none; color: var(--brown-900); font-weight: 850; font-size: 1.35rem; letter-spacing: -.02em; }
.logo span { color: var(--orange-700); font-weight: 600; font-size: .95rem; letter-spacing: 0; }
.main-nav { display: flex; gap: 1.4rem; margin-left: auto; align-items: center; }
.main-nav a { color: var(--brown-800); text-decoration: none; font-weight: 600; font-size: .98rem; padding: .3rem 0; border-bottom: 2px solid transparent; }
.main-nav a:hover, .main-nav a[aria-current="page"] { border-color: var(--orange-600); color: var(--brown-900); }
.header-actions { display: flex; gap: .6rem; align-items: center; }
.menu-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--line); border-radius: 8px; padding: .45rem .7rem; font: 600 .95rem var(--font); color: var(--brown-900); }

/* ---------------------------------------------------------------- boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 46px; padding: .7rem 1.25rem; border-radius: 999px; border: 2px solid transparent;
  background: var(--orange-700); color: var(--white); font: 700 1rem/1.1 var(--font);
  text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s;
}
.btn:hover { background: var(--brown-800); color: var(--white); }
.btn.ghost { background: transparent; color: var(--brown-900); border-color: var(--brown-900); }
.btn.ghost:hover { background: var(--brown-900); color: var(--white); }
.btn.light { background: var(--orange-100); color: var(--brown-900); }
.btn.light:hover { background: var(--orange-200); }
.btn.small { min-height: 38px; padding: .45rem .95rem; font-size: .92rem; }
.btn.block { width: 100%; }
.btn[disabled] { background: #b9a596; cursor: not-allowed; }

/* ---------------------------------------------------------------- accueil */
.hero { padding: 3.5rem 0 3rem; background: linear-gradient(180deg, var(--orange-50), var(--white)); }
.hero .wrap { display: grid; grid-template-columns: 1.15fr .85fr; gap: 3rem; align-items: center; }
.hero h1 { max-width: 15ch; }
.search-box { display: flex; gap: .5rem; margin-top: 1.75rem; max-width: 560px; background: var(--white); border: 2px solid var(--brown-900); border-radius: 999px; padding: .3rem .3rem .3rem 1.2rem; }
.search-box input { flex: 1; border: 0; font: 500 1.05rem var(--font); min-width: 0; background: transparent; color: var(--text); }
.search-box input:focus { outline: none; }
.search-box:focus-within { box-shadow: 0 0 0 4px var(--orange-200); }
.hero-note { margin-top: 1rem; font-size: .95rem; color: var(--muted); }

/* Le panneau des « sésames » : carte claire, pour ne pas écraser l'accueil */
.passports { background: var(--white); color: var(--text); border: 1px solid var(--line); border-radius: 18px; padding: 1.5rem; box-shadow: var(--shadow); }
.passports h2 { font-size: 1.2rem; margin-bottom: .3rem; }
.passports p { color: var(--muted); font-size: .95rem; margin-bottom: 1rem; }
.passports ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .45rem; }
.passports a {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: .7rem .9rem; border-radius: 10px; border: 1px solid var(--line); background: var(--orange-50);
  color: var(--brown-900); text-decoration: none; font-weight: 700;
}
.passports a:hover { background: var(--orange-100); border-color: var(--orange-400); }
.passports small { color: var(--muted); font-weight: 500; font-size: .85rem; white-space: nowrap; }

/* Repères de la page d'accueil */
.home-nav { background: var(--white); border-bottom: 1px solid var(--line); position: sticky; top: 70px; z-index: 19; }
.home-nav .wrap { display: flex; gap: .25rem 1.5rem; overflow-x: auto; padding-block: .7rem; }
.home-nav a { white-space: nowrap; text-decoration: none; color: var(--brown-600); font-weight: 600; font-size: .95rem; }
.home-nav a:hover { color: var(--orange-700); text-decoration: underline; }
.callback { background: var(--white); border-block: 1px solid var(--line); }
.callback .wrap { display: flex; justify-content: space-between; align-items: center; gap: 1rem 2rem; flex-wrap: wrap; padding-block: 1.4rem; }
.callback p { margin: 0; max-width: 62ch; }
.cta-band.soft { background: var(--orange-50); color: var(--text); border: 1px solid var(--line); }
.cta-band.soft h2 { color: var(--brown-900); }
.cta-band.soft p { color: var(--muted); }
.cta-band.soft .btn.light { background: var(--brown-900); color: var(--white); }
.section { scroll-margin-top: 7rem; }

.proof { border-block: 1px solid var(--line); background: var(--white); }
.proof ul { list-style: none; margin: 0; padding: 1.25rem 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.proof li { color: var(--muted); font-size: .95rem; line-height: 1.35; }
.proof strong { display: block; color: var(--brown-900); font-size: 1.5rem; font-variant-numeric: tabular-nums; }

.section { padding: 4rem 0; }
.section.tint { background: var(--orange-50); }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: 1.75rem; flex-wrap: wrap; }
.section-head p { margin: 0; color: var(--muted); max-width: 60ch; }

.domains { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 2.5rem; border-top: 2px solid var(--brown-900); }
.domains a { display: grid; grid-template-columns: 1fr auto; gap: .25rem 1rem; padding: 1.1rem 0; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.domains a:hover h3 { color: var(--orange-700); }
.domains p { grid-column: 1; margin: 0; color: var(--muted); font-size: .95rem; }
.domains .count { grid-row: 1 / span 2; grid-column: 2; align-self: center; font-weight: 800; color: var(--orange-700); font-size: 1.1rem; font-variant-numeric: tabular-nums; }

/* Cartes formation */
.offer-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.offer-card { display: flex; flex-direction: column; background: var(--white); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; text-decoration: none; color: inherit; transition: border-color .15s, box-shadow .15s; }
.offer-card:hover { border-color: var(--orange-400); box-shadow: var(--shadow); }
.offer-card .thumb { aspect-ratio: 2 / 1; background: var(--orange-50) center / contain no-repeat; display: flex; align-items: end; padding: .75rem; }
.offer-card .domain-tag { background: var(--white); color: var(--brown-900); font-size: .78rem; font-weight: 700; padding: .2rem .55rem; border-radius: 999px; }
.offer-card .body { padding: 1rem 1.1rem 1.15rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.offer-card h3 { font-size: 1.05rem; line-height: 1.3; }
.offer-card .summary { color: var(--muted); font-size: .92rem; margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.offer-card .facts { margin-top: auto; display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; padding-top: .6rem; border-top: 1px dashed var(--line); font-size: .9rem; color: var(--muted); }
.offer-card .price { color: var(--brown-900); font-weight: 800; font-size: 1.1rem; }

.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; counter-reset: s; }
.steps li { counter-increment: s; padding-top: 3.2rem; position: relative; }
.steps li::before { content: counter(s); position: absolute; top: 0; left: 0; width: 2.4rem; height: 2.4rem; border-radius: 50%; background: var(--orange-700); color: var(--white); font-weight: 800; display: grid; place-items: center; }
.steps p { color: var(--muted); font-size: .95rem; margin: 0; }

.funding { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.funding article { background: var(--white); border-radius: 16px; padding: 1.4rem; border-top: 5px solid var(--orange-600); }
.funding article:nth-child(2) { border-color: var(--brown-600); }
.funding article:nth-child(3) { border-color: var(--orange-400); }
.funding p { color: var(--muted); font-size: .95rem; }

.quote { margin: 0; padding: 1.4rem 1.5rem; background: var(--white); border-radius: 16px; border-left: 5px solid var(--orange-600); }
.quote p { font-family: var(--serif); font-size: 1.1rem; color: var(--brown-900); }
.quote footer { color: var(--muted); font-size: .9rem; }
.stars { color: var(--orange-700); letter-spacing: .1em; }

.cta-band { background: var(--brown-900); color: var(--orange-100); border-radius: 22px; padding: 2.25rem; display: flex; gap: 2rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.cta-band h2 { color: var(--white); margin-bottom: .35rem; }
.cta-band p { margin: 0; color: var(--orange-200); max-width: 60ch; }
.cta-band .btn.light { background: var(--orange-200); }

/* ---------------------------------------------------------------- catalogue */
.page-head { padding: 2.75rem 0 1.75rem; background: var(--orange-50); border-bottom: 1px solid var(--line); }
.crumbs { font-size: .9rem; color: var(--muted); margin-bottom: .75rem; }
.crumbs a { color: var(--muted); }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.25rem 0 0; }
.filters a { padding: .45rem .9rem; border-radius: 999px; border: 1.5px solid var(--line); background: var(--white); color: var(--brown-800); text-decoration: none; font-weight: 600; font-size: .92rem; }
.filters a[aria-current="true"] { background: var(--brown-900); border-color: var(--brown-900); color: var(--white); }
.filters a:hover { border-color: var(--orange-600); }
.filters span { opacity: .65; font-weight: 500; margin-left: .25rem; }
.empty { color: var(--muted); padding: 2rem 0; }

/* ---------------------------------------------------------------- fiche formation */
.offer-head .wrap { display: grid; grid-template-columns: 1fr 360px; gap: 3rem; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0 0; padding: 0; list-style: none; }
.chips li { background: var(--white); border: 1px solid var(--line); border-radius: 999px; padding: .3rem .8rem; font-size: .9rem; font-weight: 600; color: var(--brown-800); }
.buy-card { position: sticky; top: 90px; align-self: start; background: var(--white); border: 1px solid var(--line); border-radius: 18px; padding: 1.4rem; box-shadow: var(--shadow); }
.buy-card .price { font-size: 2rem; font-weight: 850; color: var(--brown-900); line-height: 1; }
.buy-card .price small { font-size: .9rem; font-weight: 500; color: var(--muted); }
.buy-card ul { list-style: none; padding: 0; margin: 1rem 0; font-size: .92rem; color: var(--muted); display: grid; gap: .4rem; }
.buy-card li::before { content: "✓"; color: var(--done); font-weight: 800; margin-right: .45rem; }
.buy-card .actions { display: grid; gap: .55rem; }
.buy-card .phone { text-align: center; font-size: .9rem; color: var(--muted); margin: .75rem 0 0; }
.offer-body { display: grid; grid-template-columns: 1fr 360px; gap: 3rem; padding: 2.5rem 0 4rem; }
.offer-body section { margin-bottom: 2.25rem; }
.offer-body h2 { font-size: 1.35rem; padding-bottom: .4rem; border-bottom: 2px solid var(--orange-200); }
.rich { font-size: 1.02rem; }
.rich h3, .rich h4 { color: var(--brown-900); margin: 1.25rem 0 .4rem; font-size: 1.05rem; }
.rich ul { padding-left: 1.2rem; }
.rich table { border-collapse: collapse; width: 100%; font-size: .95rem; }
.rich th, .rich td { border: 1px solid var(--line); padding: .45rem .6rem; text-align: left; }
.program { list-style: none; padding: 0; margin: 0; counter-reset: m; }
.program li { counter-increment: m; display: grid; grid-template-columns: 2.4rem 1fr auto; gap: .75rem; align-items: baseline; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.program li::before { content: counter(m, decimal-leading-zero); font-weight: 800; color: var(--orange-700); font-variant-numeric: tabular-nums; }
.program small { color: var(--muted); white-space: nowrap; }
.results { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.results div { background: var(--white); padding: 1rem; }
.results strong { display: block; font-size: 1.6rem; color: var(--brown-900); font-variant-numeric: tabular-nums; }
.results span { color: var(--muted); font-size: .9rem; }
.note { font-size: .88rem; color: var(--muted); }

/* ---------------------------------------------------------------- formulaires */
.form-card { background: var(--white); border: 1px solid var(--line); border-radius: 18px; padding: 1.75rem; box-shadow: var(--shadow); }
label { display: block; font-weight: 650; margin: 1rem 0 .35rem; color: var(--brown-900); }
.hint { display: block; font-weight: 400; color: var(--muted); font-size: .9rem; margin-top: .15rem; }
input[type=email], input[type=date], input[type=password], input[type=search], input[type=text], input[type=tel], input[type=number], input[type=url], select, textarea {
  width: 100%; padding: .75rem .9rem; font: inherit; color: var(--text); border: 1.5px solid #d8c3b0; border-radius: 10px; background: var(--white);
}
textarea { min-height: 130px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--orange-600); box-shadow: 0 0 0 4px var(--orange-100); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.choices { display: grid; gap: .6rem; margin-top: .5rem; }
.choice-card { display: flex; gap: .8rem; align-items: flex-start; padding: .95rem 1rem; border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; font-weight: 400; margin: 0; }
.choice-card:hover { border-color: var(--orange-400); }
.choice-card:has(input:checked) { border-color: var(--orange-700); background: var(--orange-50); }
.choice-card strong { display: block; color: var(--brown-900); }
.choice-card span { color: var(--muted); font-size: .92rem; }
.choice-card input { margin-top: .3rem; accent-color: var(--orange-700); }
.check { display: flex; gap: .65rem; align-items: flex-start; font-weight: 400; margin: .9rem 0; }
.check input { margin-top: .3rem; accent-color: var(--orange-700); width: 1.1rem; height: 1.1rem; flex-shrink: 0; }
.honey { position: absolute; left: -9999px; }
.schedule { width: 100%; border-collapse: collapse; margin: .5rem 0 1rem; }
.schedule td { padding: .55rem 0; border-bottom: 1px solid var(--line); }
.schedule td:last-child { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.recap { display: grid; grid-template-columns: 1fr 340px; gap: 2.5rem; align-items: start; }

/* Messages */
.flash { padding: .85rem 1.1rem; border-radius: 10px; margin: 0 0 1.25rem; border-left: 4px solid var(--brown-600); background: var(--orange-50); }
.flash.success { border-color: var(--done); background: var(--done-bg); }
.flash.warning { border-color: var(--orange-600); background: var(--orange-100); }
.flash.error { border-color: var(--danger); background: #fbe9e7; }
.flash-zone { padding-top: 1.25rem; }

/* ---------------------------------------------------------------- pied de page */
.site-footer { background: var(--brown-900); color: var(--orange-100); padding: 3rem 0 2rem; margin-top: 4rem; font-size: .95rem; }
.site-footer .cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 2rem; }
.site-footer .logo { color: var(--white); }
.site-footer .logo span { color: var(--orange-400); }
.site-footer .footer-intro { margin-top: .75rem; }
.site-footer h3 { color: var(--white); font-size: 1rem; }
.site-footer a { color: var(--orange-100); text-decoration: none; }
.site-footer a:hover { color: var(--white); text-decoration: underline; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .4rem; }
.site-footer .legal { border-top: 1px solid rgba(249, 207, 163, .2); margin-top: 2rem; padding-top: 1.25rem; font-size: .85rem; color: var(--orange-200); }

/* ---------------------------------------------------------------- espace stagiaire et administration */
/* Espace connecté : menu latéral à gauche, contenu à droite. */
body.has-side { background: #fbf7f2; font-size: 16px; }
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; background: linear-gradient(to right, var(--brown-900) 248px, transparent 248px); }
.side { background: var(--brown-900); color: var(--orange-100); position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 1.25rem 1.25rem 1rem; }
.side .logo { color: var(--white); font-size: 1.15rem; text-decoration: none; font-weight: 800; }
.side .logo span { color: var(--orange-400); }
.side-toggle { display: none; }
.side-nav { display: flex; flex-direction: column; gap: 2px; padding: 0 .75rem 1rem; flex: 1; }
.side-group { margin: 1.1rem .6rem .35rem; font-size: .78rem; color: var(--orange-200); opacity: .75; font-weight: 600; }
.side-nav a, .side-logout { display: flex; align-items: center; gap: .7rem; padding: .55rem .65rem; border-radius: 8px; color: var(--orange-100); text-decoration: none; font-weight: 600; font-size: .95rem; }
.side-nav a:hover, .side-logout:hover { background: rgba(249, 207, 163, .1); color: var(--white); }
.side-nav a[aria-current="page"] { background: var(--orange-700); color: var(--white); }
.side-nav .icon { flex: none; opacity: .9; }
.nav-count { margin-left: auto; background: var(--orange-400); color: var(--brown-900); border-radius: 999px; font-size: .75rem; padding: 0 .5rem; font-weight: 800; }
.side-foot { margin-top: auto; border-top: 1px solid rgba(249, 207, 163, .18); padding-top: .8rem; }
.side-user { display: flex; align-items: center; gap: .7rem; margin: 0 .65rem .3rem; font-size: .9rem; color: var(--orange-200); overflow: hidden; }
.side-user span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-foot form { margin: 0; }
.side-logout { width: 100%; background: none; border: 0; font: inherit; font-weight: 600; cursor: pointer; text-align: left; }
.link-button { background: none; border: 0; color: var(--orange-700); font: inherit; cursor: pointer; padding: 0; text-decoration: underline; }
main.app { min-width: 0; padding: 2rem clamp(16px, 3vw, 40px) 4rem; max-width: 1240px; width: 100%; box-sizing: border-box; }
main.app h1 { font-size: 1.7rem; margin-top: 0; }
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); background: none; }
  .side { position: sticky; height: auto; max-height: 100vh; max-height: 100dvh; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; z-index: 20; }
  .side-head { padding: .8rem 16px; }
  .side-toggle { display: inline-block; background: none; border: 1px solid rgba(249, 207, 163, .5); color: var(--white); border-radius: 8px; padding: .35rem .8rem; font: inherit; font-weight: 600; }
  .side-nav { display: none; padding-bottom: 1rem; }
  .side.open .side-nav { display: flex; }
  main.app { padding-top: 1.25rem; }
}

.meter { height: 8px; background: var(--orange-100); border-radius: 4px; overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--orange-600); }
.course-list { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--brown-900); }
.course-list li { border-bottom: 1px solid var(--line); }
.course-list a { display: grid; grid-template-columns: 1fr 200px; gap: .5rem 2rem; padding: 1.1rem 0; text-decoration: none; color: inherit; }
.course-list a:hover .course-title { color: var(--orange-700); }
.course-title { font-weight: 700; color: var(--brown-900); font-size: 1.05rem; }
.course-meta { color: var(--muted); font-size: .9rem; }
.course-progress { align-self: center; font-size: .9rem; color: var(--muted); }
.course-progress .meter { margin-top: .35rem; }

.course-head { display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: end; justify-content: space-between; margin-bottom: 1rem; }
.course-head .meter { width: 240px; }
.module { margin-top: 2rem; }
.module h2 { margin: 0 0 .5rem; font-size: 1.05rem; }
.rail { list-style: none; margin: 0; padding: 0 0 0 1.75rem; position: relative; }
.rail::before { content: ""; position: absolute; left: .55rem; top: .9rem; bottom: .9rem; width: 2px; background: var(--line); }
.rail li { position: relative; }
.rail li::before { content: ""; position: absolute; left: -1.55rem; top: .85rem; width: 14px; height: 14px; border-radius: 50%; background: var(--white); box-shadow: inset 0 0 0 2px #b9a596; }
.rail li.started::before { box-shadow: inset 0 0 0 2px var(--orange-600); background: var(--orange-100); }
.rail li.completed::before { background: var(--done); box-shadow: none; }
.rail a { display: flex; gap: .75rem; align-items: baseline; padding: .55rem .75rem; border-radius: 8px; text-decoration: none; color: var(--text); }
.rail a:hover { background: var(--orange-50); }
.rail .kind { font-size: .8rem; color: var(--muted); margin-left: auto; white-space: nowrap; }
.rail li.completed .kind { color: var(--done); }

.reading { max-width: 70ch; margin: 0 auto; }
.lesson-body { font: 1.125rem/1.75 var(--serif); color: #2a1c12; }
.lesson-body h2, .lesson-body h3, .lesson-body h4 { font-family: var(--font); color: var(--brown-900); line-height: 1.3; }
.lesson-body table { border-collapse: collapse; width: 100%; font: .95rem/1.4 var(--font); }
.lesson-body th, .lesson-body td { border: 1px solid var(--line); padding: .45rem .6rem; text-align: left; vertical-align: top; }
.lesson-body blockquote { margin: 1.5rem 0; padding: .25rem 0 .25rem 1rem; border-left: 3px solid var(--orange-600); color: var(--muted); }

.step-bar { position: sticky; bottom: 0; background: var(--white); border-top: 1px solid var(--line); box-shadow: 0 -6px 16px rgba(51, 32, 15, .06); margin: 3rem -20px 0; padding: 0 20px; }
.step-bar .inner { max-width: 70ch; margin: 0 auto; padding: .75rem 0; display: flex; gap: 1rem; align-items: center; justify-content: space-between; }
.timer { display: flex; align-items: center; gap: .6rem; font-size: .92rem; color: var(--muted); flex-wrap: wrap; }
.timer .clock { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--orange-700); }
.timer.reached .clock { color: var(--done); }
.badge { white-space: nowrap; display: inline-block; font-size: .85rem; padding: .15rem .55rem; border-radius: 999px; background: var(--done-bg); color: var(--done); font-weight: 700; }
.badge.todo { background: var(--orange-100); color: var(--orange-700); }
.badge.muted { background: #f1ebe5; color: var(--muted); }

.question { margin: 1.75rem 0; padding: 0; border: 0; }
.question legend { font-weight: 700; color: var(--brown-900); margin-bottom: .6rem; padding: 0; }
.question .prompt { font-family: var(--serif); font-size: 1.05rem; }
.choice { display: flex; gap: .6rem; align-items: flex-start; padding: .6rem .8rem; border: 1.5px solid var(--line); border-radius: 10px; margin: .45rem 0; font-weight: 400; cursor: pointer; }
.choice:hover { border-color: var(--orange-400); }
.choice:has(input:checked) { border-color: var(--orange-700); background: var(--orange-50); }
.choice input { margin-top: .3rem; accent-color: var(--orange-700); }
.question.ok legend::after { content: " — juste"; color: var(--done); }
.question.ko legend::after { content: " — à revoir"; color: var(--danger); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin: 1rem 0 2rem; }
.stats div { background: var(--white); padding: 1rem; }
.stats strong { display: block; font-size: 1.6rem; color: var(--brown-900); font-variant-numeric: tabular-nums; }
.stats span { color: var(--muted); font-size: .9rem; }
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .93rem; background: var(--white); }
table.data th { text-align: left; font-weight: 650; color: var(--muted); border-bottom: 2px solid var(--line); padding: .55rem .6rem; white-space: nowrap; }
table.data td { border-bottom: 1px solid var(--line); padding: .55rem .6rem; vertical-align: top; }
table.data td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.search { display: flex; gap: .5rem; max-width: 560px; margin: 1rem 0; }
.toolbar { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; margin: 1rem 0; }
.warn-list { color: var(--orange-700); font-size: .88rem; margin: .2rem 0 0; }
.login { max-width: 420px; margin: 7vh auto 0; }
.login .btn { width: 100%; margin-top: 1.5rem; }

/* ---------------------------------------------------------------- mobile */
@media (max-width: 960px) {
  .hero .wrap, .offer-head .wrap, .offer-body, .recap { grid-template-columns: 1fr; }
  .buy-card { position: static; }
  .offer-grid { grid-template-columns: repeat(2, 1fr); }
  .steps, .proof ul { grid-template-columns: repeat(2, 1fr); }
  .site-footer .cols { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  body { font-size: 16px; }
  .wrap { padding: 0 16px; }
  .menu-toggle { display: inline-block; }
  .main-nav, .header-actions { display: none; }
  .site-header.open .wrap { flex-wrap: wrap; padding-bottom: 1rem; }
  .site-header.open .main-nav, .site-header.open .header-actions { display: flex; flex-direction: column; align-items: stretch; width: 100%; margin: 0; gap: .25rem; }
  .site-header.open .main-nav a { padding: .7rem 0; border-bottom: 1px solid var(--line); }
  .domains, .funding, .offer-grid, .grid-2, .results { grid-template-columns: 1fr; }
  .steps, .proof ul, .site-footer .cols { grid-template-columns: 1fr; }
  .course-list a { grid-template-columns: 1fr; }
  .course-head .meter { width: 100%; }
  .step-bar { margin: 3rem -16px 0; padding: 0 16px; }
  .step-bar .inner { flex-wrap: wrap; }
  .section { padding: 3rem 0; }
  .passports { padding: 1.25rem; }
  .cta-band { padding: 1.5rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
.plain { border: 0; padding: 0; margin: 0; }
.plain legend { padding: 0; color: var(--brown-900); margin-bottom: .2rem; }
mark { background: var(--orange-100); color: var(--brown-900); padding: 0 .2em; border-radius: 3px; }
.spaced { margin-top: 2rem; }
.pick-list { max-height: 320px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; padding: .5rem 1rem; }

/* Lecture à voix haute */
.listen { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin: -.4rem 0 1.4rem; }
.listen[hidden] { display: none; }
.listen label { display: inline-flex; align-items: center; gap: .4rem; margin: 0; font-size: .9rem; color: var(--muted, #6b5644); }
.listen select { width: auto; margin: 0; padding: .35rem .5rem; }

/* Tableau de bord : choses à faire */
.alerts { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 1.2rem; }
.alerts .flash { margin: 0; text-decoration: none; font-weight: 600; }

/* ---------------------------------------------------------------- espace : composants */
.icon { vertical-align: -4px; }
.btn .icon { margin-right: .4rem; }
.btn.small .icon { width: 16px; height: 16px; margin-right: .3rem; }
.muted { color: var(--muted); }
.page-top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .5rem 1rem; margin-bottom: 1rem; }
.page-top h1 { margin: 0; }
.page-top .muted { margin: 0; }
.panel { background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 1.25rem clamp(1rem, 2vw, 1.5rem); margin: 0 0 1.5rem; }
.panel h2 { font-size: 1.2rem; margin: 0 0 .75rem; }
.panel h3 { font-size: 1.05rem; margin: 0 0 .5rem; }
.panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; margin-bottom: .75rem; }
.panel-head h2 { margin: 0; }
.stats a { display: block; text-decoration: none; color: inherit; }
.stats a:hover strong { color: var(--orange-700); }
.segmented { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.segmented a { padding: .35rem .85rem; text-decoration: none; color: var(--brown-800); font-weight: 600; font-size: .9rem; }
.segmented a + a { border-left: 1px solid var(--line); }
.segmented a[aria-current="page"] { background: var(--orange-700); color: var(--white); }
.callout { background: var(--orange-50); border: 1px solid var(--orange-200); border-radius: 12px; padding: .9rem 1.1rem; margin: 0 0 1.5rem; }
.callout p { margin: .25rem 0; }
.callout input { width: 100%; margin-top: .4rem; }
code { background: var(--orange-50); padding: .05rem .3rem; border-radius: 4px; font-size: .9em; }

/* Graphiques : une série par graphique, colonnes fines, axes discrets. */
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; }
.chart { margin: 0; }
.chart figcaption { font-weight: 700; color: var(--brown-900); margin-bottom: .4rem; font-size: .95rem; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: #efe6dc; stroke-width: 1; }
.chart .axis { stroke: #d9c9b8; stroke-width: 1; }
.chart .tick { fill: var(--muted); font-size: 12px; font-family: var(--font); }
.chart .val { fill: var(--text); font-size: 12px; font-weight: 700; font-family: var(--font); }
.chart .bar path { fill: var(--orange-600); }
.chart .bar .hit { fill: transparent; }
.chart .bar:hover .hit { fill: rgba(239, 154, 76, .12); }
.chart .bar:hover path { fill: var(--orange-700); }
.chart-table { margin-top: .4rem; font-size: .88rem; }
.chart-table summary { cursor: pointer; color: var(--muted); }
.chart-table table { margin-top: .5rem; max-width: 320px; }

.feed { list-style: none; padding: 0; margin: 0; }
.feed li { display: grid; grid-template-columns: 105px 1fr; gap: 1rem; padding: .45rem 0; border-bottom: 1px solid var(--line); font-size: .93rem; }
.feed time { white-space: nowrap; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Fiche stagiaire */
.profile-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem 2rem; align-items: flex-start; margin-bottom: 1rem; }
.profile-head h1 { margin-bottom: .25rem; }
.profile-head p { margin: 0; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.actions form { margin: 0; }
.tabs { display: flex; flex-wrap: wrap; gap: .25rem; margin: 0 0 1rem; position: sticky; top: 0; z-index: 5; background: #fbf7f2; padding: .5rem 0; }
.tabs a { padding: .35rem .8rem; border-radius: 999px; text-decoration: none; color: var(--brown-800); font-weight: 600; font-size: .9rem; border: 1px solid var(--line); background: var(--white); }
.tabs a:hover { border-color: var(--orange-400); }
.enrol { border-top: 1px solid var(--line); padding: 1rem 0; scroll-margin-top: 60px; }
.enrol:first-of-type { border-top: 0; padding-top: 0; }
.enrol.is-off { opacity: .65; }
.enrol-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 2rem; }
.enrol-head h3 { margin: 0 0 .2rem; }
.enrol-head p { margin: 0; }
.enrol-progress { min-width: 200px; font-size: .9rem; }
.enrol-progress .meter { display: block; margin-top: .35rem; }
.enrol details, .add-box { margin-top: .6rem; }
.enrol summary, .add-box summary { cursor: pointer; font-weight: 600; color: var(--orange-700); }
.add-box { border-top: 1px solid var(--line); padding-top: 1rem; }
table.data.step-table tr.group td { background: var(--orange-50); font-weight: 700; color: var(--brown-800); }
table.data .kind { font-size: .78rem; background: var(--orange-100); color: var(--orange-700); border-radius: 4px; padding: 0 .35rem; font-weight: 700; }
table.data td form { margin: 0; }
table.data tr.total td { font-weight: 700; border-top: 2px solid var(--line); }
table.data.compact { font-size: .85rem; }
table.data.compact td { padding: .3rem .5rem; }
pre.mail { white-space: pre-wrap; font: inherit; font-size: .9rem; background: var(--orange-50); padding: .75rem; border-radius: 8px; margin: .4rem 0 0; }

/* Formulaires de l'espace */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .75rem 1rem; align-items: end; margin-top: .6rem; }
.form-grid label, .stack label { display: flex; flex-direction: column; gap: .3rem; font-weight: 600; font-size: .9rem; margin: 0; }
.form-grid .wide { grid-column: 1 / -1; }
.form-grid label.check, .stack label.check { flex-direction: row; align-items: center; font-weight: 500; }
.form-grid input, .form-grid select, .stack input, .stack select, .stack textarea { margin: 0; }
.form-grid .btn { justify-self: start; }
.stack { display: flex; flex-direction: column; gap: .75rem; }
.stack .btn { align-self: flex-start; }
.two-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; margin-bottom: 1.5rem; }
.two-cols .panel { margin: 0; }
.filters-bar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: end; margin: 0 0 1.25rem; }
.filters-bar label { display: flex; flex-direction: column; gap: .25rem; font-size: .85rem; font-weight: 600; }
.filters-bar input, .filters-bar select { margin: 0; width: auto; }
.filters-bar input[type="search"] { flex: 1; min-width: 220px; }
.filters-bar .spacer { flex: 1; }

/* Espace stagiaire */
.resume { display: grid; gap: .35rem; background: var(--brown-900); color: var(--orange-100); border-radius: 14px; padding: 1.4rem 1.5rem; text-decoration: none; margin-bottom: 1.5rem; max-width: 760px; }
.resume strong { color: var(--white); font-size: 1.3rem; line-height: 1.3; }
.resume-label { font-size: .9rem; color: var(--orange-200); }
.resume .meter { background: rgba(249, 207, 163, .25); margin-top: .5rem; }
.resume .meter > span { background: var(--orange-400); }
.resume-foot { font-size: .88rem; }
.resume .btn { justify-self: start; margin-top: .5rem; background: var(--orange-400); color: var(--brown-900); border-color: var(--orange-400); }
.resume:hover .btn { background: var(--white); border-color: var(--white); }
.course-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.course-card { background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 1.1rem; display: flex; flex-direction: column; gap: .5rem; }
.course-card h3 { font-size: 1.02rem; margin: 0; line-height: 1.35; }
.course-card h3 a { color: var(--brown-900); text-decoration: none; }
.course-card h3 a:hover { color: var(--orange-700); }
.course-card p { margin: 0; font-size: .88rem; }
.course-card-foot { display: flex; justify-content: space-between; align-items: center; margin-top: auto !important; padding-top: .4rem; }
.course-card.done { background: #fdfaf6; }
.course-cta { display: flex; flex-direction: column; gap: .5rem; min-width: 220px; }
.course-cta .btn { align-self: flex-start; }

/* Relevé d'assiduité : écran et impression */
.report { background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: clamp(1rem, 3vw, 2rem); }
.report-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem 2rem; border-bottom: 2px solid var(--brown-900); padding-bottom: 1rem; margin-bottom: 1rem; }
.report-head h1 { margin: .2rem 0; }
.report-head p { margin: 0; }
.report-meta { display: grid; grid-template-columns: auto 1fr; gap: .2rem 1rem; margin: 0; font-size: .92rem; }
.report-meta dt { color: var(--muted); }
.report-meta dd { margin: 0; font-weight: 600; }
.report h2 { font-size: 1.1rem; margin: 1.75rem 0 .6rem; }
.report-foot { border-top: 1px solid var(--line); margin-top: 2rem; padding-top: .75rem; font-size: .85rem; color: var(--muted); }
@media print {
  .side, .no-print, .flash, .skip { display: none !important; }
  .shell { display: block; }
  body.has-side { background: var(--white); font-size: 11pt; }
  main.app { padding: 0; max-width: none; }
  .report { border: 0; padding: 0; }
  .stats { break-inside: avoid; }
  table.data { font-size: 9pt; }
  table.data tr { break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
}
.h2like { font-size: 1.2rem; font-weight: 800; color: var(--brown-900); cursor: pointer; }
.report .stats strong { font-size: 1.35rem; }
.stats { background: var(--white); gap: 0; border-width: 1px 0 0 1px; }
.stats > div { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
@media screen and (max-width: 900px) { .report table.data { display: block; overflow-x: auto; } }
[hidden] { display: none !important; }
.btn.danger { background: var(--white); color: var(--danger); border-color: var(--danger); }
.btn.danger:hover { background: var(--danger); color: var(--white); }
.enrol-remove { margin: .6rem 0 0; text-align: right; }
.side-nav a.side-user { margin: 0 0 .2rem; font-weight: 600; color: var(--orange-100); }
.side-user span { display: flex; flex-direction: column; min-width: 0; }
.side-user small { font-weight: 500; font-size: .78rem; color: var(--orange-200); opacity: .8; }
.chart a { cursor: pointer; }
.chart a:focus-visible .hit { fill: rgba(31, 95, 191, .12); }

/* Interrupteur */
.switch-row { margin-bottom: .75rem; }
.switch { display: inline-flex; align-items: center; gap: .75rem; cursor: pointer; font-weight: 600; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track { width: 46px; height: 26px; border-radius: 999px; background: #d6c6b6; position: relative; flex: none; transition: background .15s; }
.switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--white); box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.switch input:checked + .switch-track { background: var(--orange-700); }
.switch input:checked + .switch-track::after { transform: translateX(20px); }
.switch input:focus-visible + .switch-track { outline: 3px solid var(--focus); outline-offset: 2px; }
.inline-num { display: flex; align-items: center; gap: .5rem; font-weight: 500; }
.inline-num input { width: 5rem; }
@media (prefers-reduced-motion: reduce) { .switch-track, .switch-track::after { transition: none; } }

/* Travaux à rendre */
.work { margin-top: 2.5rem; border-top: 2px solid var(--brown-900); padding-top: 1rem; }
.work h2 { margin-top: 0; }
.work-status { background: var(--orange-50); border: 1px solid var(--orange-200); border-radius: 10px; padding: .75rem 1rem; margin-bottom: 1rem; }
.work-status.approved { background: var(--done-bg); border-color: #b9dcc6; }
.work-status p { margin: .3rem 0; }
.feedback { background: var(--white); border-radius: 8px; padding: .75rem; margin-top: .5rem; }
.bulk-bar { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 .75rem; }
.work-review { align-items: start; }
.work-text { white-space: normal; background: #fdfaf6; border: 1px solid var(--line); border-radius: 8px; padding: 1rem; max-height: 520px; overflow: auto; }
.work-pdf { width: 100%; height: 640px; border: 1px solid var(--line); border-radius: 8px; }
.work-img { max-width: 100%; border: 1px solid var(--line); border-radius: 8px; }
.ai-box { background: var(--orange-50); border-radius: 8px; padding: .6rem .9rem; margin-bottom: .75rem; }
.ai-box p { margin: .25rem 0; }
.lesson-body.small { font-size: .9rem; max-height: 360px; overflow: auto; }
.step-row { border-top: 1px solid var(--line); padding: .55rem 0; scroll-margin-top: 60px; }
.step-row summary { display: flex; justify-content: space-between; gap: 1rem; cursor: pointer; }
.step-tags { display: flex; gap: .3rem; flex-wrap: wrap; justify-content: flex-end; }
.step-row .kind, h2 .badge { font-size: .75rem; }
h2 .badge { margin-left: .5rem; vertical-align: middle; }

/* Bilan et radar */
.bilan-scores { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; }
.reco ul { list-style: none; padding: 0; margin: .4rem 0; display: grid; gap: .3rem; }
.reco h3, .synthesis h3 { font-size: 1rem; margin: 1rem 0 .3rem; }
.synthesis p { margin: .3rem 0; }
.radar { margin: 1rem 0 0; max-width: 820px; }
.radar svg { width: 100%; height: auto; overflow: visible; }
.radar .ring { fill: none; stroke: #ece2d6; stroke-width: 1; }
.radar .spoke { stroke: #ece2d6; stroke-width: 1; }
.radar .ring-label { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.radar .axis-label { fill: var(--text); font-size: 12px; font-family: var(--font); }
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; padding: 0; margin: 0 0 .25rem; font-size: .9rem; }
.legend li { display: flex; align-items: center; gap: .4rem; white-space: nowrap; }
.waive { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: .75rem; }
.waive p { flex-basis: 100%; margin: 0; }
.waive form { margin: 0; }
.small-note { font-size: .85rem; margin: 0; }
.switch .muted { font-weight: 400; }
.durations .meter { display: block; max-width: 520px; margin-bottom: .75rem; }
.callout.locked ul { margin: .4rem 0; }
input.hours { width: 6rem; margin: 0; }

/* Durées par bloc et par partie : colonnes chiffrées étroites sur mobile */
.durations-table th.num, .durations-table td.num { white-space: normal; }
@media (max-width: 600px) {
  .durations-table th, .durations-table td { padding-left: .4rem; padding-right: .4rem; }
}
.specialities fieldset { border: 1px solid var(--line, #e5d6c6); border-radius: 8px; padding: .5rem 1rem; margin: .75rem 0 .5rem; }
.specialities .check { display: flex; gap: .5rem; align-items: center; padding: .2rem 0; }

/* Vérification publique d'un livret */
.verify .narrow { max-width: 720px; }
.verify-result { border-radius: var(--radius); padding: 1rem 1.25rem; margin: 1.25rem 0; border: 1px solid; }
.verify-result.ok { background: var(--done-bg); border-color: var(--done); color: #1d4d31; }
.verify-result.bad { background: #fbe9e7; border-color: var(--danger); color: #7a1912; }
.verify-result p { margin: .25rem 0; }
.verify-facts { display: grid; grid-template-columns: minmax(0, 11rem) minmax(0, 1fr); gap: .5rem 1rem; margin: 1.5rem 0; }
.verify-facts dt { color: var(--muted); }
.verify-facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.verify-file { border-top: 1px solid var(--line); padding-top: 1rem; }
.verify-file h2 { font-size: 1.15rem; }
.verify-hash-result.ok { color: var(--done); font-weight: 600; }
.verify-hash-result.bad { color: var(--danger); font-weight: 600; }
@media (max-width: 560px) { .verify-facts { grid-template-columns: minmax(0, 1fr); gap: .1rem; } .verify-facts dd { margin-bottom: .6rem; } }

/* Livrets de formation */
.livret-images { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 1rem; margin-bottom: 1rem; }
.livret-image { border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem; min-width: 0; }
.livret-image p { margin: 0 0 .4rem; }
.livret-image img { display: block; max-width: 100%; max-height: 90px; margin-bottom: .4rem; background: #fff; }
.livret-image input[type=file] { max-width: 100%; }
.check-list { margin: .25rem 0 1rem; padding-left: 1.2rem; }
.check-list.bad li { color: var(--danger); }
.check-list.warn li { color: #8a5a00; }
.ok-line { color: var(--done); font-weight: 600; }
.livret-check .actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.livret-check .actions form { margin: 0; }
.livret-unit { border-top: 1px solid var(--line); padding: .5rem 0; }
.livret-unit > summary { display: flex; justify-content: space-between; gap: 1rem; cursor: pointer; font-weight: 600; flex-wrap: wrap; }
.livret-unit > summary span:last-child { font-weight: 400; }
.livret-rows caption { text-align: left; font-weight: 600; padding: .6rem 0 .3rem; }
.livret-rows input[type=date] { min-width: 9.5rem; }
.livret-rows input.hours { width: 6.5rem; }
.livret-rows tr.changed td { background: var(--orange-50); }
.livret-rows tr.new-row td { background: #fbfaf8; }
.warn-text { color: var(--danger); }
.livret-total { margin-top: 1rem; }
.sticky-save { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--white) 35%); padding: 1rem 0 .75rem; margin: 0; z-index: 2; }
dl.facts { display: grid; grid-template-columns: minmax(0, 12rem) minmax(0, 1fr); gap: .4rem 1rem; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.mono-break { overflow-wrap: anywhere; font-size: .85em; }
@media (max-width: 600px) { dl.facts { grid-template-columns: minmax(0, 1fr); gap: 0; } dl.facts dd { margin-bottom: .5rem; } }
.livret-line { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem 1rem; padding: .6rem 0; border-top: 1px solid var(--line); }
.livret-line form { margin: 0; }
#reglages { margin-top: 2rem; }

/* Encadré « Mise à jour » ajouté en fin de leçon */
.lesson-body .callout.update { margin: 1.6rem 0 0; font-size: .95rem; }
.lesson-body .callout.update small { color: var(--muted); }

/* Éditeur de contenu */
.rte { border: 1px solid var(--line, #d9cdbf); border-radius: 10px; background: #fff; overflow: hidden; }
.rte-bar { display: flex; flex-wrap: wrap; gap: .25rem; padding: .4rem; border-bottom: 1px solid var(--line, #d9cdbf); background: var(--orange-50, #fff8f1); position: sticky; top: 0; z-index: 2; }
.rte-btn { font: inherit; font-size: .85rem; padding: .25rem .55rem; border: 1px solid transparent; border-radius: 6px; background: transparent; cursor: pointer; }
.rte-btn:hover, .rte-btn[aria-pressed="true"] { background: #fff; border-color: var(--line, #d9cdbf); }
.rte-bold { font-weight: 700; } .rte-italic { font-style: italic; } .rte-underline { text-decoration: underline; }
.rte-body { min-height: 14rem; padding: .9rem 1rem; outline: none; overflow-wrap: anywhere; }
.rte-body:focus { box-shadow: inset 0 0 0 2px var(--orange-200, #f3c9a4); }
.rte .rte-body img { max-width: 100%; height: auto; }
.rte textarea { width: 100%; min-height: 14rem; border: 0; padding: .9rem 1rem; font: .85rem/1.5 ui-monospace, monospace; }
.builder-module { margin-bottom: 1.2rem; }
.builder-module > header { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-bottom: .6rem; }
.builder-module > header form { display: flex; gap: .4rem; flex: 1 1 16rem; }
.builder-module > header input[type=text] { flex: 1; font-weight: 600; }
.builder-steps { list-style: none; margin: 0 0 .8rem; padding: 0; }
.builder-steps li { display: flex; gap: .6rem; align-items: center; justify-content: space-between; padding: .5rem .2rem; border-top: 1px solid var(--line, #eadfd2); }
.builder-steps .tools { display: flex; gap: .25rem; align-items: center; flex-shrink: 0; }
.builder-steps .tools form { display: inline; }
.icon-btn { font: inherit; border: 1px solid var(--line, #d9cdbf); background: #fff; border-radius: 6px; padding: .15rem .5rem; cursor: pointer; }
.icon-btn:disabled { opacity: .4; cursor: default; }
.add-step { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.add-step input[type=text] { flex: 1 1 14rem; }
.answer-row { display: flex; gap: .6rem; align-items: center; margin-bottom: .5rem; flex-wrap: wrap; }
.answer-row input[type=text] { flex: 1 1 18rem; }
.step-edit-grid { display: grid; gap: 1rem; }
@media (min-width: 900px) { .step-edit-grid { grid-template-columns: minmax(0, 1fr) 18rem; align-items: start; } }
.revisions { list-style: none; padding: 0; margin: 0; font-size: .9rem; }
.revisions li { display: flex; justify-content: space-between; gap: .5rem; padding: .35rem 0; border-top: 1px solid var(--line, #eadfd2); }
.add-step select { width: auto; flex: 0 0 auto; }
.builder-module > header { flex-wrap: nowrap; }
.builder-module > header form:first-child { flex: 1 1 auto; min-width: 0; }
.builder-module > header .btn { white-space: nowrap; }
@media (max-width: 700px) { .builder-module > header { flex-wrap: wrap; } }

/* Options de quiz et supports */
.quiz-timer { font-size: 1.05rem; margin: .5rem 0 1rem; }
.quiz-timer.urgent strong { color: #b42318; }
.quiz-nav { display: flex; gap: .6rem; margin: 1rem 0; }
.choice.is-correct { font-weight: 600; }
.explanation { margin-top: .6rem; padding: .6rem .8rem; background: var(--orange-50, #fff8f1); border-radius: 8px; font-size: .95rem; }
.callout.materials h2 { margin: 0 0 .4rem; font-size: 1.05rem; }
.rail li.locked a { opacity: .6; }

/* Dossier Qualiopi */
details.qual{border-top:1px solid var(--line,#e5d9cc);padding:.6rem 0}
details.qual summary{cursor:pointer}
details.qual .badge{margin-left:.5rem}
.proofs{margin:.5rem 0 .5rem 1.1rem}
.evidence{display:flex;justify-content:space-between;gap:1rem;border-left:3px solid var(--accent,#c2570c);padding:.3rem .8rem;margin:.5rem 0;background:rgba(0,0,0,.02)}
.evidence p{margin:.2rem 0}
.evidence-form{margin:.6rem 0}
.survey-rating .choices{display:flex;gap:.5rem;flex-wrap:wrap}

/* Assistant du stagiaire */
details.assistant{margin:2rem 0;border:1px solid var(--line,#e5d9cc);border-radius:8px;padding:.8rem 1rem}
details.assistant summary{cursor:pointer;font-weight:600}
.chat{max-height:22rem;overflow-y:auto;display:flex;flex-direction:column;gap:.5rem;margin:.6rem 0}
.chat:empty{display:none}
.chat p{margin:.2rem 0}
.chat-q{align-self:flex-end;max-width:85%;background:var(--orange-100,#fdebd6);border-radius:12px 12px 2px 12px;padding:.45rem .8rem;margin:0}
.chat-a{align-self:flex-start;max-width:90%;background:var(--white,#fff);border:1px solid var(--line,#e5d9cc);border-radius:12px 12px 12px 2px;padding:.45rem .8rem}
.chat-wait{opacity:.7;font-style:italic}
.chat-err{border-color:#c0392b}
.chat-form{display:flex;gap:.5rem;align-items:flex-end}
.chat-form textarea{flex:1;resize:vertical}

/* Mode tunnel */
.tunnel-bar{height:6px;background:rgba(0,0,0,.08);border-radius:3px;margin:0 0 1.5rem;overflow:hidden}
.tunnel-bar span{display:block;height:100%;background:var(--accent,#c2570c);transition:width .25s}
.tunnel-step legend{font-size:1.25rem;font-weight:600;margin-bottom:1rem}
.tunnel-step .choices{display:flex;gap:.6rem;flex-wrap:wrap}
.tunnel-back{margin-top:1rem}
.tunnel-step[hidden]{display:none}
@media (prefers-reduced-motion:reduce){.tunnel-bar span{transition:none}}

/* Bouton musique discret */
.music-fab{position:fixed;right:18px;bottom:88px;width:46px;height:46px;border-radius:50%;display:flex;align-items:center;justify-content:center;background:var(--white,#fff);color:var(--orange-600,#c2570c);border:2px solid var(--orange-400,#e8913f);box-shadow:0 4px 14px rgba(51,32,15,.25);text-decoration:none;font-size:22px;opacity:1;z-index:30}
.music-fab:hover,.music-fab:focus-visible{background:var(--orange-100,#fdebd8)}
@media print{.music-fab{display:none}}
body.tunnel-page{background:#fbf6f0}
.tunnel-head{display:flex;justify-content:space-between;align-items:center;padding:14px 24px}
.tunnel-main{max-width:760px;margin:0 auto;padding:24px 16px 80px}
.tunnel-main h1{font-size:1.6rem;margin:.2rem 0 .4rem}
.tunnel-main .lead{color:#6b5a48}
.tunnel-actions{display:flex;gap:12px;align-items:center;margin-top:1.5rem;flex-wrap:wrap}
.tunnel-main textarea{min-height:7rem}
.tunnel-main .field-help{display:block;font-size:.85rem;color:#7a6a5a;margin:.15rem 0 .3rem}
.todo-mark{background:#fff1d6;border-left:3px solid #c2570c;padding:.4rem .6rem;margin:.4rem 0;font-size:.9rem}
.verdict-ok{color:#2f7a3a}.verdict-a_renforcer{color:#a8680f}.verdict-manquant{color:#b3261e}

.buy-card.open { position: static; }
#rsv fieldset.plain { margin: 1rem 0 0; padding: 0; border: 0; }
#rsv legend { padding: 0; margin-bottom: .3rem; }

.quiz-progress { height: 6px; background: var(--line, #e6d9c9); border-radius: 999px; margin: 0 0 1.2rem; overflow: hidden; }
.quiz-progress span { display: block; height: 100%; background: var(--orange-600, #a4501f); border-radius: 999px; transition: width .3s; }
.quiz-result { text-align: center; margin: 1.5rem 0 2rem; padding: 2rem 1.2rem; border-radius: 18px; background: #fff8f1; border: 1px solid var(--line, #e6d9c9); }
.quiz-result.passed { background: #f1faf3; border-color: #bfe3c7; }
.quiz-result .score { font-size: 3.4rem; font-weight: 800; line-height: 1; margin: 0 0 .4rem; }
.quiz-result .actions { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; margin-top: 1.2rem; }
details.correction { margin: 1.5rem 0; }
details.correction > summary { cursor: pointer; font-weight: 700; }
.celebrate-canvas { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 60; }

/* Plan de la formation à côté de la leçon (désactivable : mode focus) */
.step-layout{display:grid;grid-template-columns:minmax(220px,280px) minmax(0,1fr);gap:2rem;align-items:start}
.step-layout .reading{margin:0;max-width:70ch}
.outline{position:sticky;top:1rem;max-height:calc(100vh - 7rem);overflow-y:auto;background:var(--white);border:1px solid var(--line);border-radius:12px;padding:.9rem 1rem;font-size:.92rem}
.outline-title{font-weight:800;margin:0 0 .6rem}
.outline-title a{text-decoration:none;color:inherit}
.outline details{border-top:1px solid var(--line);padding:.35rem 0}
.outline summary{cursor:pointer;font-weight:700}
.outline summary a{text-decoration:none;color:inherit}
.outline ol{list-style:none;margin:.3rem 0 .2rem;padding:0}
.outline li a{display:block;padding:.25rem .5rem;border-radius:6px;text-decoration:none;color:inherit}
.outline li a:hover{background:var(--orange-100)}
.outline li.completed a::before{content:"✓ ";color:var(--orange-600)}
.outline li.current a{background:var(--orange-100);font-weight:700}
.outline li.locked a{opacity:.55}
.crumbs .focus-toggle{margin-left:.75rem;vertical-align:middle}
body.focus .step-layout{grid-template-columns:minmax(0,1fr)}
body.focus .step-layout .outline{display:none}
body.focus .step-layout .reading{margin:0 auto}
@media(max-width:980px){.step-layout{grid-template-columns:minmax(0,1fr)}.reading{order:1}.outline{order:2;position:static;max-height:none;margin-top:1.5rem}.crumbs .focus-toggle{display:none}.plan-link{display:inline-block}}
.plan-link{display:none;margin-left:.75rem;font-size:.9rem}
@media print{.outline,.focus-toggle{display:none}}
details.module{margin:.5rem 0 0;background:var(--white);border:1px solid var(--line);border-radius:10px}
details.module>summary{display:grid;grid-template-columns:1.1rem minmax(0,1fr) auto;align-items:center;gap:.6rem;padding:.7rem 1rem;cursor:pointer;list-style:none;text-align:left}
details.module>summary::-webkit-details-marker{display:none}
details.module>summary::before{content:"";width:.45rem;height:.45rem;border-right:2px solid var(--muted);border-bottom:2px solid var(--muted);transform:rotate(-45deg);transition:transform .15s}
details.module[open]>summary::before{transform:rotate(45deg)}
details.module>summary h2{margin:0;font-size:1rem;font-weight:700;text-align:left}
details.module>summary .muted{font-size:.82rem;white-space:nowrap}
details.module[open]>summary{border-bottom:1px solid var(--line)}
details.module .rail{padding:.4rem 1rem .6rem 2.4rem}
details.module .rail::before{left:1.3rem}
details.module .rail li::before{left:-1.4rem}
details.module .rail a{padding:.4rem .6rem}
@media(prefers-reduced-motion:reduce){details.module>summary::before{transition:none}}
.lesson-body .maj{border-left:3px solid var(--orange-400);padding-left:.8rem}
.more-courses{margin-top:2.5rem}
.waiting{max-width:60ch}

.module-index{padding:.9rem 1.25rem}.module-index h2{font-size:1rem;margin:0 0 .4rem}.module-index ol{margin:0;padding-left:1.2rem;columns:2;font-size:.92rem}@media(max-width:700px){.module-index ol{columns:1}}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}

/* Confort de lecture (barre d'accessibilité) */
.a11y-fab{position:fixed;right:18px;bottom:140px;width:46px;height:46px;border-radius:50%;display:flex;align-items:center;justify-content:center;background:var(--white);color:var(--brown-900);border:2px solid var(--brown-600);box-shadow:0 4px 14px rgba(51,32,15,.25);font:700 15px var(--font);cursor:pointer;z-index:30}
.a11y-panel{position:fixed;right:18px;bottom:196px;width:min(300px,calc(100vw - 36px));background:var(--white);border:1px solid var(--line);border-radius:12px;box-shadow:var(--shadow);padding:1rem;z-index:31}
.a11y-panel[hidden]{display:none}
.a11y-panel h2{font-size:1rem;margin:0 0 .6rem}
.a11y-panel button{display:block;width:100%;text-align:left;margin:.25rem 0;padding:.5rem .7rem;border:1px solid var(--line);border-radius:8px;background:var(--orange-50);color:var(--text);font:inherit;cursor:pointer}
.a11y-panel button[aria-pressed="true"]{background:var(--brown-900);color:var(--white)}
.a11y-panel .row{display:flex;gap:.4rem}
.a11y-panel .row button{text-align:center}
html[data-a11y-size="1"]{font-size:112.5%}
html[data-a11y-size="2"]{font-size:125%}
html[data-a11y-size="3"]{font-size:150%}
html.a11y-dys body{font-family:Verdana,"Trebuchet MS","Comic Sans MS",Arial,sans-serif;letter-spacing:.04em;word-spacing:.12em}
html.a11y-dys .prose,html.a11y-dys .lesson{font-family:inherit;text-align:left}
html.a11y-space body{line-height:2;letter-spacing:.05em;word-spacing:.16em}
html.a11y-space p{margin-block:1.1em;max-width:70ch}
html.a11y-contrast{--text:#000;--muted:#222;--line:#000;--white:#fff;--orange-50:#fff;--orange-100:#fff;--orange-600:#7a2e00;--orange-700:#5c2200}
html.a11y-contrast body{background:#fff;color:#000}
html.a11y-contrast a{text-decoration:underline}

/* Protection des contenus : filigrane nominatif et copie découragée (dissuasion, pas un verrou) */
.reading{position:relative}
.reading .wm{position:absolute;inset:0;pointer-events:none;z-index:1;background-repeat:repeat}
.reading .lesson-body{-webkit-user-select:none;user-select:none}
.reading .lesson-body input,.reading .lesson-body textarea{-webkit-user-select:text;user-select:text}
@media print{.reading .lesson-body{display:none}.reading::before{content:"L'impression des contenus de formation n'est pas autorisée.";display:block}}

/* Vidéos des leçons : pleine largeur du texte, format 16/9 (les anciennes intégrations avaient une taille fixe minuscule) */
.lesson-body iframe[src*="youtube"], .lesson-body iframe[src*="youtu.be"], .lesson-body iframe[src*="vimeo"], .lesson-body iframe[src*="dailymotion"] { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; border: 0; margin: 1.25rem 0; border-radius: 10px; }
.lesson-body video { display: block; width: 100%; height: auto; max-height: 80vh; background: #000; margin: 1.25rem 0; border-radius: 10px; }
.lesson-body .wp-video, .lesson-body .mejs-container { width: 100% !important; max-width: 100%; }

/* Sélecteur de thèmes de l'accueil */
.theme-chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1.5rem; }
.theme-chips button { padding: .45rem .9rem; border-radius: 999px; border: 1.5px solid var(--line); background: var(--white); color: var(--brown-800); font: 600 .92rem var(--font); cursor: pointer; }
.theme-chips button[aria-pressed="true"] { background: var(--brown-900); border-color: var(--brown-900); color: var(--white); }
.theme-chips button:hover { border-color: var(--orange-600); }
.offer-card[hidden] { display: none; }

/* Lecteur de musique intégré (hors de la page : jamais rechargé) */
.music-fab { border: 2px solid var(--orange-400); cursor: pointer; font-family: inherit; }
.music-panel { position: fixed; right: 18px; bottom: 150px; width: min(380px, calc(100vw - 36px)); background: var(--white); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: .6rem .7rem .7rem; z-index: 31; transition: transform .2s, opacity .2s; }
.music-panel:not(.open) { transform: translateY(24px); opacity: 0; visibility: hidden; pointer-events: none; }
.music-panel iframe { display: block; width: 100%; height: 152px; border: 0; border-radius: 12px; }
.music-panel .muted { font-size: .8rem; margin: .5rem 0 0; }
.music-bar { display: flex; align-items: center; gap: .8rem; margin-bottom: .5rem; }
.music-bar strong { flex: 1; }
.music-bar a { font-size: .85rem; }
.music-bar button { padding: .25rem .6rem; border: 1px solid var(--line); border-radius: 8px; background: var(--orange-50); font: inherit; font-size: .85rem; cursor: pointer; }
html.softnav-loading body { cursor: progress; }
@media (prefers-reduced-motion: reduce) { .music-panel { transition: none; } }

/* Dépôt en ligne : copier-coller */
.depot-field { display: grid; grid-template-columns: 1fr auto; gap: .25rem .75rem; align-items: start; padding: .55rem 0; border-top: 1px solid var(--line, #e6d9c6); }
.depot-label { grid-column: 1 / -1; font-weight: 600; font-size: .92rem; }
.depot-value { white-space: pre-wrap; overflow-wrap: anywhere; }
.depot-value.todo { color: var(--orange-700, #a8480f); font-style: italic; }

/* Miniature de PDF (attestations, livrets) */
.pdf-preview { display: flex; gap: 1rem; align-items: flex-start; flex-wrap: wrap; }
.pdf-preview .pdf-mini { display: block; position: relative; width: 168px; aspect-ratio: 210 / 297; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: #fff; box-shadow: 0 2px 6px rgba(60, 35, 10, .12); flex: none; }
.pdf-preview .pdf-mini iframe { position: absolute; top: 0; left: 0; width: 840px; height: 1188px; border: 0; transform: scale(.2); transform-origin: 0 0; pointer-events: none; }
.pdf-preview.small .pdf-mini { width: 84px; }
.pdf-preview.small .pdf-mini iframe { transform: scale(.1); }
.pdf-preview .pdf-actions { display: flex; flex-direction: column; gap: .5rem; align-items: flex-start; }
.pdf-preview.small .pdf-actions { flex-direction: row; flex-wrap: wrap; }

/* Bouton discret CHF | € à côté d'un prix */
.px { display: inline-flex; align-items: baseline; gap: .5rem; }
.px-switch { font: inherit; font-size: .7rem; line-height: 1; padding: .2rem .4rem; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--muted, #8a6f55); cursor: pointer; opacity: .7; }
.px-switch:hover, .px-switch:focus-visible { opacity: 1; }
.px-switch[aria-pressed="true"] { background: var(--line); }

.afa-cas{border-left:4px solid var(--accent,#c2641b);background:rgba(194,100,27,.07);padding:.6rem 1rem;margin:0 0 1rem;border-radius:0 8px 8px 0}
.afa-cas p{margin:.3rem 0}

/* Fiche formation : sur petit écran, barre prix toujours visible (le bloc d'inscription passe en bas de page) */
.buy-bar { display: none; }
@media screen and (max-width: 900px) {
  .buy-bar { display: flex; align-items: center; justify-content: space-between; gap: .75rem; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding: .6rem 1rem calc(.6rem + env(safe-area-inset-bottom)); background: var(--white); border-top: 1px solid var(--line); box-shadow: 0 -4px 14px rgba(60, 35, 10, .12); }
  .buy-bar.hidden { display: none; }
  .buy-bar .price { font-size: 1.35rem; font-weight: 850; color: var(--brown-900); line-height: 1.1; }
  .buy-bar .price small { display: block; font-size: .72rem; font-weight: 500; color: var(--muted); }
  .buy-bar-actions { display: flex; gap: .5rem; }
  .offer-body { padding-bottom: 6rem; }
}
@media print { .buy-bar { display: none !important; } }
/* Fiche formation : colonnes placées explicitement, un contenu importé mal fermé ne déplace plus le bloc prix */
.offer-body > .rich { grid-column: 1; grid-row: 1; min-width: 0; }
.offer-body > .buy-card { grid-column: 2; grid-row: 1; }
@media (max-width: 900px) { .offer-body > .rich, .offer-body > .buy-card { grid-column: 1; grid-row: auto; } }
