/* ==========================================================================
   Formation IA en ligne (/formation-ia et son espace), après menu-qr.css (<body id="mq">).
   Façon Apple : retour immédiat à l'appui, une barre de leçon translucide sous laquelle le contenu défile,
   titres resserrés et texte courant aéré, une seule couleur d'accent ; versions sobres si le visiteur
   demande moins d'animations, moins de transparence ou plus de contraste.
   ========================================================================== */

/* Retour à l'appui : sur tout ce qui se touche, dès le doigt posé */
.fo-copier, .fo-jours a, .fo-suite a, .fo-liste summary { -webkit-tap-highlight-color: transparent; }
.fo-jours a:active, .fo-suite a:active { transform: scale(0.985); transition: transform 100ms ease-out; }
.fo-copier:active { transform: scale(0.95); transition: transform 100ms ease-out; }

/* Pages courtes : merci, retrouver, accès réservé */
.fo-seul { min-height: 70vh; padding: 140px 0 96px; }
.fo-seul .container { max-width: 640px; }
.fo-form { display: grid; gap: 10px; max-width: 420px; margin-top: 24px; }
.fo-form label { margin: 0; font-weight: 600; }
.fo-form input[type=email] { min-height: 48px; padding: 0 16px; border: 1px solid var(--trait); border-radius: 12px; font-size: 1.0625rem; }
.fo-form input[type=email]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(201, 75, 38, 0.15); }
.fo-form .mq-btn { justify-self: start; margin-top: 6px; }
.fo-piege { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
#mq .fo-erreur { margin: 0 0 4px; padding: 12px 16px; border-radius: 12px; background: #fdecea; color: #a12a12; font-size: 0.97rem; }

/* ------------------------------------------------------------------
   Page de vente
   ------------------------------------------------------------------ */
/* Haut de page : la bande-annonce (assets/formation/bande-annonce.mp4, sous-titres gravés : lisible sans le son) */
.fo-bande { max-width: 560px; margin: 0 auto; }
.fo-bande__video { display: block; width: 100%; aspect-ratio: 16 / 9; border-radius: 22px; background: #f5f5f7;
  box-shadow: 0 30px 70px rgba(29, 29, 31, 0.16), 0 0 0 1px rgba(29, 29, 31, 0.06); }
#mq .fo-bande figcaption { margin-top: 12px; text-align: center; color: var(--doux); font-size: 0.92rem; }
@media (prefers-reduced-motion: no-preference) {
  .fo-bande { animation: fo-pose 700ms cubic-bezier(0.22, 1, 0.36, 1) 150ms both; }
}
@keyframes fo-pose { from { opacity: 0; transform: translateY(16px); } }

/* Aperçu de l'espace par un administrateur du CRM */
.fo-apercu-admin { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1040; padding: 10px 16px; background: #fff4e5; color: #8a5300; font-weight: 600; font-size: 0.95rem; text-align: center; box-shadow: 0 -2px 8px rgba(29, 29, 31, 0.08); }

/* Le bouton lecture (leçon dont la vidéo est à venir) */
.fo-lecture { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.22); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.fo-lecture::after { content: ""; margin-left: 5px; border-style: solid; border-width: 11px 0 11px 18px; border-color: transparent transparent transparent #fff; }

/* Le programme : deux semaines côte à côte, chaque jour s'ouvre sur place */
.fo-semaines { display: grid; gap: 40px; }
@media (min-width: 992px) { .fo-semaines { grid-template-columns: 1fr 1fr; gap: 48px; } }
.fo-semaine h3, .fo-semaine__titre { font-size: 1.35rem; font-weight: 700; letter-spacing: -0.015em; margin-bottom: 14px; }
.fo-semaine h3 span, .fo-semaine__titre span { display: block; font-size: 0.9rem; font-weight: 600; letter-spacing: 0; color: var(--accent); }
.fo-liste { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--trait); }
.fo-liste li { border-bottom: 1px solid var(--trait); }
.fo-liste summary { display: flex; align-items: center; gap: 14px; padding: 16px 4px; list-style: none; cursor: pointer; }
.fo-liste summary::-webkit-details-marker { display: none; }
.fo-liste summary:active { background: var(--fond-alt); }
.fo-liste__titre { flex: 1; font-size: 1.05rem; font-weight: 600; line-height: 1.35; }
#mq .fo-liste details p { margin: -4px 0 14px 54px; color: #3c4043; font-size: 1rem; }
#mq .fo-liste details .fo-livrable { margin-top: -8px; }
.fo-num { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--fond-alt); font-size: 0.9rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.fo-duree { flex: none; color: var(--doux); font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.mq-sombre .mq-moments p:not(.mq-moment__quand) { color: #a1a1a6; }

/* Ce que vous recevez */
.fo-coches li b { font-weight: 650; }

/* Le prix : l'explication à gauche, la carte de paiement à droite */
.fo-prix { display: grid; gap: 40px; align-items: center; }
@media (min-width: 992px) { .fo-prix { grid-template-columns: 1fr 440px; gap: 64px; } }
.fo-prix__texte p { color: #3c4043; max-width: 34em; }
.fo-prix__carte { padding: 34px 30px 28px; border-radius: 28px; background: #1d1d1f; color: #f5f5f7; box-shadow: 0 28px 70px rgba(29, 29, 31, 0.28); }
#mq .fo-prix__montant { margin: 0; font-size: 3.4rem; font-weight: 700; letter-spacing: -0.04em; line-height: 1; }
.fo-prix__montant small { font-size: 1.1rem; font-weight: 600; letter-spacing: 0; color: #a1a1a6; }
#mq .fo-prix__ttc { margin: 8px 0 20px; color: #a1a1a6; font-size: 1rem; }
.fo-prix__carte .mq-coches li { color: #f5f5f7; }
.fo-case { display: flex; gap: 12px; align-items: flex-start; margin: 4px 0 18px; font-size: 0.9rem; line-height: 1.45; color: #d2d2d7; cursor: pointer; }
.fo-case input { flex: none; width: 20px; height: 20px; margin-top: 1px; accent-color: var(--accent); }
.fo-payer { width: 100%; }
.fo-email { display: grid; gap: 6px; margin: 4px 0 14px; font-size: 0.9rem; color: #d2d2d7; }
.fo-email input { width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.18); background: rgba(255, 255, 255, 0.06); color: #fff; font: inherit; font-size: 1rem; }
.fo-email input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
#mq .fo-securite { margin: 12px 0 0; text-align: center; color: #86868b; font-size: 0.82rem; }
#mq .fo-prix__carte .fo-erreur { background: rgba(255, 105, 80, 0.16); color: #ffb4a3; }

/* ------------------------------------------------------------------
   Espace privé
   ------------------------------------------------------------------ */
.fo-lecon { padding: 110px 0 96px; }
.fo-lecon__in { max-width: 760px; }
.fo-lecon__titre { font-size: clamp(2rem, 4.4vw, 3rem); line-height: 1.06; letter-spacing: -0.03em; font-weight: 700; margin-bottom: 14px; }
#mq .fo-lecon__objectif { font-size: 1.25rem; line-height: 1.45; color: var(--doux); margin-bottom: 28px; }
.fo-h2 { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; margin: 48px 0 14px; }
#mq .fo-aide { color: var(--doux); font-size: 1rem; }

/* La barre de la leçon : un matériau translucide collé sous le menu, le cours défile dessous */
.fo-barre { position: sticky; top: 62px; z-index: 1020; margin-top: 62px; margin-bottom: -62px;
  background: rgba(255, 255, 255, 0.72); -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 0 1px 0 rgba(29, 29, 31, 0.06); }
.fo-barre__in { display: flex; align-items: center; gap: 16px; min-height: 48px; }
#mq .fo-barre__retour { color: var(--texte); font-weight: 600; font-size: 0.95rem; text-decoration: none; }
.fo-barre__ou { margin-left: auto; color: var(--doux); font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.fo-progres { display: block; width: 90px; height: 6px; border-radius: 3px; background: #e8e8ed; overflow: hidden; }
.fo-progres span { display: block; height: 100%; border-radius: 3px; background: var(--vert); }
.fo-progres--grand { flex: 1; max-width: 320px; height: 8px; border-radius: 4px; }
.fo-etat { display: flex; align-items: center; gap: 14px; margin: 4px 0 28px; color: var(--doux); font-variant-numeric: tabular-nums; }

/* La vidéo, ou sa place tant qu'elle n'est pas déposée */
.fo-video { display: block; width: 100%; aspect-ratio: 16 / 9; border-radius: 20px; background: #000; box-shadow: 0 20px 50px rgba(29, 29, 31, 0.14); }
.fo-video--bienvenue { margin: 8px 0 28px; }
.fo-video--bientot { display: grid; place-content: center; justify-items: center; gap: 16px; padding: 24px; background: linear-gradient(135deg, #1d1d1f, #48484a); text-align: center; }
#mq .fo-video--bientot p { max-width: 30em; margin: 0; color: #d2d2d7; font-size: 1rem; }

/* Le cours */
.fo-cours { margin-top: 40px; }
.fo-cours h3 { font-size: 1.3rem; font-weight: 700; letter-spacing: -0.015em; margin: 32px 0 10px; }
.fo-cours ul, .fo-cours ol { padding-left: 1.3em; }
.fo-cours li { margin-bottom: 8px; font-size: 1.0625rem; line-height: 1.55; }
#mq .fo-astuce { margin: 28px 0 0; padding: 16px 20px; border-radius: 16px; background: #fdf3ee; color: #6b2a15; font-size: 1rem; }
#mq .fo-astuce::before { content: "Bon réflexe · "; font-weight: 700; color: var(--accent); }
.fo-rctf { display: grid; gap: 10px; margin: 20px 0; }
.fo-rctf dt { font-size: 1.05rem; font-weight: 700; color: var(--accent); }
.fo-rctf dd { margin: -6px 0 6px; font-size: 1.0625rem; line-height: 1.5; }
@media (min-width: 768px) {
  .fo-rctf { grid-template-columns: 170px 1fr; gap: 14px 20px; }
  .fo-rctf dd { margin: 0; }
}

/* Une consigne à copier */
.fo-prompt { margin: 0 0 16px; border-radius: 18px; background: var(--fond-alt); overflow: hidden; }
.fo-prompt figcaption { display: flex; align-items: center; gap: 12px; padding: 12px 12px 0 20px; font-weight: 650; font-size: 1rem; }
.fo-prompt pre { margin: 0; padding: 10px 20px 18px; border: 0; border-radius: 0; background: none; overflow: visible; white-space: pre-wrap; font-family: inherit; font-size: 1rem; line-height: 1.55; color: #3c4043; }
.fo-copier { margin-left: auto; min-height: 36px; padding: 0 16px; border: 0; border-radius: 999px; background: #fff; color: var(--accent); font-weight: 600; font-size: 0.9rem;
  box-shadow: 0 1px 2px rgba(29, 29, 31, 0.08); cursor: pointer; transition: background-color 0.15s, color 0.15s; }
.fo-copier:hover { background: #fff7f3; }
.fo-copier.is-copie { background: var(--vert); color: #fff; }
/* un [crochet] à compléter, surligné ; rempli par une case, il passe au vert */
mark.fo-trou { padding: 0 3px; border-radius: 4px; background: #fff0b3; color: inherit; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
mark.fo-trou.is-rempli { background: #e3f3e8; color: var(--vert); font-weight: 600; }

/* Les cases à remplir une fois, au-dessus des consignes */
.fo-cases { margin: 0 0 20px; padding: 16px 18px; border: 1px solid var(--trait); border-radius: 18px; }
#mq .fo-cases__titre { margin: 0 0 12px; font-weight: 650; font-size: 1rem; }
.fo-cases__grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px 14px; }
.fo-cases label { display: grid; gap: 4px; margin: 0; font-size: 0.9rem; font-weight: 600; color: var(--doux); }
.fo-cases input { min-height: 44px; padding: 0 12px; border: 1px solid var(--trait); border-radius: 10px; font-size: 1rem; color: var(--texte); background: #fff; }
.fo-cases input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(201, 75, 38, 0.15); }
#mq .fo-cases__note { margin: 12px 0 0; font-size: 0.9rem; color: var(--doux); }

/* L'exercice et le bouton « terminé » */
.fo-exercice { margin-top: 8px; }
#mq .fo-livrable { color: #3c4043; }
.fo-terminer { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 36px 0 0; padding: 24px 0; border-top: 1px solid var(--trait); }
#mq .fo-fait { margin: 0; color: var(--vert); font-weight: 600; }

/* À télécharger : fiches, tableurs et fichiers d'exercice (servis par /formation-ia/support) */
.fo-supports { margin: 0 0 8px; padding: 0; list-style: none; display: grid; gap: 10px; }
.fo-supports a { display: flex; align-items: center; gap: 16px; padding: 14px 18px; border-radius: 16px; background: var(--fond-alt); color: var(--texte) !important; text-decoration: none !important; }
.fo-supports a:hover { background: #fff7f3; }
.fo-supports b { display: block; font-weight: 650; line-height: 1.3; }
.fo-supports small { display: block; color: var(--doux); font-size: 0.92rem; line-height: 1.4; }
.fo-supports__type { flex: none; min-width: 52px; padding: 6px 0; border-radius: 10px; background: #fff; color: var(--accent); font-weight: 700; font-size: 0.8rem; text-align: center; }
.fo-kit__sous { margin: 22px 0 10px; font-size: 1.05rem; font-weight: 650; }

/* Le quiz du jour : corrigé sur place */
.fo-quiz__q { margin: 0 0 18px; padding: 16px 20px; border: 1px solid var(--trait); border-radius: 16px; }
.fo-quiz__q legend { float: left; width: 100%; margin-bottom: 8px; font-size: 1rem; font-weight: 650; }
.fo-quiz__q label { display: flex; gap: 10px; align-items: flex-start; margin: 0; padding: 8px 10px; border-radius: 10px; cursor: pointer; font-weight: 400; }
.fo-quiz__q label:hover { background: var(--fond-alt); }
.fo-quiz__q input { margin-top: 4px; accent-color: var(--accent); }
.fo-quiz__q label.is-bonne { background: #e8f3ec; color: var(--vert); font-weight: 600; }
.fo-quiz__q label.is-fausse { background: #fdecea; color: #a12a12; }
#mq .fo-quiz__expli { clear: both; margin: 8px 0 0; color: #3c4043; font-size: 0.95rem; }
.fo-quiz__fin { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.fo-quiz__fin button[disabled] { opacity: 1; cursor: default; color: var(--doux) !important; }
.fo-quiz__q input[disabled] + * , .fo-quiz__q label:has(input[disabled]) { cursor: default; }
.fo-quiz__q label:has(input[disabled]):hover { background: none; }
.fo-quiz__q label.is-bonne:has(input[disabled]):hover { background: #e8f3ec; }
.fo-quiz__q label.is-fausse:has(input[disabled]):hover { background: #fdecea; }
#mq .fo-quiz__score { margin: 0; font-weight: 650; }
/* « Vos essais » sous le quiz : un essai par pastille, le parfait en vert */
.fo-quiz__essais { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--trait); }
.fo-quiz__essais[hidden] { display: none; }
.fo-quiz__essais h3 { font-size: 0.9375rem; font-weight: 650; color: var(--doux); margin: 0 0 10px; }
.fo-quiz__essais ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.fo-quiz__essais li { padding: 6px 12px; border-radius: 999px; background: var(--fond-alt); font-size: 0.875rem; }
.fo-quiz__essais li b { font-variant-numeric: tabular-nums; }
.fo-quiz__essais li span { color: var(--doux); }
.fo-quiz__essais li.is-parfait { background: rgba(31, 122, 69, 0.1); }
.fo-quiz__essais li.is-parfait b { color: var(--vert); }

/* Jour précédent / suivant : sortie et retour par le même côté */
.fo-suite { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.fo-suite a { display: block; padding: 16px 18px; border-radius: 16px; background: var(--fond-alt); color: var(--texte) !important; font-weight: 600; line-height: 1.3; text-decoration: none !important; }
.fo-suite small { display: block; margin-bottom: 4px; color: var(--accent); font-size: 0.85rem; }
.fo-suite__apres { text-align: right; }

/* Le programme dans l'espace */
.fo-bienvenue { margin-bottom: 32px; padding: 18px 22px; border-radius: 18px; background: #e9f5ee; color: #164f2e; line-height: 1.5; }
.fo-bienvenue b { display: block; }
.fo-semaine__titre { margin-top: 48px; }
.fo-jours { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.fo-jours a { display: flex; align-items: center; gap: 16px; padding: 14px 18px 14px 14px; border-radius: 18px; background: var(--fond-alt); color: var(--texte) !important; text-decoration: none !important; }
.fo-jours a:hover { background: #ececf0; }
.fo-jours__txt { flex: 1; min-width: 0; }
.fo-jours__txt b { display: block; font-size: 1.05rem; line-height: 1.3; }
.fo-jours__txt small { display: block; margin-top: 2px; color: var(--doux); font-size: 0.9rem; line-height: 1.4; }
.fo-jours .fo-num { background: #fff; }
.fo-jours .is-fait .fo-num { background: var(--vert); color: #fff; }
.fo-jours .is-fait .fo-duree { color: var(--vert); font-weight: 600; }
.fo-jours .is-suivant a { background: #fff; box-shadow: 0 0 0 2px var(--accent), 0 12px 30px rgba(201, 75, 38, 0.12); }
.fo-jours .is-suivant .fo-num { background: var(--accent); color: #fff; }
@media (max-width: 575.98px) {
  .fo-jours__txt small { display: none; }
  .fo-barre__ou { display: none; }
  .fo-progres { margin-left: auto; }
}

/* Le kit */
.fo-kit__actions { margin-bottom: 8px; }
.fo-kit__jour .fo-h2 { display: flex; align-items: center; gap: 12px; }

/* ------------------------------------------------------------------
   Préférences du visiteur
   ------------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  .fo-bande { animation: fo-fondu 300ms ease both; }
  .fo-jours a:active, .fo-suite a:active, .fo-copier:active { transform: none; }
}
@keyframes fo-fondu { from { opacity: 0; } }
@media (prefers-reduced-transparency: reduce) {
  .fo-barre { background: #fff; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .fo-lecture { background: rgba(255, 255, 255, 0.35); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (prefers-contrast: more) {
  .fo-barre { background: #fff; border-bottom: 1px solid var(--texte); }
  .fo-prompt, .fo-jours a, .fo-suite a { box-shadow: inset 0 0 0 1px var(--texte); }
}

/* Impression du kit : seulement les consignes */
@media print {
  #mq .navbar, #mq .page-footer, .fo-kit__actions, .fo-copier, .fo-barre, .fo-kit__supports, .fo-cases { display: none !important; }
  mark.fo-trou { background: none; padding: 0; }
  .fo-lecon { padding: 0; }
  .fo-prompt { break-inside: avoid; background: none; border: 1px solid #ccc; }
}

/* partenariat by-cyberdev : badge du haut, deux cartes, mention sous le prix ; page des CGV */
.fo-partenaire { display: inline-block; margin: 0 0 14px; padding: 4px 12px; border-radius: 999px; background: rgba(0, 0, 0, 0.05); font-size: 0.9rem; color: #6e6e73; }
.fo-partenaire a { color: inherit; text-decoration: none; }
.fo-partenaire a b { color: #1d1d1f; }
.fo-partenaire a:hover b { color: var(--accent); }
.fo-duo { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; margin-top: 28px; }
.fo-duo__carte { padding: 24px; border-radius: 20px; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06); }
.fo-duo__carte h3 { margin: 4px 0 10px; font-size: 1.3rem; }
.fo-duo__carte h3 a { color: inherit; }
.fo-duo__carte p:last-child { margin: 0; color: #424245; line-height: 1.55; }
.fo-prix__vendeur { margin: -6px 0 16px; font-size: 0.85rem; color: #a1a1a6; }
.fo-prix__vendeur a, .fo-case a { color: inherit; text-decoration: underline; }
.fo-cgv h2 { margin: 32px 0 8px; font-size: 1.2rem; }
.fo-cgv p { line-height: 1.6; max-width: 72ch; }
.fo-cgv__a-completer { padding: 10px 14px; border-radius: 10px; background: #fff4e5; color: #8a5300; }

/* Questions à Julien (app/formation-questions.php) : une bulle fixe en bas à droite de l'espace, qui ouvre un panneau
   de discussion ancré sur elle (il en sort et y retourne), plein écran sur téléphone. Les réponses de Julien à gauche,
   les messages du participant à droite, comme dans une messagerie. « Mes questions » garde tout l'historique. */
#mq .fo-fil__la { display: flex; align-items: baseline; gap: 7px; margin: 0; color: var(--doux); font-size: 0.85rem; line-height: 1.35; }
.fo-fil__point { flex: none; width: 8px; height: 8px; border-radius: 50%; background: #c7c7cc; transform: translateY(-1px); }
.fo-fil__la.is-la .fo-fil__point { background: #1f9d55; box-shadow: 0 0 0 3px rgba(31, 157, 85, 0.18); }
#mq .fo-fil__la.is-la { color: #1d6b3a; font-weight: 600; }
.fo-fil__liste, .fo-chat__liste { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.fo-fil__liste:empty, .fo-chat__liste:empty { display: none; }
.fo-msg { max-width: 85%; padding: 10px 14px; border-radius: 18px; background: #f5f5f7; }
.fo-msg--eleve { align-self: flex-end; background: #fbeee9; border-bottom-right-radius: 6px; }
.fo-msg--julien { align-self: flex-start; border-bottom-left-radius: 6px; }
#mq .fo-msg p { margin: 0 0 2px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.45; }
.fo-msg small { color: var(--doux); font-size: 0.78rem; font-variant-numeric: tabular-nums; }
.fo-msg small a { color: inherit !important; text-decoration: underline; }
@media (prefers-reduced-motion: no-preference) {
  .fo-msg.is-nouveau { animation: fo-pose 350ms cubic-bezier(0.22, 1, 0.36, 1) both; }
}
.fo-historique { margin-top: 8px; }

/* En bas de la leçon : une ligne, qui ouvre la bulle */
#mq .fo-question { margin: 8px 0 28px; color: var(--doux); font-size: 1.0625rem; }
.fo-question__lien { padding: 0; border: 0; background: none; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; }
.fo-question__lien:hover { text-decoration: underline; }

/* La bulle. Décalée au-dessus du bandeau de l'aperçu administrateur (--fo-chat-bas, mesuré par formation.js) */
.fo-chat { --fo-chat-bas: 0px; }
.fo-bulle { position: fixed; right: max(20px, env(safe-area-inset-right)); bottom: calc(20px + var(--fo-chat-bas) + env(safe-area-inset-bottom)); z-index: 1050;
  display: grid; place-items: center; width: 60px; height: 60px; padding: 0; border: 0; border-radius: 50%; background: var(--accent); color: #fff; cursor: pointer;
  box-shadow: 0 10px 28px rgba(201, 75, 38, 0.32), 0 2px 6px rgba(29, 29, 31, 0.16);
  -webkit-tap-highlight-color: transparent; transition: transform 160ms cubic-bezier(0.22, 1, 0.36, 1), opacity 200ms ease, background-color 0.15s; }
.fo-bulle:hover { background: var(--accent-fonce); }
.fo-bulle:active { transform: scale(0.92); transition-duration: 80ms; }
.fo-bulle:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.fo-bulle svg { grid-area: 1 / 1; width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1), opacity 160ms ease; }
.fo-bulle__ouvrir { fill: currentColor !important; stroke: none !important; }
.fo-bulle__fermer { opacity: 0; transform: rotate(-90deg) scale(0.6); }
.fo-bulle[aria-expanded="true"] .fo-bulle__ouvrir { opacity: 0; transform: rotate(90deg) scale(0.6); }
.fo-bulle[aria-expanded="true"] .fo-bulle__fermer { opacity: 1; transform: none; }
.fo-bulle__pastille { position: absolute; top: -2px; right: -2px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: #d70015; color: #fff;
  font-size: 0.75rem; font-weight: 700; line-height: 22px; text-align: center; font-variant-numeric: tabular-nums; box-shadow: 0 0 0 2px #fff; }
/* une vidéo en lecture passe sous la bulle : elle s'efface pour laisser voir les sous-titres */
.fo-bulle.is-discret { opacity: 0; transform: scale(0.8); pointer-events: none; }
@media (prefers-reduced-motion: no-preference) {
  .fo-bulle.is-arrivee .fo-bulle__pastille { animation: fo-pastille 320ms cubic-bezier(0.22, 1, 0.36, 1) both; }
}
@keyframes fo-pastille { from { transform: scale(0); } }

/* le bas du pied de page reste lisible sous la bulle */
#mq:has(.fo-chat) .page-footer { padding-bottom: 88px; }

/* Le panneau : il sort de la bulle (origine en bas à droite) et y retourne par le même chemin */
.fo-chat__panneau { position: fixed; right: max(20px, env(safe-area-inset-right)); bottom: calc(92px + var(--fo-chat-bas) + env(safe-area-inset-bottom)); z-index: 1050;
  display: flex; flex-direction: column; width: 380px; height: 540px; max-height: calc(100vh - 92px - 84px - var(--fo-chat-bas)); max-height: calc(100dvh - 92px - 84px - var(--fo-chat-bas));
  border-radius: 22px; background: #fff; overflow: hidden; transform-origin: calc(100% - 30px) calc(100% + 42px);
  box-shadow: 0 30px 80px rgba(29, 29, 31, 0.22), 0 8px 24px rgba(29, 29, 31, 0.10), 0 0 0 1px rgba(29, 29, 31, 0.06); }
.fo-chat__panneau[hidden] { display: none; }
.fo-chat__panneau:focus { outline: none; }
@media (prefers-reduced-motion: no-preference) {
  .fo-chat__panneau.is-entree { animation: fo-chat-entree 380ms cubic-bezier(0.22, 1, 0.36, 1) both; }
  .fo-chat__panneau.is-sortie { animation: fo-chat-entree 220ms cubic-bezier(0.64, 0, 0.78, 0) reverse both; }
}
@media (prefers-reduced-motion: reduce) {
  .fo-chat__panneau.is-entree { animation: fo-fondu 160ms ease both; }
  .fo-chat__panneau.is-sortie { animation: fo-fondu 120ms ease reverse both; }
  .fo-bulle, .fo-bulle svg { transition: opacity 160ms ease, background-color 0.15s; }
  .fo-bulle:active, .fo-bulle.is-discret { transform: none; }
  .fo-bulle__fermer, .fo-bulle[aria-expanded="true"] .fo-bulle__ouvrir { transform: none; }
}
@keyframes fo-chat-entree { from { opacity: 0; transform: translateY(12px) scale(0.92); } }

/* En-tête translucide : le fil défile dessous */
.fo-chat__tete { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; padding: 14px 12px 12px 16px;
  background: rgba(255, 255, 255, 0.8); -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 0 1px 0 rgba(29, 29, 31, 0.08); }
.fo-chat__av { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: #1d1d1f; color: #fff; font-weight: 700; font-size: 1.05rem; }
.fo-chat__qui { flex: 1; min-width: 0; }
#mq .fo-chat__qui h2 { margin: 0 0 1px; font-size: 1.05rem; font-weight: 700; letter-spacing: -0.01em; line-height: 1.25; }
.fo-chat__fermer { flex: none; display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: #f5f5f7; color: var(--doux); cursor: pointer;
  transition: background-color 0.15s, transform 100ms ease-out; }
.fo-chat__fermer:hover { background: #e8e8ed; color: var(--texte); }
.fo-chat__fermer:active { transform: scale(0.9); }
.fo-chat__fermer svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }

/* Le fil */
.fo-chat__fil { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 16px 14px 12px; }
#mq .fo-chat__accueil { margin: 0 auto 16px; max-width: 30em; padding: 10px 14px; border-radius: 14px; background: #f5f5f7; color: var(--doux); font-size: 0.9rem; line-height: 1.45; text-align: center; }
.fo-chat__liste .fo-msg { max-width: 82%; font-size: 0.97rem; }
.fo-chat__liste .fo-msg--eleve { background: var(--accent); color: #fff; }
.fo-chat__liste .fo-msg--eleve small { color: rgba(255, 255, 255, 0.82); }

/* Écrire */
.fo-chat__form { padding: 8px 12px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid #ececf0; background: #fff; }
#mq .fo-chat__sujet { margin: 0 4px 6px; overflow: hidden; color: var(--doux); font-size: 0.78rem; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
#mq .fo-chat__form .fo-erreur { margin: 0 0 8px; padding: 8px 12px; font-size: 0.85rem; }
.fo-chat__saisie { display: flex; align-items: flex-end; gap: 8px; padding: 4px 4px 4px 14px; border: 1px solid #d2d2d7; border-radius: 22px; background: #fff; transition: border-color 0.15s, box-shadow 0.15s; }
.fo-chat__saisie:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(201, 75, 38, 0.15); }
.fo-chat__saisie textarea { flex: 1; min-width: 0; min-height: 36px; max-height: 140px; margin: 0; padding: 7px 0; border: 0; outline: none; background: none; resize: none;
  font: inherit; font-size: 1rem; line-height: 1.4; color: var(--texte); }
.fo-chat__saisie textarea:disabled { background: none; color: var(--doux); }
.fo-chat__envoyer { flex: none; display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; background: var(--accent); color: #fff; cursor: pointer;
  transition: background-color 0.15s, transform 100ms ease-out, opacity 0.15s; }
.fo-chat__envoyer:hover { background: var(--accent-fonce); }
.fo-chat__envoyer:active { transform: scale(0.9); }
.fo-chat__envoyer:disabled { opacity: 0.35; cursor: default; transform: none; }
.fo-chat__envoyer svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

/* Téléphone : le panneau prend tout l'écran, la bulle se range dessous */
@media (max-width: 599.98px) {
  .fo-bulle { right: 16px; bottom: calc(16px + var(--fo-chat-bas) + env(safe-area-inset-bottom)); width: 56px; height: 56px; }
  .fo-chat__panneau { inset: 0; width: auto; height: auto; max-height: none; border-radius: 0; transform-origin: calc(100% - 44px) calc(100% - 44px); }
  .fo-chat__tete { padding-top: calc(12px + env(safe-area-inset-top)); }
  .fo-chat.is-ouvert .fo-bulle { opacity: 0; pointer-events: none; }
  html.fo-chat-plein, html.fo-chat-plein body { overflow: hidden; }
}
@media (prefers-reduced-transparency: reduce) {
  .fo-chat__tete { background: #fff; -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (prefers-contrast: more) {
  .fo-chat__panneau { box-shadow: 0 0 0 2px var(--texte); }
  .fo-chat__tete { background: #fff; box-shadow: 0 1px 0 var(--texte); }
  .fo-msg { box-shadow: inset 0 0 0 1px var(--texte); }
}
@media print { .fo-chat, .fo-question { display: none !important; } }
