/* Animations légères d'Anndal.
   - Retirer ce fichier (ou sa ligne <link>) désactive toutes les animations.
   - Rien ne tourne en boucle ; opacité, déplacement et tracé seulement : pas de changement de taille de page.
   - Le réglage « réduire les animations » du téléphone ou de l'ordinateur coupe tout. */

@media (prefers-reduced-motion: no-preference) {
  @keyframes an-pop { from { transform: scale(.4); opacity: 0 } to { transform: none; opacity: 1 } }
  @keyframes an-shake { 0%, 100% { transform: none } 25% { transform: translateX(-5px) } 75% { transform: translateX(5px) } }
  @keyframes an-fade { from { opacity: 0 } to { opacity: 1 } }
  @keyframes an-up { from { opacity: 0; transform: translateY(8px) } to { opacity: 1; transform: none } }
  @keyframes an-fill { from { clip-path: inset(0 100% 0 0 round 999px) } to { clip-path: inset(0 0 0 0 round 999px) } }
  @keyframes an-draw { to { stroke-dashoffset: 0 } }
  @keyframes an-rise { from { opacity: 0; transform: translateY(24px) } to { opacity: 1; transform: none } }
  @keyframes an-stamp { 0% { opacity: 0; transform: scale(1.6) rotate(-8deg) } 60% { opacity: 1; transform: scale(.94) rotate(-3deg) } 100% { opacity: 1; transform: rotate(-3deg) } }
  @keyframes an-attn { 0% { box-shadow: 0 0 0 0 rgba(11, 74, 168, .45) } 100% { box-shadow: 0 0 0 12px rgba(11, 74, 168, 0) } }
  @keyframes an-bar { from { transform: scaleY(0) } to { transform: scaleY(1) } }

  /* Quiz : retour au toucher et à la correction */
  .quiz-opt { transition: border-color .15s, background .15s, transform .12s }
  .quiz-opt:active { transform: scale(.985) }
  .review-opts li.correct .ro-mark { animation: an-pop .35s cubic-bezier(.2, 1.4, .4, 1) both }
  .review-opts li.wrong { animation: an-shake .3s ease 1 }
  .review-q .review-exp { animation: an-up .25s ease .15s both }

  /* Barres de progression : elles se remplissent une fois */
  .fc-progress > span { animation: an-fill .7s cubic-bezier(.2, .7, .2, 1) both }

  /* Fondu court à l'ouverture d'une leçon */
  .lesson-body { animation: an-fade .18s ease both }

  /* Coche qui se dessine (leçon terminée) */
  .an-check path { stroke-dasharray: 24; stroke-dashoffset: 24; animation: an-draw .3s ease .05s forwards }

  /* Bouton qui attire l'œil deux fois */
  .an-attn { animation: an-attn 1s ease-out 2 }

  /* Attestation : la carte monte, le tampon tombe, une seule fois */
  .an-rise { animation: an-rise .6s cubic-bezier(.2, .7, .2, 1) both }
  .an-stamp { animation: an-stamp .5s cubic-bezier(.2, 1.2, .4, 1) .45s both }

  /* Apparition à l'entrée dans l'écran (ajoutée par animations.js seulement si tout est disponible) */
  html.an-js .an-reveal { opacity: 0; transform: translateY(10px) }
  html.an-js .an-reveal.an-in { opacity: 1; transform: none; transition: opacity .3s ease, transform .3s ease }

  /* « À retenir » : une barre colorée qui s'étire une fois */
  html.an-js .callout.an-reveal { position: relative }
  html.an-js .callout.an-reveal.an-in::before { content: ""; position: absolute; left: -4px; top: 0; bottom: 0; width: 4px; background: var(--green, #2b8a2e); transform-origin: top; animation: an-bar .45s ease .1s both }
}

.an-check { width: 1.6rem; height: 1.6rem; vertical-align: middle; flex: none }

/* Tampon « Réussi » du résultat de quiz et mise en valeur du partage (hors mouvement : la mise en forme reste, sans animation si réduite) */
.res-stamp { display: inline-block; margin-left: .5rem; border: 2px solid #b3541e; color: #b3541e; border-radius: 999px; padding: .05rem .6rem; font: 800 .72rem/1.4 var(--f-head, system-ui); letter-spacing: .02em; transform: rotate(-3deg); vertical-align: middle }
@media (prefers-reduced-motion: no-preference) {
  .quiz-result.an-rise .share-box .share-native,
  .quiz-result.an-rise .share-box summary { animation: an-attn 1s ease-out 2 .9s }
}
