/**
 * QLOA Affiliation — formation.css (Aide & formation, MOOC gamifié)
 * Chargé uniquement par `templates/aff/formation.html` (`{% block extra_css %}`).
 * Prefixe `qf-` (namespace dédié) — tokens Liquid Glass canon (design-system.md) :
 * rounded-2xl/xl, bg-white/5, border-white/10, accent emerald-400.
 * `prefers-reduced-motion: reduce` respecté partout (règle a11y canon QLOA).
 */

/* ── Anneau de progression globale (SVG + label centré) ── */
.qf-ring {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.qf-ring-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: rgb(245 245 245);
}

#qf-global-ring-fg {
  transition: stroke-dasharray 0.5s ease-out;
}

@media (prefers-reduced-motion: reduce) {
  #qf-global-ring-fg {
    transition: none;
  }
}

/* ── Badges gagnés (pastilles emoji) ── */
.qf-badge-pill {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 9999px;
  background: rgba(52, 211, 153, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  cursor: default;
}

/* ── Cartes module (grille du parcours) ── */
.qf-module-card {
  display: block;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: box-shadow 0.2s ease-out, border-color 0.2s ease-out, background-color 0.2s ease-out;
}

.qf-module-card:hover {
  background-color: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.18);
}

.qf-module-card:focus-visible {
  outline: 2px solid rgba(52, 211, 153, 0.6);
  outline-offset: 2px;
}

.qf-module-card.qf-module-done {
  border-color: rgba(52, 211, 153, 0.3);
}

.qf-module-card.qf-module-locked {
  opacity: 0.55;
}

@media (prefers-reduced-motion: reduce) {
  .qf-module-card {
    transition: none;
  }
}

/* ── Fil d'étapes (module) ── */
.qf-step {
  height: 6px;
  flex: 1 1 0%;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.1);
  border: 0;
  padding: 0;
  cursor: default;
  transition: background-color 0.2s ease-out;
}

.qf-step[data-qf-clickable="1"] {
  cursor: pointer;
}

.qf-step.qf-step-current {
  background: #ffffff;
}

.qf-step.qf-step-done {
  background: rgba(52, 211, 153, 0.55);
}

@media (prefers-reduced-motion: reduce) {
  .qf-step {
    transition: none;
  }
}

/* ── Options du quiz ── */
.qf-quiz-option {
  text-align: left;
  font-size: 0.875rem;
  line-height: 1.4;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.02);
  color: rgb(212 212 212);
  padding: 0.65rem 0.9rem;
  transition: border-color 0.15s ease-out, background-color 0.15s ease-out, color 0.15s ease-out;
  cursor: pointer;
}

.qf-quiz-option:hover:not(:disabled) {
  border-color: rgba(52, 211, 153, 0.4);
  background: rgba(52, 211, 153, 0.06);
}

.qf-quiz-option:focus-visible {
  outline: 2px solid rgba(52, 211, 153, 0.6);
  outline-offset: 2px;
}

.qf-quiz-option:disabled {
  cursor: default;
}

.qf-quiz-option.qf-quiz-option-correct {
  border-color: rgba(52, 211, 153, 0.5);
  background: rgba(52, 211, 153, 0.12);
  color: rgb(167 243 208);
}

.qf-quiz-option.qf-quiz-option-wrong {
  border-color: rgba(248, 113, 113, 0.5);
  background: rgba(248, 113, 113, 0.1);
  color: rgb(252 165 165);
}

.qf-quiz-option.qf-quiz-option-muted {
  color: rgb(115 115 115);
  border-color: rgba(255, 255, 255, 0.06);
}

@media (prefers-reduced-motion: reduce) {
  .qf-quiz-option {
    transition: none;
  }
}

/* ── Confettis CSS (réussite du quiz) ── */
.qf-confetti {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  overflow: hidden;
}

.qf-confetti-piece {
  position: absolute;
  top: -20px;
  border-radius: 2px;
  animation: qfConfettiFall linear forwards;
}

@keyframes qfConfettiFall {
  from {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  to {
    transform: translateY(110vh) rotate(540deg);
    opacity: 0.4;
  }
}

/* Reduced motion : pas d'animation de chute — on masque simplement l'overlay
   (le message de réussite textuel reste visible dans la carte résultat). */
@media (prefers-reduced-motion: reduce) {
  .qf-confetti {
    display: none !important;
  }
}
