/* Fiche formation « tout sur une page ». Complète fiche-legacy.css. */
:root {
  --m-sans: #E4E0F3;
  --m-ab: #C2B8F2;
  --m-b: #9A8AEC;
  --m-tb: #6B5BFF;
  --m-tbf: #33249E;
  --m-na: #EFEAE6;
  --fx-ink: #1A1F36;
  --fx-soft: #5E6479;
  --fx-faint: #8A91A3;
  --fx-line: #F1E6DF;
  --fx-card: #FFFFFF;
}
html { scroll-behavior: smooth; }
main.fiche { max-width: 1040px; }
.fiche section[id], .fiche header { scroll-margin-top: 76px; }

/* ---------- En-tête ---------- */
.fx-hero { background: var(--fx-card); border: 1px solid var(--fx-line); border-radius: 28px; padding: 40px 40px 32px; margin: 8px 0 20px; }
.fx-eyebrow { display: flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--fx-soft); margin: 0 0 14px; }
.fx-eyebrow svg { width: 15px; height: 15px; }
.fx-title { font-family: 'Fraunces', serif; font-weight: 600; font-size: clamp(30px, 5vw, 46px); line-height: 1.08; letter-spacing: -0.02em; color: var(--fx-ink); margin: 0 0 8px; text-wrap: balance; }
.fx-school { font-size: 18px; font-weight: 600; color: var(--fx-soft); margin: 0 0 18px; }
.fx-badges { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 26px; }
.fx-badge { display: inline-flex; align-items: center; padding: 6px 12px; border-radius: 999px; background: #F7F2EE; color: var(--fx-ink); font-size: 13px; font-weight: 600; text-decoration: none; }
.fx-badge-strong { background: #EEEAFF; color: #33249E; }
.fx-keys { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0 0 24px; }
.fx-key { background: #FFFAF7; border: 1px solid var(--fx-line); border-radius: 18px; padding: 16px 16px 14px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.fx-key-n { font-family: 'Fraunces', serif; font-size: clamp(24px, 3.6vw, 34px); font-weight: 600; color: var(--fx-ink); line-height: 1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fx-key-l { font-size: 12.5px; color: var(--fx-soft); line-height: 1.35; }
.fx-cta { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 16px; }
.fx-btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 18px; border-radius: 14px; border: 1.5px solid var(--fx-line); background: #fff; color: var(--fx-ink); font-weight: 700; font-size: 14.5px; text-decoration: none; }
.fx-btn svg { width: 17px; height: 17px; }
.fx-btn:hover { border-color: var(--fx-ink); }
.fx-btn-primary { background: var(--fx-ink); border-color: var(--fx-ink); color: #fff; }
.fx-btn-primary:hover { background: #2B3152; }
.fx-promise { font-size: 14px; color: var(--fx-soft); margin: 0; max-width: 62ch; }

/* ---------- Sommaire ---------- */
.fx-toc { position: sticky; top: var(--fx-nav-h, 58px); z-index: 20; display: flex; gap: 6px; overflow-x: auto; padding: 10px 2px; margin: 18px -2px 8px; background: rgba(255, 250, 247, 0.94); backdrop-filter: blur(8px); scrollbar-width: none; }
.fx-toc::-webkit-scrollbar { display: none; }
.fx-toc a { flex: 0 0 auto; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--fx-line); background: #fff; font-size: 13.5px; font-weight: 600; color: var(--fx-soft); text-decoration: none; white-space: nowrap; }
.fx-toc a:hover, .fx-toc a.is-active { color: #fff; background: var(--fx-ink); border-color: var(--fx-ink); }

/* ---------- Sections et cartes ---------- */
.fx-section { margin: 44px 0 0; }
.fx-h2 { font-family: 'Fraunces', serif; font-size: clamp(25px, 3.6vw, 32px); font-weight: 600; letter-spacing: -0.015em; color: var(--fx-ink); margin: 0 0 6px; }
.fx-lead { font-size: 15.5px; color: var(--fx-soft); margin: 0 0 18px; max-width: 68ch; }
.fx-card { background: var(--fx-card); border: 1px solid var(--fx-line); border-radius: 22px; padding: 26px 28px; margin: 0 0 16px; }
.fx-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.fx-h3 { font-size: 17px; font-weight: 700; color: var(--fx-ink); margin: 0 0 12px; line-height: 1.3; }
.fx-card-head .fx-h3 { margin: 0; }
.fx-sub { font-size: 14px; color: var(--fx-soft); margin: -4px 0 16px; max-width: 72ch; }
.fx-small-title { font-size: 13px; font-weight: 700; color: var(--fx-soft); text-transform: uppercase; letter-spacing: 0.04em; margin: 0 0 10px; }
.fx-note { font-size: 13px; color: var(--fx-faint); margin: 14px 0 0; line-height: 1.55; max-width: 78ch; }
.fx-note a, .fx-more a, .fx-sources a { color: #4A3BD6; font-weight: 600; }
.fx-note-link { margin: 4px 4px 0; }
.fx-empty { font-size: 14.5px; color: var(--fx-soft); background: #FBF6F2; border-radius: 14px; padding: 14px 16px; margin: 0; }
.fx-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.fx-grid2 > .fx-card { margin-bottom: 16px; }
.fx-more { margin-top: 16px; border-top: 1px solid var(--fx-line); padding-top: 12px; }
.fx-more summary { cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--fx-soft); }
.fx-more p { font-size: 13.5px; color: var(--fx-soft); line-height: 1.6; margin: 10px 0 0; max-width: 78ch; }
.fx-pre { white-space: pre-line; }
.fx-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.fx-list li { font-size: 15px; color: var(--fx-ink); line-height: 1.45; }
.fx-list strong, .fx-big-line strong { font-family: 'Fraunces', serif; font-size: 22px; font-weight: 600; margin-right: 4px; font-variant-numeric: tabular-nums; }
.fx-list em, .fx-big-line em, .fx-meter-l em, .fx-step-head em { font-style: normal; color: var(--fx-faint); font-size: 13.5px; }
.fx-big-line { font-size: 15px; margin: 0 0 8px; color: var(--fx-ink); }

/* ---------- Mentions ---------- */
.fx-m-sans_mention, .fx-m-echec { background: var(--m-sans); color: #33249E; }
.fx-m-AB { background: var(--m-ab); color: #1F1570; }
.fx-m-B { background: var(--m-b); color: #fff; }
.fx-m-TB { background: var(--m-tb); color: #fff; }
.fx-m-TBF { background: var(--m-tbf); color: #fff; }
.fx-m-na { background: var(--m-na); }
.fx-stack { display: flex; gap: 3px; height: 54px; border-radius: 14px; overflow: hidden; }
.fx-stack-seg { display: flex; align-items: center; justify-content: center; min-width: 4px; font-size: 13.5px; font-weight: 700; flex-basis: 0; transition: opacity .2s, transform .2s; }
.fx-stack-seg span { white-space: nowrap; }
.fx-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 14px 0 0; padding: 0; font-size: 13.5px; color: var(--fx-ink); }
.fx-legend li { display: flex; align-items: baseline; gap: 6px; }
.fx-legend em { font-style: normal; color: var(--fx-faint); font-size: 12.5px; }
.fx-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: 0 0 auto; margin-right: 2px; }
.fx-score { display: flex; align-items: baseline; gap: 2px; padding: 8px 14px; border-radius: 14px; background: var(--score-bg, #F7F2EE); color: var(--score-color, var(--fx-ink)); white-space: nowrap; flex: 0 0 auto; }
.fx-score-n { font-family: 'Fraunces', serif; font-size: 26px; font-weight: 700; line-height: 1; }
.fx-score-d { font-size: 13px; font-weight: 700; margin-right: 8px; }
.fx-score-l { font-size: 12.5px; font-weight: 700; }

.fx-situer { margin-top: 22px; padding: 18px 20px; border-radius: 18px; background: #F6F4FF; }
.fx-situer-q { font-weight: 700; font-size: 15px; margin: 0 0 12px; color: var(--fx-ink); }
.fx-situer-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.fx-situer-choices button { padding: 9px 14px; border-radius: 12px; border: 1.5px solid #D9D3FA; background: #fff; font: inherit; font-size: 14px; font-weight: 600; color: var(--fx-ink); cursor: pointer; }
.fx-situer-choices button:hover { border-color: var(--m-tb); }
.fx-situer-choices button.is-active { background: var(--m-tbf); border-color: var(--m-tbf); color: #fff; }
.fx-situer-out { margin: 14px 0 0; font-size: 15px; line-height: 1.55; color: var(--fx-ink); }
.fx-situer-out strong { font-family: 'Fraunces', serif; font-size: 20px; }
.has-mention .fx-stack-seg:not(.is-you), .has-mention .fx-funnel-row:not(.is-you) { opacity: .38; }
.has-mention .fx-stack-seg.is-you { outline: 3px solid #FF7066; outline-offset: -3px; }
.has-mention tr.is-you th, .has-mention tr.is-you td { background: #FFF1EE; }
.has-mention .fx-legend li.is-you { font-weight: 700; }

.fx-trend { margin-top: 22px; }
.fx-trend-bars { display: flex; align-items: flex-end; gap: 14px; }
.fx-trend-col { flex: 1 1 0; max-width: 84px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.fx-trend-track { order: 2; width: 100%; height: 84px; display: flex; align-items: flex-end; }
.fx-trend-bar { width: 100%; min-height: 3px; border-radius: 8px 8px 3px 3px; background: var(--m-ab); }
.fx-trend-col.is-current .fx-trend-bar { background: var(--m-tb); }
.fx-trend-col span { order: 1; font-size: 13px; font-weight: 700; color: var(--fx-ink); }
.fx-trend-col em { order: 3; font-style: normal; font-size: 12px; color: var(--fx-faint); }

/* ---------- Onglets, entonnoirs, tableaux ---------- */
.fx-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 18px; }
.fx-tabs button { padding: 8px 14px; border-radius: 12px; border: 1.5px solid var(--fx-line); background: #fff; font: inherit; font-size: 14px; font-weight: 600; color: var(--fx-soft); cursor: pointer; }
.fx-tabs button span { font-weight: 500; color: var(--fx-faint); margin-left: 4px; }
.fx-tabs button.is-active { border-color: var(--fx-ink); color: var(--fx-ink); }
.fx-tabpanel { display: none; }
.fx-tabpanel.is-active { display: block; }
.fx-funnel { display: grid; gap: 10px; margin: 0 0 6px; }
.fx-funnel-row { display: grid; grid-template-columns: 120px minmax(0, 1fr) 230px; align-items: center; gap: 12px; font-size: 14px; transition: opacity .2s; }
.fx-funnel-label { font-weight: 600; color: var(--fx-ink); }
.fx-funnel-track, .fx-meter-track, .fx-step-track { display: block; height: 14px; border-radius: 999px; background: #F5EFEA; overflow: hidden; }
.fx-funnel-fill, .fx-meter-fill, .fx-step-fill { display: block; height: 100%; border-radius: 999px; }
.fx-funnel-val { color: var(--fx-soft); font-size: 13.5px; }
.fx-funnel-val strong { color: var(--fx-ink); font-size: 15px; font-variant-numeric: tabular-nums; }
.fx-table-wrap { overflow-x: auto; margin-top: 18px; border: 1px solid var(--fx-line); border-radius: 16px; }
.fx-table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; min-width: 560px; }
.fx-table th, .fx-table td { padding: 11px 14px; text-align: right; border-bottom: 1px solid var(--fx-line); white-space: nowrap; }
.fx-table thead th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--fx-faint); font-weight: 700; background: #FFFAF7; }
.fx-table th:first-child, .fx-table td:first-child { text-align: left; }
.fx-table tbody th { font-weight: 600; color: var(--fx-ink); }
.fx-table tbody tr:last-child th, .fx-table tbody tr:last-child td { border-bottom: 0; }
.fx-table tr.fx-total th, .fx-table tr.fx-total td { font-weight: 700; background: #FFFAF7; }
.fx-table tr.fx-sep th, .fx-table tr.fx-sep td { border-top: 2px solid var(--fx-line); }

/* ---------- Parcours des candidatures ---------- */
.fx-steps { display: grid; gap: 14px; }
.fx-step-head { font-size: 15px; color: var(--fx-ink); margin-bottom: 6px; }
.fx-step-head strong { font-family: 'Fraunces', serif; font-size: 24px; font-weight: 600; margin-right: 4px; font-variant-numeric: tabular-nums; }
.fx-step-track { height: 18px; }
.fx-step-candidats .fx-step-fill { background: var(--m-sans); }
.fx-step-classes .fx-step-fill { background: var(--m-ab); }
.fx-step-propositions .fx-step-fill { background: var(--m-tb); }
.fx-step-admis .fx-step-fill { background: var(--m-tbf); }
.fx-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 22px; }
.fx-fact { background: #FFFAF7; border: 1px solid var(--fx-line); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 4px; }
.fx-fact-n { font-family: 'Fraunces', serif; font-size: 26px; font-weight: 600; color: var(--fx-ink); line-height: 1.05; white-space: nowrap; }
.fx-fact-l { font-size: 13.5px; font-weight: 600; color: var(--fx-ink); line-height: 1.3; }
.fx-fact-d { font-size: 12px; color: var(--fx-faint); line-height: 1.4; }
.fx-meter { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) 62px; align-items: center; gap: 12px; margin: 0 0 12px; font-size: 14px; }
.fx-meter-l { color: var(--fx-ink); }
.fx-meter-fill { background: var(--m-tb); }
.fx-meter strong { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Épreuves ---------- */
.fx-dates { display: flex; flex-wrap: wrap; gap: 12px; margin: 10px 0 0; }
.fx-date { background: #F6F4FF; border-radius: 14px; padding: 12px 16px; display: flex; flex-direction: column; gap: 2px; }
.fx-date span { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: #4A3BD6; }
.fx-date strong { font-size: 15px; color: var(--fx-ink); }
.fx-card > .fx-h3:not(:first-child) { margin-top: 24px; }
.fx-signals { display: grid; gap: 8px; }
.fx-signal { border: 1px solid var(--fx-line); border-radius: 14px; padding: 10px 14px; }
.fx-signal summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; }
.fx-signal summary::-webkit-details-marker { display: none; }
.fx-signal summary::after { content: 'Lire l’extrait'; font-size: 12.5px; font-weight: 600; color: var(--fx-faint); }
.fx-signal[open] summary::after { content: 'Fermer'; }
.fx-chip { display: inline-block; padding: 5px 11px; border-radius: 999px; background: #EEEAFF; color: #33249E; font-size: 13.5px; font-weight: 700; }
.fx-signal blockquote { margin: 12px 0 0; padding: 0 0 0 14px; border-left: 3px solid var(--m-ab); font-size: 14px; line-height: 1.6; color: var(--fx-ink); }
.fx-signal .fx-note { margin-top: 8px; }

/* ---------- Sources ---------- */
.fx-sources { margin: 44px 0 0; padding: 24px 28px; border-radius: 22px; background: #F7F2EE; }
.fx-sources ul { margin: 0 0 12px; padding-left: 18px; display: grid; gap: 8px; font-size: 14px; color: var(--fx-soft); line-height: 1.55; }
.fx-sources p { margin: 0; font-size: 14px; }

/* Blocs repris de l'ancienne fiche, dans le nouveau rythme */
.fiche .fade-in { animation: none; }
.fiche .fx-section > .card, .fiche .fx-section > section, .fiche .fx-section > details { margin-bottom: 16px; }
.fiche .fx-section .section-header { margin-top: 28px; }

@media (max-width: 760px) {
  .fx-hero { padding: 26px 20px 22px; border-radius: 22px; }
  .fx-keys, .fx-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fx-grid2 { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .fx-card { padding: 20px 18px; border-radius: 18px; }
  .fx-card-head { flex-direction: column; gap: 10px; }
  .fx-btn { flex: 1 1 100%; justify-content: center; }
  .fx-funnel-row { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .fx-meter { grid-template-columns: minmax(0, 1fr) 62px; }
  .fx-meter-track { grid-column: 1 / -1; order: 3; }
  .fx-sources { padding: 20px 18px; }
  .fx-stack { height: 46px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .fx-stack-seg, .fx-funnel-row { transition: none; }
}

/* Évolution des mentions : piste de hauteur fixe, la barre part du bas */
.fx-trend-bars { height: auto; align-items: flex-end; }
.fx-trend-col { height: auto; justify-content: flex-start; }
.fx-trend-col span { order: 1; }
.fx-trend-track { order: 2; width: 100%; height: 84px; display: flex; align-items: flex-end; background: #FBF6F2; border-radius: 8px; }
.fx-trend-col em { order: 3; }
.fx-trend-track .fx-trend-bar { order: 0; }

/* Infos pratiques et liens vers les outils officiels */
.fx-strong-text { font-family: 'Inter', sans-serif !important; font-size: 15px !important; font-weight: 700 !important; margin: 0 !important; }
.fx-list-tight { gap: 8px; margin-top: 12px; }
.fx-list-tight li { font-size: 14.5px; }
.fx-card-link { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.fx-card-link .fx-sub { margin: 0; }
.fx-card-link .fx-btn { flex: 0 0 auto; }
@media (max-width: 760px) { .fx-card-link { flex-direction: column; align-items: stretch; } }

/* Lycéens de terminale, bac par bac */
.fx-keys { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.fx-term-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 28px; }
.fx-steps-compact { gap: 10px; }
.fx-steps-compact .fx-step-head { font-size: 14px; }
.fx-steps-compact .fx-step-head strong { font-size: 20px; }
.fx-steps-compact .fx-step-track { height: 12px; }
.fx-scale { position: relative; padding-top: 4px; }
.fx-scale-track { position: relative; height: 46px; border-radius: 12px; background: repeating-linear-gradient(90deg, #F7F1EC 0 1px, transparent 1px 100%), #FBF6F2; overflow: hidden; }
.fx-scale-band { position: absolute; top: 0; bottom: 0; display: flex; align-items: center; justify-content: center; background: var(--m-ab); color: #1F1570; font-size: 13px; font-weight: 700; border-left: 2px solid #fff; transition: opacity .2s; }
.fx-scale-band.is-mid { background: var(--m-b); color: #fff; }
.fx-scale-band.is-major { background: var(--m-tbf); color: #fff; }
.fx-scale-you { position: absolute; top: -2px; bottom: -2px; width: 4px; margin-left: -2px; border-radius: 2px; background: #FF7066; box-shadow: 0 0 0 2px #fff; }
.fx-scale-ticks { position: relative; height: 20px; margin-top: 4px; }
.fx-scale-ticks span { position: absolute; transform: translateX(-50%); font-size: 12px; color: var(--fx-faint); font-variant-numeric: tabular-nums; }
.fx-scale-ticks span:first-child { transform: none; }
.fx-scale-ticks span:last-child { transform: translateX(-100%); }
.fx-band-list { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 4px; font-size: 14px; color: var(--fx-ink); }
.fx-moyenne { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 16px; padding: 12px 14px; border-radius: 14px; background: #F6F4FF; font-size: 14px; font-weight: 600; color: var(--fx-ink); }
.fx-moyenne input { width: 110px; padding: 8px 10px; border-radius: 10px; border: 1.5px solid #D9D3FA; font: inherit; font-size: 15px; background: #fff; }
.fx-moyenne input:focus { outline: 2px solid var(--m-tb); outline-offset: 1px; }
.fx-moyenne-out { margin: 10px 0 0; font-size: 14.5px; line-height: 1.55; color: var(--fx-ink); }
.has-moyenne .fx-scale-band:not(.is-you) { opacity: .4; }
.fx-term-spe { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--fx-line); }
.fx-rank { margin: 0; padding: 0; list-style: none; counter-reset: rank; display: flex; flex-wrap: wrap; gap: 8px; }
.fx-rank li { counter-increment: rank; display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px 7px 8px; border-radius: 999px; background: #F7F2EE; font-size: 13.5px; font-weight: 600; color: var(--fx-ink); }
.fx-rank li::before { content: counter(rank); display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: var(--fx-ink); color: #fff; font-size: 12px; }
@media (max-width: 760px) {
  .fx-term-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
}
