/* Entraîneur en ligne (pages entrainement-menu, entraineur, entraineur-etudiant, entraineur-reconversion, entraineur-pitch).
   Pourquoi ce fichier existe : styles.css est partagé par tout le site ; l'outil (étapes, compteur, prompteur en plein écran,
   chronomètre) a ses propres composants, chargés seulement sur ces cinq pages. Il ne définit aucune couleur : tout vient des
   variables de styles.css (--bg, --surface, --text, --action…), donc il suit les versions Clair et Nuit (data-variant et sombre
   automatique). Aplats purs : ni dégradé, ni ombre, ni halo, ni verre dépoli.
   Exceptions, volontairement fixes : le prompteur (dialog .t-run) est toujours bleu nuit, texte blanc (17,9:1), minuteur orange
   #F05627 (5,2:1) ; son cadre de lecture reprend #191368, la surface de la version Nuit (blanc 15,7:1). */

/* L'outil a besoin de JavaScript : sans lui, <noscript> explique pourquoi et l'outil reste masqué. */
html:not(.js) .trainer { display: none; }
html.trainer-lock { overflow: hidden; }

.trainer { display: grid; gap: 20px; }

/* ---------- Étapes ---------- */
.t-step { padding: clamp(20px, 3vw, 28px); border-radius: 22px; background: var(--surface); }
.t-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; margin-bottom: 8px; }
.t-head h2 { font-size: clamp(19px, 2.2vw, 22px); line-height: 1.25; font-weight: 600; letter-spacing: -0.015em; }
.t-count { font-size: 14px; font-variant-numeric: tabular-nums; letter-spacing: 0; color: var(--text-2); white-space: nowrap; }
/* Dépassement : couleur d'erreur ET texte ajouté par le script (« trop long »), pour ne pas reposer sur la seule couleur. */
.t-count.is-over { color: var(--error); font-weight: 700; }
.t-q { display: block; margin: 0 0 12px; color: var(--text-2); }
.t-step .field textarea { min-height: 128px; }
.t-step textarea::placeholder { color: var(--text-2); opacity: 0.8; }
.t-help { margin: 8px 0 0; font-size: 14px; letter-spacing: 0; color: var(--text-2); }
.t-dur { padding: 2px 12px; border-radius: 980px; background: var(--text); color: var(--bg); font-size: 14px; font-weight: 600; letter-spacing: 0; white-space: nowrap; }
.t-title { margin-top: 12px; font-size: clamp(24px, 2.6vw, 28px); }

/* ---------- Boutons et messages ---------- */
/* .btn pose display:inline-flex, qui l'emporterait sur l'attribut hidden : les boutons masqués par le script le restent. */
.btn[hidden] { display: none; }
/* Bouton secondaire : contour, fond transparent (le plein reste réservé à l'action principale). */
.btn--ghost { background: transparent; color: var(--text); border: 2px solid var(--text); }
.btn--ghost:hover { background: var(--surface); }
.t-actions { display: grid; gap: 20px; margin-top: 12px; }
.t-act { display: flex; flex-direction: column; gap: 10px; }
.t-act .btn { white-space: normal; text-align: center; padding-block: 8px; }
.t-note { margin: 0; font-size: 14px; letter-spacing: 0; text-align: center; color: var(--text-2); text-wrap: pretty; }
@media (min-width: 760px) {
  .t-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
  .t-actions--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.t-msg { margin: 0; padding: 14px 18px; border-radius: 12px; background: var(--surface); font-weight: 600; }
.t-priv { margin: 8px 0 0; font-size: 14px; letter-spacing: 0; color: var(--text-2); }
.t-link { display: inline; min-height: 44px; padding: 0; border: 0; background: none; font: inherit; color: var(--link); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.t-ok { margin: 16px 0 0; padding: 12px 16px; border-radius: 12px; border: 1px solid var(--sep); }
.t-ok:empty { display: none; }
.t-ok a { font-weight: 600; }

/* ---------- Résultat (texte complet, mots-clés) ---------- */
.t-out { padding: clamp(20px, 3vw, 28px); border-radius: 22px; border: 2px solid var(--text); }
.t-out:focus { outline: none; }
.t-out h2 { margin-bottom: 14px; font-size: 21px; font-weight: 600; }
.t-out-body { max-height: 320px; overflow-y: auto; padding: 16px; border-radius: 12px; background: var(--surface); white-space: pre-wrap; line-height: 1.7; }
.t-out-body.is-kw { white-space: normal; }
.t-out-act { margin: 16px 0 0; }
.t-kw-line { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.t-kw-line + .t-kw-line { margin-top: 10px; }
.t-kw { padding: 6px 16px; border-radius: 980px; background: var(--text); color: var(--bg); font-weight: 700; }

/* ---------- Fenêtres : choix du mode, prompteur ---------- */
.t-pick { width: min(92vw, 480px); padding: 0; border: 0; border-radius: 22px; background: var(--surface); color: var(--text); }
.t-pick::backdrop, .t-run::backdrop { background: rgba(12, 5, 87, 0.86); }
.t-pick-in { padding: clamp(24px, 5vw, 36px); text-align: center; }
.t-pick h2 { margin-bottom: 12px; font-size: clamp(24px, 4vw, 28px); }
.t-pick p { color: var(--text-2); }
.t-pick-btns { display: grid; gap: 12px; margin-top: 24px; }
.t-pick .btn--ghost:hover { background: var(--bg); }

.t-run { width: 100%; max-width: none; height: 100%; max-height: none; margin: 0; padding: 16px var(--gutter-r) 16px var(--gutter-l); border: 0; background: #0C0557; color: #FFFFFF; }
.t-run[open] { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.t-run-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; max-width: 1100px; }
.t-timer { margin: 0; font-family: var(--font-title); font-size: clamp(56px, 12vw, 104px); font-weight: 900; line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: #F05627; }
.t-run-note { margin: 0; min-height: 1.5em; font-weight: 600; text-align: center; }
.t-run-text { flex: 1; width: 100%; max-width: 1100px; min-height: 0; overflow-y: auto; padding: clamp(20px, 4vw, 40px); border-radius: 22px; background: #191368; font-size: clamp(22px, 3vw, 32px); line-height: 1.7; white-space: pre-line; }
.t-run-text.is-kw { text-align: center; font-size: clamp(28px, 4.5vw, 44px); font-weight: 700; line-height: 2.2; }
.t-run :focus-visible { outline-color: #FFFFFF; }

/* ---------- Chronomètre (porteurs de projet) ---------- */
/* Collé sous la barre de navigation (53 px en mobile, 69 px dès 900 px) pour rester visible pendant la saisie. */
.t-clock { position: sticky; top: 53px; z-index: 5; padding: 16px 0; background: var(--bg); border-bottom: 1px solid var(--sep); text-align: center; }
@media (min-width: 900px) { .t-clock { top: 69px; } }
.t-time { margin: 0; font-family: var(--font-title); font-size: clamp(44px, 9vw, 64px); font-weight: 900; line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.t-time.is-over { color: var(--error); }
.t-meter { max-width: 400px; height: 10px; margin: 14px auto; border-radius: 980px; background: var(--surface); overflow: hidden; }
.t-meter i { display: block; width: 0; height: 100%; background: var(--action); }
.t-meter.is-over i { background: var(--error); }
.t-over { margin: 0 0 12px; min-height: 1.5em; font-weight: 700; color: var(--error); }
.t-ctl { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.trainer[data-kind="chrono"] textarea { scroll-margin-top: 240px; }

/* ---------- Menu : cartes des programmes ---------- */
.tiles--trainer .tile > p { margin: 0; color: var(--text-2); }
.tiles--trainer .tile-bg { stroke: var(--sep); }
.tile-go { margin-top: auto; padding-top: 8px; font-weight: 600; color: var(--link); }
