/* ==========================================================================
   Module Formation : brevets, performances, pédagogie.
   S'appuie sur les jetons de app.css (--lagon, --line…).
   ========================================================================== */

/* ---------- Utilitaires du module ---------- */
.o-block{display:block}
.o-pad{padding:0 1.25rem}
.o-card__head.o-pad{padding:1.25rem 1.25rem 0}
p.o-pad{padding:.75rem 1.25rem 1rem;margin:0}
.o-pad-top{margin-top:1.25rem}
.o-inline{display:inline}
.o-btnrow--end{justify-content:flex-end}
.o-linkbtn{background:none;border:0;padding:0 .25rem;font:500 .8125rem var(--f-title);color:var(--lagon);cursor:pointer;text-decoration:underline;text-underline-offset:2px;display:inline-flex;align-items:center;gap:.25rem}
.o-linkbtn:hover{color:var(--lagon-strong)}
.o-linkbtn--danger{color:var(--muted)}
.o-linkbtn--danger:hover{color:var(--danger)}
.o-linkbtn .o-i{width:16px;height:16px}
.o-input--date{width:auto;min-height:36px;height:36px;padding:.25rem .5rem}
.o-input--xs{width:5.5rem;min-height:36px;height:36px;padding:.25rem .5rem}
.o-affix--sm input{width:5.5rem;min-height:36px;height:36px;padding:.25rem .5rem}
.o-affix--sm span{padding:0 .5rem}
.o-notice--flat{border-radius:0;border-left:0;border-bottom:1px solid var(--line-soft)}
.o-field--inline{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap}
.o-field--inline label{white-space:nowrap}
.o-formfoot--bar{align-items:center;flex-wrap:wrap;gap:.75rem;padding:1rem 1.25rem;margin:0;border-top:1px solid var(--line-soft);justify-content:space-between}
.o-fielderr{display:block;color:var(--danger);font-size:.75rem;line-height:1.3;margin-top:.25rem;max-width:12rem}

/* Bloc repliable */
.o-disclose{margin-top:1rem;border-top:1px dashed var(--line-soft);padding-top:.75rem}
.o-disclose>summary{cursor:pointer;display:inline-flex;align-items:center;gap:.4rem;font:500 .9375rem var(--f-title);color:var(--lagon);list-style:none}
.o-disclose>summary::-webkit-details-marker{display:none}
.o-disclose>summary .o-i{width:18px;height:18px}
.o-disclose>summary:hover{color:var(--lagon-strong)}
.o-disclose[open]>summary{margin-bottom:.75rem}
.o-disclose--inline{margin:0;border:0;padding:0}
.o-inlineform{display:flex;flex-wrap:wrap;gap:.75rem 1rem;align-items:flex-end}
.o-inlineform>.o-field{flex:1 1 200px;min-width:0}
.o-inlineform>.o-field--submit{flex:0 0 auto}
.o-inlineform>.o-help{flex-basis:100%;margin:0}
.o-inlineform select{width:100%;min-height:44px;padding:.5rem 2.25rem .5rem .875rem;border:1px solid var(--line);border-radius:var(--r-sm);background:var(--surface);font:inherit;color:var(--ink)}

/* ---------- Niveaux ---------- */
.o-formation__sub{margin:1.5rem 0 .75rem}
.o-levels{list-style:none;margin:0;padding:0}
.o-levels__row{display:grid;grid-template-columns:minmax(120px,11rem) 1fr;gap:.25rem 1rem;padding:.625rem 0;border-bottom:1px solid var(--line-soft)}
.o-levels__row:last-child{border-bottom:0}
.o-levels__disc{color:var(--muted);font-size:.875rem;padding-top:.1rem}
.o-levels__val{display:grid;gap:.375rem}
.o-levels__item{display:flex;flex-wrap:wrap;align-items:center;gap:.25rem .625rem}
.o-levels__item strong{font-family:var(--f-title);font-weight:600}
.o-levels__item small{color:var(--muted);font-size:.8125rem}
.o-levels__item.is-secondary strong{font-weight:500;color:var(--muted)}
@media (max-width:520px){.o-levels__row{grid-template-columns:1fr}}

/* ---------- Cursus ---------- */
.o-cursus{border:1px solid var(--line-soft);border-radius:var(--r-md);padding:1rem;background:var(--ground)}
.o-cursus + .o-cursus{margin-top:.75rem}
.o-cursus__head{display:flex;justify-content:space-between;align-items:flex-start;gap:.75rem;margin-bottom:.75rem}
.o-cursus__head strong{font:600 1.0625rem var(--f-title);display:block}
.o-cursus__head small{color:var(--muted);font-size:.8125rem}
.o-cursus__steps li{flex-wrap:wrap}
.o-cursus__steps .o-step__body{min-width:140px}
.o-stepform{display:flex;flex-wrap:wrap;align-items:center;gap:.375rem;margin-left:auto}
.o-cursus__help{display:flex;gap:.5rem;align-items:flex-start;margin:.75rem 0 0}
.o-cursus__help .o-i{width:16px;height:16px;stroke:var(--warning);margin-top:.15rem}
.o-cursus__notes{margin:.75rem 0 0;padding:.5rem .75rem;background:var(--surface);border-radius:var(--r-sm)}
.o-cursus__foot{margin-top:.875rem;padding-top:.75rem;border-top:1px solid var(--line-soft);justify-content:space-between}
.o-cursus__foot .o-disclose--inline{flex:1 1 220px;text-align:right}
.o-cursus__foot .o-disclose--inline[open]{text-align:left;flex-basis:100%}
.o-cursus__foot .o-disclose--inline .o-form{margin-top:.5rem}

/* Étapes en pastilles (listes) */
.o-stepdots{display:inline-flex;gap:.25rem;flex-wrap:wrap}
.o-stepdot{display:inline-flex;align-items:center;gap:.2rem;padding:.1rem .5rem .1rem .3rem;border-radius:var(--pill);background:var(--raised);color:var(--muted);font:500 .75rem/1.6 var(--f-title)}
.o-stepdot .o-i{width:13px;height:13px;stroke-width:2.2}
.o-stepdot.is-done{background:var(--success-soft);color:var(--success)}

/* Choix d'un membre */
.o-picklist{list-style:none;margin:1rem 0 0;padding:0;display:grid;gap:2px}
.o-picklist a{display:flex;align-items:center;gap:.625rem;padding:.5rem;border-radius:var(--r-sm);text-decoration:none;color:var(--ink)}
.o-picklist a:hover{background:var(--lagon-soft)}
.o-picklist .o-avatar{width:30px;height:30px;font-size:.75rem}
.o-picklist small{display:block;color:var(--muted);font-size:.75rem}

/* Tableaux de formulaire (référentiel) */
.o-table--form td{padding:.5rem .75rem}
.o-table--form .o-input{min-height:36px;height:36px;padding:.25rem .625rem}
.o-table--form tr.is-off td{opacity:.6}
.o-table--form tr.is-new td{background:var(--ground)}
.o-table--form .o-check{font-size:.875rem!important;white-space:nowrap}
.o-table--compact td,.o-table--compact th{padding:.5rem .75rem}

/* ---------- Performances : graphiques ---------- */
.o-perfcharts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem}
@media (max-width:860px){.o-perfcharts{grid-template-columns:1fr}}
.o-perfchart{margin:0;padding:.875rem .75rem .5rem;border:1px solid var(--line-soft);border-radius:var(--r-md);background:var(--surface);min-width:0}
.o-perfchart figcaption{display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;gap:.25rem .75rem;padding:0 .25rem .25rem}
.o-perfchart figcaption strong{font:600 1rem var(--f-title)}
.o-perfchart figcaption small{color:var(--muted);font-size:.8125rem}
.o-perfchart__svg{display:block;width:100%;height:auto;overflow:visible}
.o-perfchart__grid{stroke:var(--line-soft);stroke-width:1}
.o-perfchart__xgrid{stroke:var(--line-soft);stroke-width:1;stroke-dasharray:2 4}
.o-perfchart__axis{stroke:var(--line);stroke-width:1.2}
.o-perfchart__tick{fill:var(--muted);font:500 14px var(--f-text)}
.o-perfchart__val{font:700 14px var(--f-title);paint-order:stroke;stroke:var(--surface);stroke-width:3px;stroke-linejoin:round}
.o-perfchart__line{fill:none;stroke-width:2.5;stroke-linejoin:round;stroke-linecap:round}
.o-perfchart__pt{stroke:var(--surface);stroke-width:1.5}
.o-perfchart__pt.is-best{stroke-width:2.5}
.o-perfchart__s--maitrise .o-perfchart__line{stroke:var(--lagon)}
.o-perfchart__s--maitrise .o-perfchart__pt,.o-perfchart__s--maitrise .o-perfchart__val{fill:var(--lagon)}
.o-perfchart__s--maximale .o-perfchart__line{stroke:#d9731f;stroke-dasharray:6 4}
.o-perfchart__s--maximale .o-perfchart__pt,.o-perfchart__s--maximale .o-perfchart__val{fill:#c2610f}
.o-perfchart__pt.is-best{stroke:var(--ink)}
.o-perfchart__legend{display:flex;flex-wrap:wrap;align-items:center;gap:.35rem 1rem;font-size:.8125rem;color:var(--muted);margin:0 0 .75rem}
.o-perfchart__legend>span{display:inline-flex;align-items:center;gap:.4rem;white-space:nowrap}
.o-perfchart__key{display:inline-block;width:22px;height:0;border-top:3px solid var(--lagon)}
.o-perfchart__key--maximale{border-top:3px dashed #d9731f}
.o-perfchart__key--best{width:12px;height:12px;border:2.5px solid var(--ink);border-radius:50%;background:var(--lagon)}

.o-input--perf{width:6.5rem;min-height:36px;height:36px;padding:.25rem .5rem;text-align:right;font-variant-numeric:tabular-nums}
.o-perfedit{display:inline-flex;align-items:center;gap:.25rem;justify-content:flex-end}

.o-table--compact td strong{white-space:nowrap}
@media (max-width:520px){.o-hide-sm{display:none}}

/* Liste des créneaux */
.o-sessionlist{list-style:none;margin:0;padding:0}
.o-sessionlist li{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:.75rem;padding:.875rem 1.25rem;border-top:1px solid var(--line-soft)}
.o-sessionlist strong{font:600 1rem var(--f-title);display:block}
.o-sessionlist small{color:var(--muted);font-size:.8125rem}

/* Tableau comparatif */
.o-table--perfs th a{color:inherit;text-decoration:none}
.o-table--perfs th a:hover,.o-table--perfs th a[aria-current]{color:var(--lagon-strong)}
.o-table--perfs tbody th,.o-table--grid tbody th{position:static;text-align:left;text-transform:none;letter-spacing:0;font:700 .9375rem/1.3 var(--f-text);color:var(--ink);padding:.625rem 1rem;border-bottom:1px solid var(--line-soft);white-space:normal;min-width:9rem}
.o-table--perfs td strong,.o-table--perfs td small{white-space:nowrap}
.o-table--perfs td.is-top{background:var(--success-soft)}
.o-table--perfs td.is-top strong{color:var(--success)}

/* Grille de saisie */
.o-perfgrid__head{padding:.875rem 1.25rem;border-bottom:1px solid var(--line-soft)}
.o-perfgrid__head p{margin:0 0 .25rem}
.o-table--grid th small{display:block;text-transform:none;letter-spacing:0;font:400 .6875rem var(--f-text);color:var(--muted)}
.o-table--grid thead th{white-space:normal;min-width:7.5rem}
.o-table--grid tbody th{position:sticky;top:auto;left:0;background:var(--surface);z-index:1;padding:.5rem .75rem;max-width:11rem}
.o-table--grid td{padding:.375rem .5rem}
.o-table--grid tbody tr:nth-child(even) td,.o-table--grid tbody tr:nth-child(even) th{background:#f9fbfd}
.o-table--grid td.is-saved .o-input--perf{background:var(--lagon-soft);border-color:#a9dce6}
.o-table--grid td.is-error .o-input--perf{border-color:var(--danger);background:var(--danger-soft)}
.o-table--grid .o-input--perf:focus{background:var(--surface)}
.o-table--grid .o-input--perf[readonly]{background:var(--ground);color:var(--muted)}
.o-formfoot--sticky-bottom{position:sticky;bottom:0;background:#ffffffee;backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);border-radius:0 0 var(--r-lg) var(--r-lg);z-index:2}

/* ---------- Pédagogie ---------- */
.o-peda__cat .o-h3{margin-bottom:.5rem}
.o-peda__list{display:grid}
.o-peda__item{border-top:1px solid var(--line-soft)}
.o-peda__item>summary{cursor:pointer;list-style:none;display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;gap:.125rem 1rem;padding:.75rem 0}
.o-peda__item>summary::-webkit-details-marker{display:none}
.o-peda__item>summary::before{content:"";width:8px;height:8px;border-right:2px solid var(--lagon);border-bottom:2px solid var(--lagon);transform:rotate(-45deg);margin-right:.25rem;transition:transform var(--t);align-self:center}
.o-peda__item[open]>summary::before{transform:rotate(45deg)}
.o-peda__item>summary strong{flex:1;font-family:var(--f-title);font-weight:600}
.o-peda__item>summary small{color:var(--muted);font-size:.8125rem}
.o-peda__item[open]{padding-bottom:.75rem}
.o-peda__content{line-height:1.65;max-width:75ch;overflow-wrap:anywhere}
.o-peda__source{margin:.5rem 0 0}
.o-peda__side{position:sticky;top:84px}
.o-peda__sidetitle{margin:1.5rem 0 .5rem}
.o-peda__cats{list-style:none;margin:0;padding:0;display:grid;gap:2px}
.o-peda__cats a{display:flex;justify-content:space-between;gap:.5rem;padding:.4rem .625rem;border-radius:var(--r-sm);color:var(--ink);text-decoration:none;font-size:.9375rem}
.o-peda__cats a:hover{background:var(--ground)}
.o-peda__cats a[aria-current]{background:var(--lagon-soft);color:var(--lagon-strong);font-weight:700}
.o-peda__cats span{color:var(--muted);font-size:.8125rem}
.o-peda__single .o-peda__content{font-size:1rem}
@media (max-width:1100px){.o-peda__side{position:static;order:-1}}

@media print{
  .o-disclose>summary,.o-stepform,.o-cursus__foot,.o-linkbtn{display:none!important}
  .o-perfchart{break-inside:avoid}
}
