/* ==========================================================================
   TCF ANALYSE REPORT — design system pour les rapports générés par
   App\Services\TestAnalyseService (CE/CO, EE, EO).
   Toutes les classes sont préfixées "tcfr" (TCF Report) pour éviter
   tout conflit avec le reste du CSS du site.
   Mobile-first : les règles de base s'appliquent au petit écran,
   les @media (min-width: ...) enrichissent la mise en page au-delà.
   ========================================================================== */

.tcfr {
  /* ---- Palette ---- */
  --tcfr-text: #23272f;
  --tcfr-text-muted: #6b7280;
  --tcfr-border: #e5e7eb;
  --tcfr-surface: #ffffff;
  --tcfr-surface-soft: #f8fafc;

  --tcfr-blue: #2563eb;
  --tcfr-blue-dark: #1d4ed8;
  --tcfr-blue-bg: #eaf1ff;
  --tcfr-blue-soft: #f5f9ff;

  --tcfr-purple: #7c3aed;
  --tcfr-purple-dark: #5b21b6;
  --tcfr-purple-bg: #f3ebff;
  --tcfr-purple-soft: #f9f5ff;

  --tcfr-orange: #f97316;
  --tcfr-orange-dark: #c2410c;
  --tcfr-orange-bg: #fff1e6;
  --tcfr-orange-soft: #fff8f1;

  --tcfr-green: #16a34a;
  --tcfr-green-dark: #15803d;
  --tcfr-green-bg: #e8f8ee;

  --tcfr-red: #e11d48;
  --tcfr-red-dark: #9f1239;
  --tcfr-red-bg: #fde8ee;

  --tcfr-yellow: #d97706;
  --tcfr-yellow-dark: #92400e;
  --tcfr-yellow-bg: #fff7e6;

  --tcfr-gray: #475569;
  --tcfr-gray-bg: #eef1f5;

  --tcfr-radius-lg: 18px;
  --tcfr-radius: 14px;
  --tcfr-radius-sm: 10px;
  --tcfr-shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
  --tcfr-shadow: 0 4px 14px rgba(16, 24, 40, 0.08);
  --tcfr-shadow-lg: 0 12px 28px rgba(16, 24, 40, 0.12);

  box-sizing: border-box;
  max-width: 900px;
  margin: 0 auto;
  padding: 1rem;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  color: var(--tcfr-text);
  word-break: break-word;
  background: var(--tcfr-surface-soft);
  border-radius: var(--tcfr-radius-lg);
}

.tcfr *,
.tcfr *::before,
.tcfr *::after {
  box-sizing: border-box;
}

/* Contenu HTML "libre" renvoyé directement par l'IA (déjà en <p>/<ul>/<li>),
   sans classes propres : on lui donne un rendu cohérent avec le reste. */
.tcfr p { margin: 0 0 0.6em 0; }
.tcfr p:last-child { margin-bottom: 0; }
.tcfr ul, .tcfr ol { margin: 0.4em 0; padding-left: 1.3rem; }
.tcfr li { margin: 0.4em 0; }
.tcfr strong { font-weight: 700; }

/* Animation d'entrée douce (désactivée si l'utilisateur préfère moins de mouvement) */
@keyframes tcfr-fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: no-preference) {
  .tcfr__hero,
  .tcfr__summary,
  .tcfr__grid,
  .tcfr__section {
    animation: tcfr-fade-up 0.45s ease-out both;
  }
  .tcfr__section:nth-of-type(2) { animation-delay: 0.04s; }
  .tcfr__section:nth-of-type(3) { animation-delay: 0.08s; }
  .tcfr__section:nth-of-type(4) { animation-delay: 0.12s; }
  .tcfr__section:nth-of-type(5) { animation-delay: 0.16s; }
  .tcfr__section:nth-of-type(6) { animation-delay: 0.2s; }
}

/* ==========================================================================
   HERO — bandeau d'introduction (icône + titre)
   ========================================================================== */

.tcfr__hero {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  background: linear-gradient(135deg, #1d4ed8 0%, #38bdf8 100%);
  color: #fff;
  padding: 1.1rem 1.25rem;
  border-radius: var(--tcfr-radius-lg);
  margin-bottom: 1rem;
  box-shadow: var(--tcfr-shadow-lg);
}

.tcfr__hero--ee {
  background: linear-gradient(135deg, #1d4ed8 0%, #38bdf8 100%);
}

.tcfr__hero--danger {
  background: linear-gradient(135deg, #1d4ed8 0%, #38bdf8 100%);
  border-bottom: 4px solid #ef4444;
}

.tcfr__hero-icon {
  flex: none;
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  backdrop-filter: blur(2px);
}

.tcfr__hero--danger .tcfr__hero-icon {
  color: #ffe4e6;
}

.tcfr__hero-body {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.tcfr__eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.85;
}

.tcfr__title {
  margin: 0;
  font-size: clamp(1.05rem, 4vw, 1.35rem);
  line-height: 1.3;
  font-weight: 700;
}

/* ==========================================================================
   SUMMARY — jauge circulaire + stats clés
   ========================================================================== */

.tcfr__summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.1rem;
  background: var(--tcfr-surface);
  border: 1px solid var(--tcfr-border);
  padding: 1.1rem;
  margin: 0 0 1.1rem 0;
  border-radius: var(--tcfr-radius);
  box-shadow: var(--tcfr-shadow-sm);
}

.tcfr__summary--danger {
  border-color: #fecdd3;
  background: #fff9fa;
}

/* ---- Jauge circulaire (conic-gradient piloté par --tcfr-gauge-pct) ---- */

.tcfr__gauge {
  flex: none;
  width: 104px;
  height: 104px;
  position: relative;
}

.tcfr__gauge-ring {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: conic-gradient(
    var(--tcfr-blue) calc(var(--tcfr-gauge-pct, 0) * 1%),
    var(--tcfr-gray-bg) 0
  );
  transition: background 0.6s ease;
}

.tcfr__gauge--danger .tcfr__gauge-ring {
  background: conic-gradient(var(--tcfr-red) 0%, var(--tcfr-gray-bg) 0);
}

.tcfr__gauge-hole {
  position: absolute;
  inset: 10px;
  background: var(--tcfr-surface);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 0 1px var(--tcfr-border);
}

.tcfr__gauge-value {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--tcfr-text);
  line-height: 1.1;
}

.tcfr__gauge-caption {
  font-size: 0.7rem;
  color: var(--tcfr-text-muted);
  font-weight: 600;
}

/* ---- Stats à côté de la jauge ---- */

.tcfr__summary-stats {
  flex: 1 1 180px;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  min-width: 0;
}

.tcfr__stat {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.tcfr__stat-icon {
  flex: none;
  width: 2.1rem;
  height: 2.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  color: var(--tcfr-blue-dark);
  background: var(--tcfr-blue-bg);
  border-radius: 50%;
}

.tcfr__stat-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.tcfr__stat-label {
  font-size: 0.72rem;
  color: var(--tcfr-text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.tcfr__stat-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--tcfr-text);
}

/* ==========================================================================
   GRILLE DE SCORES PAR TÂCHE (EE + EO) — responsive 1 -> 3 colonnes
   ========================================================================== */

.tcfr__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin-bottom: 1.1rem;
}

@media (min-width: 560px) {
  .tcfr__grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.9rem;
  }
}

.tcfr__card {
  position: relative;
  background: var(--tcfr-surface);
  border: 1px solid var(--tcfr-border);
  border-top: 4px solid transparent;
  padding: 1rem 1rem 0.85rem;
  border-radius: var(--tcfr-radius);
  box-shadow: var(--tcfr-shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tcfr__card:hover {
  transform: translateY(-3px);
  box-shadow: var(--tcfr-shadow);
}

.tcfr__card--blue   { border-top-color: var(--tcfr-blue); }
.tcfr__card--orange { border-top-color: var(--tcfr-orange); }
.tcfr__card--purple { border-top-color: var(--tcfr-purple); }

.tcfr__card-icon {
  display: block;
  font-size: 1.1rem;
  margin-bottom: 0.35rem;
  color: var(--tcfr-text-muted);
}

.tcfr__card--blue .tcfr__card-icon   { color: var(--tcfr-blue); }
.tcfr__card--orange .tcfr__card-icon { color: var(--tcfr-orange); }
.tcfr__card--purple .tcfr__card-icon { color: var(--tcfr-purple); }

.tcfr__card-title {
  margin: 0 0 0.35rem 0;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--tcfr-text-muted);
}

.tcfr__card-value {
  margin: 0 0 0.55rem 0;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--tcfr-text);
  line-height: 1;
}

.tcfr__card-max {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--tcfr-text-muted);
}

/* ---- Mini barre de progression sous chaque carte ---- */

.tcfr__mini-bar {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: var(--tcfr-gray-bg);
  overflow: hidden;
}

.tcfr__mini-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--tcfr-blue), var(--tcfr-purple));
  transition: width 0.6s ease;
}

.tcfr__card--blue .tcfr__mini-bar span   { background: linear-gradient(90deg, #60a5fa, var(--tcfr-blue)); }
.tcfr__card--orange .tcfr__mini-bar span { background: linear-gradient(90deg, #fdba74, var(--tcfr-orange)); }
.tcfr__card--purple .tcfr__mini-bar span { background: linear-gradient(90deg, #c4b5fd, var(--tcfr-purple)); }

/* ==========================================================================
   SECTIONS — en-tête avec badge icône + titre (+ compteur optionnel)
   ========================================================================== */

.tcfr__section {
  margin: 1.4rem 0;
}

.tcfr__section-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.7rem;
}

.tcfr__section-icon {
  flex: none;
  width: 2.2rem;
  height: 2.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  border-radius: 50%;
  box-shadow: var(--tcfr-shadow-sm);
}

.tcfr__section-icon--purple { background: var(--tcfr-purple-bg); color: var(--tcfr-purple-dark); }
.tcfr__section-icon--green  { background: var(--tcfr-green-bg); color: var(--tcfr-green-dark); }
.tcfr__section-icon--red    { background: var(--tcfr-red-bg); color: var(--tcfr-red-dark); }
.tcfr__section-icon--yellow { background: var(--tcfr-yellow-bg); color: var(--tcfr-yellow-dark); }
.tcfr__section-icon--blue   { background: var(--tcfr-blue-bg); color: var(--tcfr-blue-dark); }
.tcfr__section-icon--gray   { background: var(--tcfr-gray-bg); color: var(--tcfr-gray); }

.tcfr__section-title {
  margin: 0;
  font-size: clamp(0.95rem, 3.6vw, 1.08rem);
  font-weight: 700;
  color: var(--tcfr-text);
  flex: 1 1 auto;
  min-width: 0;
}

.tcfr__badge {
  flex: none;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
}

.tcfr__badge--green { background: var(--tcfr-green-bg); color: var(--tcfr-green-dark); }
.tcfr__badge--red    { background: var(--tcfr-red-bg); color: var(--tcfr-red-dark); }

.tcfr__subtitle {
  margin: 1.1rem 0 0.4rem 0;
  font-size: 0.92rem;
  font-weight: 700;
}

.tcfr__subtitle--blue   { color: var(--tcfr-blue); }
.tcfr__subtitle--orange { color: var(--tcfr-orange); }
.tcfr__subtitle--purple { color: var(--tcfr-purple); }

.tcfr__subsection {
  margin: 1rem 0;
}

/* ==========================================================================
   BOÎTES COLORÉES
   ========================================================================== */

.tcfr__box {
  padding: 1rem 1.05rem;
  border-radius: var(--tcfr-radius);
  margin: 0.4rem 0;
  border: 1px solid transparent;
  transition: box-shadow 0.2s ease;
}

.tcfr__box:hover {
  box-shadow: var(--tcfr-shadow-sm);
}

.tcfr__box-title {
  margin: 0 0 0.5rem 0;
  font-size: 0.95rem;
  font-weight: 700;
}

.tcfr__box--green {
  background: var(--tcfr-green-bg);
  border-color: #bbf0cf;
}
.tcfr__box--green .tcfr__box-title { color: var(--tcfr-green-dark); }

.tcfr__box--red {
  background: var(--tcfr-red-bg);
  border-color: #fbc9d6;
}
.tcfr__box--red .tcfr__box-title { color: var(--tcfr-red-dark); }

.tcfr__box--yellow {
  background: var(--tcfr-yellow-bg);
  border-color: #fbe0ad;
}

.tcfr__box--gray {
  background: var(--tcfr-surface);
  border-color: var(--tcfr-border);
}

.tcfr__box--muted {
  background: var(--tcfr-gray-bg);
  border-color: #dde3ea;
}
.tcfr__box--muted .tcfr__box-title { color: var(--tcfr-gray); }

.tcfr__box--info {
  background: var(--tcfr-blue-soft);
  border-color: #cfe0ff;
}

.tcfr__box--success {
  background: #edfbf2;
  border-color: #bdeecb;
}

.tcfr__box--warning {
  background: var(--tcfr-yellow-bg);
  border-color: #fbe0ad;
}

.tcfr__box--accent-blue {
  background: var(--tcfr-blue-soft);
  border-left: 4px solid var(--tcfr-blue);
  border-radius: 0 var(--tcfr-radius) var(--tcfr-radius) 0;
}

.tcfr__box--accent-orange {
  background: var(--tcfr-orange-soft);
  border-left: 4px solid var(--tcfr-orange);
  border-radius: 0 var(--tcfr-radius) var(--tcfr-radius) 0;
}

.tcfr__box--accent-purple {
  background: var(--tcfr-purple-soft);
  border-left: 4px solid var(--tcfr-purple);
  border-radius: 0 var(--tcfr-radius) var(--tcfr-radius) 0;
}

.tcfr__box--footer {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: linear-gradient(135deg, #eef2ff 0%, #f5f3ff 100%);
  border-color: #dfe3fb;
}

.tcfr__footer-icon {
  flex: none;
  font-size: 1.3rem;
  line-height: 1;
  color: var(--tcfr-purple);
}

/* ==========================================================================
   LISTES — puces personnalisées selon le contexte de couleur
   ========================================================================== */

.tcfr__list {
  list-style: none;
  margin: 0.5rem 0;
  padding-left: 0;
}

.tcfr__list-item {
  position: relative;
  margin: 0.5rem 0;
  padding-left: 1.6rem;
}

.tcfr__list-item::before {
  content: '•';
  position: absolute;
  left: 0;
  top: 0;
  font-weight: 800;
  color: var(--tcfr-blue);
}

.tcfr__box--green .tcfr__list-item::before {
  content: '✓';
  color: var(--tcfr-green);
}

.tcfr__box--red .tcfr__list-item::before {
  content: '✕';
  color: var(--tcfr-red);
}

/* Liste numérotée façon "conseils" avec puce ronde numérotée */
.tcfr__list--numbered {
  counter-reset: tcfr-count;
}

.tcfr__list--numbered > li {
  counter-increment: tcfr-count;
}

.tcfr__list--numbered > li::before {
  content: counter(tcfr-count);
  position: absolute;
  left: 0;
  top: -1px;
  width: 1.35rem;
  height: 1.35rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  color: #fff;
  background: var(--tcfr-blue);
  border-radius: 50%;
}

.tcfr__paragraph {
  margin: 0.5rem 0;
  background: var(--tcfr-surface);
  border: 1px solid var(--tcfr-border);
  padding: 1rem;
  border-radius: var(--tcfr-radius-sm);
}

.tcfr__paragraph--tight {
  margin: 0;
  background: none;
  border: none;
  padding: 0;
}

.tcfr__note {
  margin: 0.4rem 0;
  font-size: 0.92rem;
  color: var(--tcfr-text);
}

.tcfr__box--yellow .tcfr__note { color: var(--tcfr-yellow-dark); }

/* Contenu HTML "libre" renvoyé directement par l'IA */
.tcfr__free-html {
  margin-top: 0.4rem;
}

/* ==========================================================================
   CORRECTIONS CIBLÉES (EO) — avant / après / explication, style "diff"
   ========================================================================== */

.tcfr__correction {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem;
  margin: 0.6rem 0;
  padding: 0.55rem 0.7rem;
  background: var(--tcfr-surface);
  border: 1px solid var(--tcfr-border);
  border-radius: var(--tcfr-radius-sm);
  font-size: 0.92rem;
}

.tcfr__correction-before {
  color: var(--tcfr-red-dark);
  text-decoration: line-through;
  background: var(--tcfr-red-bg);
  padding: 0.05rem 0.4rem;
  border-radius: 6px;
}

.tcfr__correction-after {
  color: var(--tcfr-green-dark);
  font-weight: 700;
  background: var(--tcfr-green-bg);
  padding: 0.05rem 0.4rem;
  border-radius: 6px;
}

.tcfr__correction-note {
  font-style: italic;
  color: var(--tcfr-text-muted);
  flex-basis: 100%;
}

/* ==========================================================================
   CONSEILS PÉDAGOGIQUES (EO)
   ========================================================================== */

.tcfr__conseil {
  position: relative;
  margin: 0.7rem 0;
  padding: 0.6rem 0.8rem 0.6rem 1.6rem;
  background: var(--tcfr-blue-soft);
  border-radius: var(--tcfr-radius-sm);
}

.tcfr__conseil-exercice {
  font-style: italic;
  color: var(--tcfr-text-muted);
  margin-top: 0.3rem;
  display: block;
  font-size: 0.88rem;
}

/* ==========================================================================
   BANNIÈRE D'ENCOURAGEMENT — pied de rapport
   ========================================================================== */

.tcfr__footer-banner {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  background: linear-gradient(135deg, #22c55e 0%, #0ea5a4 100%);
  color: #fff;
  padding: 1rem 1.1rem;
  border-radius: var(--tcfr-radius);
  margin-top: 1.4rem;
  box-shadow: var(--tcfr-shadow);
}

.tcfr__footer-banner-icon {
  flex: none;
  font-size: 1.4rem;
}

.tcfr__footer-text {
  margin: 0;
  font-size: 0.92rem;
}

/* ==========================================================================
   RESPONSIVE — ajustements écrans plus larges / plus petits
   ========================================================================== */

/* Mobile : on occupe le maximum de largeur disponible — plus de marge/coins
   arrondis qui grignotent l'espace, paddings resserrés partout. */
   @media (max-width: 480px) {
  .tcfr {
    max-width: 100%;
    padding: 1px;
    border-radius: 0;
    margin: 0px;
   
  }
}
@media (max-width: 600px) {
  .tcfr {
    max-width: 100%;
    padding: 0.6rem;
    border-radius: 0;
  }

  .tcfr__summary {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    padding: 0.85rem;
  }

  .tcfr__gauge {
    width: 88px;
    height: 88px;
  }

  .tcfr__gauge-value {
    font-size: 1.2rem;
  }

  .tcfr__hero {
    padding: 0.85rem 0.9rem;
    border-radius: var(--tcfr-radius);
    gap: 0.65rem;
  }

  .tcfr__hero-icon {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1.1rem;
  }

  .tcfr__box,
  .tcfr__card {
    padding: 0.75rem;
  }

  .tcfr__box--footer {
    padding: 0.85rem;
  }

  .tcfr__correction {
    font-size: 0.88rem;
    padding: 0.5rem 0.6rem;
  }

  .tcfr__conseil {
    padding: 0.55rem 0.7rem 0.55rem 1.5rem;
  }

  .tcfr__paragraph {
    padding: 0.8rem;
  }

  .tcfr__grid {
    gap: 0.6rem;
  }

  .tcfr__section {
    margin: 1.1rem 0;
  }

  .tcfr__footer-banner {
    padding: 0.85rem 0.9rem;
  }
}

@media (min-width: 640px) {
  .tcfr {
    padding: 1.4rem;
  }
}

@media (min-width: 768px) {
  .tcfr {
    padding: 1.75rem;
  }

  .tcfr__hero {
    padding: 1.4rem 1.6rem;
  }
}

/* ==========================================================================
   CLASSES SUPPLÉMENTAIRES — rapport "Analyse finale de simulation"
   
   ========================================================================== */

/* ---- Sous-titre du bandeau d'en-tête (ex: date de simulation) ---- */

.tcfr__hero-sub {
  margin: 0.3rem 0 0 0;
  font-size: 0.82rem;
  opacity: 0.9;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* ---- Grille à 4 colonnes (CE / CO / EE / EO), responsive 1 -> 2 -> 4 ---- */

@media (min-width: 480px) {
  .tcfr__grid--4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 800px) {
  .tcfr__grid--4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ---- 2 couleurs de carte manquantes (le système n'avait que bleu/orange/violet) ---- */

.tcfr__card--green { border-top-color: var(--tcfr-green); }
.tcfr__card--red    { border-top-color: var(--tcfr-red); }

.tcfr__card--green .tcfr__card-icon { color: var(--tcfr-green); }
.tcfr__card--red .tcfr__card-icon   { color: var(--tcfr-red); }

.tcfr__card--green .tcfr__mini-bar span { background: linear-gradient(90deg, #6ee7a8, var(--tcfr-green)); }
.tcfr__card--red .tcfr__mini-bar span   { background: linear-gradient(90deg, #fb7185, var(--tcfr-red)); }

/* ---- Badge de niveau CECRL + texte de pondération, sous la mini-barre ---- */

.tcfr__card-badge {
  display: inline-block;
  margin-top: 0.6rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
}

.tcfr__card-foot {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.72rem;
  color: var(--tcfr-text-muted);
}

/* Couleurs de fond du badge, une par niveau CECRL (remplace l'ancien
   getLevelColor() du PHP, désormais getLevelClass()) */
.tcfr__level--a1 { background: linear-gradient(135deg, #dc2626, #b91c1c); }
.tcfr__level--a2 { background: linear-gradient(135deg, #f97316, #ea580c); }
.tcfr__level--b1 { background: linear-gradient(135deg, #f59e0b, #d97706); }
.tcfr__level--b2 { background: linear-gradient(135deg, #059669, #047857); }
.tcfr__level--c1 { background: linear-gradient(135deg, #2563eb, #1d4ed8); }
.tcfr__level--c2 { background: linear-gradient(135deg, #7c3aed, #6d28d9); }

/* ---- Grille pour le HTML libre généré par l'IA (ex. "Points forts") ---- */

.tcfr__free-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
  margin-top: 0.6rem;
}

@media (min-width: 560px) {
  .tcfr__free-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }
}

.tcfr__free-grid > * {
  background: var(--tcfr-surface);
  border: 1px solid var(--tcfr-border);
  border-radius: var(--tcfr-radius-sm);
  padding: 0.85rem;
  margin: 0;
}

/* ---- Bloc "Objectif à 3 mois" — nouveau composant de synthèse motivant ---- */

.tcfr__goal {
  text-align: center;
  background: linear-gradient(135deg, #16a34a 0%, #0ea5a4 100%);
  color: #fff;
  padding: 1.6rem 1.25rem;
  border-radius: var(--tcfr-radius-lg);
  margin: 1.6rem 0;
  box-shadow: var(--tcfr-shadow-lg);
}

.tcfr__goal-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.4rem;
  height: 3.4rem;
  margin: 0 auto 0.85rem;
  font-size: 1.5rem;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 50%;
}

.tcfr__goal-title {
  margin: 0 0 0.6rem 0;
  font-size: clamp(1rem, 3.8vw, 1.15rem);
  font-weight: 700;
}

.tcfr__goal-value {
  font-size: clamp(1.3rem, 5vw, 1.7rem);
  font-weight: 800;
  margin: 0.3rem 0 0.9rem 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);
}

.tcfr__goal-desc {
  max-width: 640px;
  margin: 0 auto;
  font-size: 0.92rem;
  opacity: 0.95;
  text-align: left;
}

.tcfr__goal-desc p { margin: 0 0 0.5em 0; }
.tcfr__goal-desc p:last-child { margin-bottom: 0; }

.tcfr__goal-criteria {
  background: rgba(255, 255, 255, 0.16);
  border-radius: var(--tcfr-radius-sm);
  padding: 1rem;
  margin-top: 1.2rem;
  text-align: left;
}

.tcfr__goal-criteria-title {
  font-weight: 700;
  font-size: 0.92rem;
  margin-bottom: 0.6rem;
  text-align: center;
}

.tcfr__goal-criteria .tcfr__free-html {
  margin-top: 0;
}

.tcfr__goal-criteria ul,
.tcfr__goal-criteria ol {
  padding-left: 1.2rem;
}

/* ---- Ajustements mobile spécifiques à ces nouveaux composants ---- */

@media (max-width: 600px) {
  .tcfr__footer-banner {
    flex-direction: column;
    text-align: center;
  }

  .tcfr__goal {
    padding: 1.1rem 0.9rem;
  }

  .tcfr__goal-desc {
    text-align: left;
    font-size: 0.88rem;
  }
}