/* =====================================================================
   ChadIa — thème graphique commun
   Utilisé par index.html, admin.html, setup.html et deroule.html.
   Tailwind (CDN) gère la mise en page ; ce fichier apporte l'identité
   visuelle : polices, couleurs, cartes, boutons, champs, animations.
   ===================================================================== */

:root {
  /* Palette ChadIa — tirée du logo : rouge « Chad », sarcelle « ia », encre du trait.
     Les noms historiques (--rose-*, --violet-*) sont conservés pour ne rien casser :
     --rose-* = rouge de la marque, --violet-* = sarcelle. */
  --ink-950: #0e1220;
  --ink-900: #171e30;
  --ink-800: #20283f;
  --ink-700: #2c3552;
  --ink-600: #3c4768;

  --rose-300: #f7a3a3;
  --rose-400: #f06b6b;
  --rose-500: #eb3b3b;
  --rose-600: #e52728;
  --rose-700: #c01d21;

  --violet-500: #1ca794;
  --violet-600: #14887a;

  --mint-400: #34d399;
  --mint-500: #10b981;
  --mint-600: #059669;

  --amber-400: #fbbf24;
  --sand-50: #f7f8fa;
  --sand-100: #eef0f4;

  --peau: #f3a26d;

  --radius-xs: 10px;
  --radius-sm: 14px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --radius-xl: 30px;

  --shadow-soft: 0 1px 2px rgba(14, 18, 32, .05), 0 6px 18px -10px rgba(14, 18, 32, .16);
  --shadow-card: 0 1px 2px rgba(14, 18, 32, .06), 0 14px 34px -22px rgba(14, 18, 32, .28);
  --shadow-float: 0 18px 40px -22px rgba(192, 29, 33, .45);
  --shadow-inner: inset 0 1px 0 rgba(255, 255, 255, .6);
}

* { -webkit-tap-highlight-color: transparent; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: #1d2233;
  background-color: var(--sand-50);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, .font-display {
  font-family: 'Fredoka', 'Figtree', system-ui, sans-serif;
  letter-spacing: -0.018em;
}

/* ---------------------------------------------------------------------
   FONDS
   --------------------------------------------------------------------- */

/* Fond clair, légèrement coloré, pour les pages "jour" */
.bg-canvas {
  background-color: var(--sand-50);
  background-image:
    radial-gradient(900px 500px at 8% -8%, rgba(229, 39, 40, .10), transparent 65%),
    radial-gradient(760px 480px at 102% 4%, rgba(28, 167, 148, .10), transparent 62%),
    radial-gradient(620px 420px at 50% 118%, rgba(16, 185, 129, .07), transparent 60%);
  background-attachment: fixed;
}

/* Fond sombre "studio" pour la simulation et le pré-roll */
.bg-studio {
  background-color: var(--ink-950);
  background-image:
    radial-gradient(820px 520px at 12% 0%, rgba(229, 39, 40, .22), transparent 60%),
    radial-gradient(720px 520px at 94% 8%, rgba(28, 167, 148, .22), transparent 58%),
    radial-gradient(900px 600px at 50% 112%, rgba(16, 185, 129, .10), transparent 62%);
}

.bg-grain::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .035;
  z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------------------------------------------------------------------
   CARTES ET SURFACES
   --------------------------------------------------------------------- */
.card {
  background: #fff;
  border: 1px solid rgba(23, 30, 48, .07);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.card-soft {
  background: #fff;
  border: 1px solid rgba(23, 30, 48, .07);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
}

.card-glass {
  background: rgba(255, 255, 255, .055);
  border: 1px solid rgba(255, 255, 255, .11);
  border-radius: var(--radius-md);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
}

/* En-tête dégradé des cartes principales */
.hero-gradient {
  background: linear-gradient(128deg, var(--ink-900) 0%, var(--ink-700) 44%, var(--rose-700) 128%);
  position: relative;
  overflow: hidden;
}
.hero-gradient::before {
  content: '';
  position: absolute;
  width: 260px; height: 260px;
  right: -70px; top: -120px;
  border-radius: 9999px;
  background: radial-gradient(circle, rgba(247, 163, 163, .40), transparent 68%);
  /* Purement décoratif : ne doit jamais intercepter les clics
     (sinon il masque le bouton de fermeture en haut à droite). */
  pointer-events: none;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem; height: 3rem;
  border-radius: 9999px;
  font-family: 'Fredoka', 'Figtree', system-ui, sans-serif;
  font-weight: 800;
  font-size: 1.15rem;
  color: #fff;
  background: linear-gradient(140deg, var(--rose-400), var(--rose-600) 55%, var(--violet-600));
  box-shadow: 0 10px 26px -10px rgba(192, 29, 33, .75), var(--shadow-inner);
}

/* ---------------------------------------------------------------------
   BOUTONS
   --------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  font-weight: 650;
  font-size: .925rem;
  line-height: 1;
  padding: .85rem 1.35rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .14s cubic-bezier(.22,1,.36,1), box-shadow .18s ease, background-color .18s ease, border-color .18s ease, color .18s ease;
  text-decoration: none;
}
.btn:active { transform: translateY(1px) scale(.994); }
.btn:focus-visible { outline: 3px solid rgba(229, 39, 40, .38); outline-offset: 2px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; }

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--rose-500), var(--rose-600) 58%, #9c1a1d);
  box-shadow: 0 14px 30px -14px rgba(192, 29, 33, .8), var(--shadow-inner);
}
.btn-primary:hover { box-shadow: 0 18px 38px -14px rgba(192, 29, 33, .9); }

.btn-dark {
  color: #fff;
  background: linear-gradient(135deg, var(--ink-800), var(--ink-950));
  box-shadow: 0 14px 30px -16px rgba(11, 10, 26, .8);
}

.btn-ghost {
  color: #3f3a57;
  background: #fff;
  border-color: rgba(23, 30, 48, .13);
  box-shadow: var(--shadow-soft);
}
.btn-ghost:hover { border-color: rgba(23, 30, 48, .24); background: #fcfbff; }

.btn-danger {
  color: #fff;
  background: linear-gradient(135deg, #f06b6b, #e52728);
  box-shadow: 0 14px 30px -16px rgba(229, 39, 40, .8);
}

.btn-mint {
  color: #fff;
  background: linear-gradient(135deg, var(--mint-400), var(--mint-600));
  box-shadow: 0 14px 30px -16px rgba(5, 150, 105, .8);
}

.btn-sm { padding: .55rem .9rem; font-size: .82rem; border-radius: var(--radius-xs); }
.btn-block { width: 100%; }

/* Bouton discret sur fond sombre */
.btn-onDark {
  color: #e8e6f5;
  background: rgba(255, 255, 255, .08);
  border-color: rgba(255, 255, 255, .14);
}
.btn-onDark:hover { background: rgba(255, 255, 255, .14); }

/* ---------------------------------------------------------------------
   CHAMPS DE SAISIE
   --------------------------------------------------------------------- */
.field {
  width: 100%;
  background: #fff;
  border: 1.5px solid rgba(23, 30, 48, .12);
  border-radius: var(--radius-sm);
  padding: .8rem 1rem;
  font-size: .94rem;
  color: #1d2233;
  transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}
.field::placeholder { color: #a8a2bd; }
.field:hover { border-color: rgba(23, 30, 48, .2); }
.field:focus {
  outline: none;
  border-color: var(--rose-400);
  box-shadow: 0 0 0 4px rgba(244, 114, 182, .18);
}
textarea.field { line-height: 1.6; resize: vertical; }

.field-dark {
  background: rgba(255, 255, 255, .06);
  border-color: rgba(255, 255, 255, .13);
  color: #f3f1fb;
}
.field-dark::placeholder { color: rgba(226, 222, 245, .45); }
.field-dark:focus { border-color: var(--rose-400); box-shadow: 0 0 0 4px rgba(229, 39, 40, .22); }

/* Champ secret avec bouton « œil » (ajouté par password-eye.js) */
.pw-wrap { position: relative; display: block; }
.pw-wrap .has-eye { padding-right: 2.9rem; }
.pw-eye {
  position: absolute;
  top: 50%;
  right: .5rem;
  transform: translateY(-50%);
  width: 2rem; height: 2rem;
  display: grid; place-items: center;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #9a93b0;
  cursor: pointer;
  transition: color .16s ease, background-color .16s ease;
}
.pw-eye svg { width: 1.15rem; height: 1.15rem; }
.pw-eye:hover { color: var(--rose-600); background: rgba(229, 39, 40, .09); }
.pw-eye:focus-visible { outline: 2px solid rgba(229, 39, 40, .45); outline-offset: 1px; }
.pw-eye.is-visible { color: var(--rose-600); }
/* Sur fond sombre (écran de simulation) */
.field-dark.has-eye + .pw-eye { color: rgba(226, 222, 245, .6); }
.field-dark.has-eye + .pw-eye:hover { color: #fff; background: rgba(255, 255, 255, .12); }

.label {
  display: block;
  font-size: .845rem;
  font-weight: 650;
  color: #332f4a;
  margin-bottom: .45rem;
}
.hint { font-size: .775rem; color: #7d7694; margin-top: .4rem; line-height: 1.5; }

/* ---------------------------------------------------------------------
   BADGES / PASTILLES
   --------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .02em;
  padding: .3rem .65rem;
  border-radius: 9999px;
}
.badge-rose { background: #fde3e3; color: #9c1a1d; }
.badge-mint { background: #d1fae5; color: #065f46; }
.badge-amber { background: #fef3c7; color: #92400e; }
.badge-slate { background: #eceaf4; color: #413c5c; }
.badge-violet { background: #d3f4ec; color: #136d63; }

/* ---------------------------------------------------------------------
   ONGLETS (espace enseignant)
   --------------------------------------------------------------------- */
.tab-btn {
  position: relative;
  padding: .7rem 1.1rem;
  font-size: .89rem;
  font-weight: 650;
  color: #687089;
  border-radius: var(--radius-xs) var(--radius-xs) 0 0;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: color .16s ease, background-color .16s ease;
  white-space: nowrap;
}
.tab-btn:hover { color: #2b2746; background: rgba(229, 39, 40, .06); }
.tab-btn.is-active { color: var(--rose-700); }
.tab-btn.is-active::after {
  content: '';
  position: absolute;
  left: .7rem; right: .7rem; bottom: -1px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(90deg, var(--rose-500), var(--violet-500));
  pointer-events: none;
}

/* ---------------------------------------------------------------------
   TABLEAUX
   --------------------------------------------------------------------- */
.table-wrap {
  border: 1px solid rgba(23, 30, 48, .08);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow-soft);
}
.table-wrap table { width: 100%; border-collapse: collapse; }
.table-wrap thead th {
  background: #f7f5fb;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #6b6487;
  font-weight: 700;
  padding: .75rem 1rem;
  text-align: left;
  white-space: nowrap;
}
.table-wrap tbody td { padding: .8rem 1rem; font-size: .875rem; border-top: 1px solid #f0eef7; vertical-align: middle; }
.table-wrap tbody tr:hover { background: #fdfaff; }

/* ---------------------------------------------------------------------
   ANIMATIONS
   --------------------------------------------------------------------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes subtleFloat { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-4px) rotate(.4deg); } }
@keyframes headNod { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(3px); } }
@keyframes pulseRing { 0% { transform: scale(.95); opacity: .7; } 70% { transform: scale(1.07); opacity: 0; } 100% { transform: scale(1.07); opacity: 0; } }
@keyframes shimmer { 0% { background-position: -420px 0; } 100% { background-position: 420px 0; } }
@keyframes popIn { 0% { opacity: 0; transform: scale(.82); } 60% { opacity: 1; transform: scale(1.04); } 100% { transform: scale(1); } }
@keyframes equalize { 0%, 100% { transform: scaleY(.35); } 50% { transform: scaleY(1); } }

.anim-fade-up { animation: fadeUp .5s cubic-bezier(.22,1,.36,1) both; }
.anim-fade-in { animation: fadeIn .4s ease both; }
.anim-pop { animation: popIn .45s cubic-bezier(.22,1,.36,1) both; }
.delay-1 { animation-delay: .06s; }
.delay-2 { animation-delay: .12s; }
.delay-3 { animation-delay: .18s; }
.delay-4 { animation-delay: .24s; }

/* Avatar */
.avatar-breathing { animation: subtleFloat 5s ease-in-out infinite; transform-origin: center bottom; }
.avatar-listening-nod { animation: headNod 2.2s ease-in-out infinite; transform-origin: center bottom; }
.eyelid { transition: transform .09s ease-in-out; transform-origin: center top; }

.avatar-stage {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .13);
  box-shadow: 0 40px 90px -42px rgba(0, 0, 0, .85), var(--shadow-inner);
  transition: border-color .3s ease, box-shadow .3s ease;
}
.halo-listening { border-color: rgba(52, 211, 153, .75) !important; box-shadow: 0 0 0 1px rgba(52,211,153,.35), 0 30px 80px -40px rgba(16, 185, 129, .75) !important; }
.halo-listening::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  border: 3px solid var(--mint-400); animation: pulseRing 1.8s cubic-bezier(.24,0,.38,1) infinite; pointer-events: none; z-index: 2;
}
.halo-speaking { border-color: rgba(244, 114, 182, .8) !important; box-shadow: 0 0 0 1px rgba(244,114,182,.35), 0 30px 80px -40px rgba(229, 39, 40, .8) !important; }
.halo-speaking::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  border: 3px solid var(--rose-400); animation: pulseRing 1.25s cubic-bezier(.24,0,.38,1) infinite; pointer-events: none; z-index: 2;
}

/* Petites barres d'égaliseur pour l'indicateur micro */
.eq-bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; }
.eq-bars span { width: 3px; height: 100%; border-radius: 2px; background: currentColor; transform-origin: bottom; animation: equalize 1s ease-in-out infinite; }
.eq-bars span:nth-child(2) { animation-delay: .16s; }
.eq-bars span:nth-child(3) { animation-delay: .32s; }
.eq-bars span:nth-child(4) { animation-delay: .48s; }
.eq-idle span { animation-play-state: paused; transform: scaleY(.35); }

/* Chrono en fin de temps */
.timer-warning { color: #f7a3a3 !important; border-color: rgba(251, 113, 133, .55) !important; background: rgba(159, 18, 57, .35) !important; animation: fadeIn .8s ease-in-out infinite alternate; }

/* Barre de progression */
.progress-track { height: 8px; border-radius: 9999px; background: rgba(23, 30, 48, .09); overflow: hidden; }
.progress-fill { height: 100%; border-radius: 9999px; background: linear-gradient(90deg, var(--mint-400), var(--mint-600)); transition: width .5s cubic-bezier(.22,1,.36,1); }

/* Jauge de robustesse du mot de passe */
.pw-meter { height: 6px; border-radius: 9999px; background: rgba(23, 30, 48, .1); overflow: hidden; }
.pw-meter > span { display: block; height: 100%; width: 0; border-radius: 9999px; transition: width .3s ease, background-color .3s ease; }

/* Grille de destinations */
.dest-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: .85rem;
}
@media (max-width: 480px) { .dest-grid { grid-template-columns: 1fr 1fr; gap: .6rem; } }

/* Carte de destination cliquable */
.dest-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: .55rem;
  aspect-ratio: 1 / 1;
  min-height: 160px;
  padding: 1rem .75rem;
  background: #fff;
  border: 1.5px solid rgba(23, 30, 48, .09);
  border-radius: var(--radius-lg, 1.25rem);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  overflow: hidden;
  transition: transform .16s cubic-bezier(.22,1,.36,1), border-color .18s ease, box-shadow .18s ease;
}
/* Fallback si aspect-ratio n'est pas supporté */
@supports not (aspect-ratio: 1 / 1) {
  .dest-card { min-height: 190px; }
}
.dest-card:hover { transform: translateY(-3px) scale(1.02); border-color: rgba(229, 39, 40, .5); box-shadow: 0 20px 40px -24px rgba(192, 29, 33, .45); }
.dest-card.is-done { background: linear-gradient(170deg, #ecfdf5 0%, #fff 60%); border-color: rgba(16, 185, 129, .3); }
.dest-card.is-done:hover { border-color: rgba(16, 185, 129, .6); box-shadow: 0 20px 40px -24px rgba(5, 150, 105, .4); }
.dest-card .dest-icon { width: 2.75rem; height: 2.75rem; border-radius: .85rem; display: grid; place-items: center; flex-shrink: 0; }
.dest-card .dest-title { font-weight: 700; font-size: .82rem; line-height: 1.25; color: var(--ink-900, #0f172a); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; }
.dest-card .dest-meta { font-size: .68rem; color: var(--ink-400, #94a3b8); line-height: 1.35; }
.dest-card .dest-badge { position: absolute; top: .55rem; right: .55rem; }
.dest-card .dest-action { font-size: .7rem; font-weight: 700; display: inline-flex; align-items: center; gap: .3rem; padding: .3rem .7rem; border-radius: 9999px; transition: background .15s ease; }
.dest-card:not(.is-done) .dest-action { color: #c01d21; background: rgba(229, 39, 40, .08); }
.dest-card:not(.is-done):hover .dest-action { background: rgba(229, 39, 40, .15); }
.dest-card.is-done .dest-action { color: #047857; background: rgba(16, 185, 129, .08); }
.dest-card.is-done:hover .dest-action { background: rgba(16, 185, 129, .15); }

/* Spinner du bilan — animation pulsée ChadIa */
.report-pulse-ring {
  width: 80px; height: 80px; border-radius: 50%; position: relative;
  display: grid; place-items: center;
}
.report-pulse-ring::before, .report-pulse-ring::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  border: 2.5px solid rgba(255,255,255,.25);
  animation: reportPulse 2s cubic-bezier(.4,0,.6,1) infinite;
  pointer-events: none;
}
.report-pulse-ring::after { animation-delay: .75s; }
@keyframes reportPulse {
  0% { transform: scale(.85); opacity: .9; }
  50% { transform: scale(1.25); opacity: 0; }
  100% { transform: scale(.85); opacity: 0; }
}
.report-pulse-core {
  width: 48px; height: 48px; border-radius: 50%; background: rgba(255,255,255,.18);
  display: grid; place-items: center; position: relative; z-index: 1;
  animation: reportCoreBreathe 2.5s ease-in-out infinite;
}
@keyframes reportCoreBreathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}
/* Dots de frappe */
.report-typing-dots { display: inline-flex; gap: 5px; align-items: center; }
.report-typing-dots span {
  width: 7px; height: 7px; border-radius: 50%; background: #e52728; opacity: .3;
  animation: typingBlink 1.4s ease-in-out infinite;
}
.report-typing-dots span:nth-child(2) { animation-delay: .2s; }
.report-typing-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes typingBlink {
  0%, 60%, 100% { opacity: .2; transform: scale(.85); }
  30% { opacity: .9; transform: scale(1.1); }
}

/* Score animé dans le bilan */
.anim-pop { animation: popIn .4s cubic-bezier(.175,.885,.32,1.275) both; }
@keyframes popIn {
  0% { opacity: 0; transform: scale(.6); }
  100% { opacity: 1; transform: scale(1); }
}

/* Étape du déroulé */
.step-row {
  display: flex;
  gap: 1rem;
  padding: 1.1rem 1.15rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(23, 30, 48, .07);
  background: #fff;
  box-shadow: var(--shadow-soft);
  transition: border-color .25s ease, box-shadow .25s ease, transform .25s ease, background-color .25s ease;
}
.step-row.is-active {
  border-color: rgba(229, 39, 40, .55);
  background: linear-gradient(180deg, #fff7f7, #fff);
  box-shadow: 0 22px 46px -26px rgba(192, 29, 33, .5);
  transform: translateY(-2px);
}
.step-num {
  flex: none;
  width: 2.3rem; height: 2.3rem;
  display: grid; place-items: center;
  border-radius: 9999px;
  font-family: 'Fredoka', 'Figtree', system-ui, sans-serif;
  font-weight: 800; font-size: .92rem;
  color: var(--rose-700);
  background: #fde3e3;
}
.step-row.is-active .step-num { color: #fff; background: linear-gradient(140deg, var(--rose-500), var(--rose-700)); }

/* Scrollbars discrètes */
* { scrollbar-width: thin; scrollbar-color: rgba(23, 30, 48, .22) transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: rgba(23, 30, 48, .18); border-radius: 9999px; border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: rgba(23, 30, 48, .32); background-clip: content-box; }

/* =====================================================================
   DUOLINGO-STYLE UI ENHANCEMENTS
   Gamified, playful, intuitive — rounded, bouncy, colorful
   ===================================================================== */

/* --- Streaks & XP counters --- */
.xp-pill {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .78rem;
  font-weight: 800;
  padding: .35rem .75rem;
  border-radius: 9999px;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #92400e;
  box-shadow: 0 2px 8px -2px rgba(251, 191, 36, .4);
  letter-spacing: .01em;
}
.xp-pill svg, .xp-pill .xp-icon { width: 1rem; height: 1rem; }

.streak-pill {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .78rem;
  font-weight: 800;
  padding: .35rem .75rem;
  border-radius: 9999px;
  background: linear-gradient(135deg, #fee2e2, #fecaca);
  color: #991b1b;
  box-shadow: 0 2px 8px -2px rgba(239, 68, 68, .3);
}

/* --- Bouncy button style (Duolingo-like 3D press) --- */
.btn-bouncy {
  position: relative;
  border: none;
  border-radius: var(--radius-sm);
  padding: .9rem 1.5rem;
  font-weight: 750;
  font-size: .95rem;
  color: #fff;
  cursor: pointer;
  transition: transform .1s ease, filter .1s ease;
  box-shadow: 0 4px 0 0 #9c1a1d, 0 6px 16px -4px rgba(192, 29, 33, .4);
  background: linear-gradient(180deg, var(--rose-500), var(--rose-600));
}
.btn-bouncy:hover { filter: brightness(1.05); }
.btn-bouncy:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 0 #9c1a1d, 0 2px 6px -2px rgba(192, 29, 33, .3);
}
.btn-bouncy.btn-bouncy-mint {
  background: linear-gradient(180deg, var(--mint-400), var(--mint-600));
  box-shadow: 0 4px 0 0 #047857, 0 6px 16px -4px rgba(5, 150, 105, .4);
}
.btn-bouncy.btn-bouncy-mint:active {
  box-shadow: 0 1px 0 0 #047857, 0 2px 6px -2px rgba(5, 150, 105, .3);
}
.btn-bouncy.btn-bouncy-violet {
  background: linear-gradient(180deg, var(--violet-500), var(--violet-600));
  box-shadow: 0 4px 0 0 #136d63, 0 6px 16px -4px rgba(28, 167, 148, .4);
}
.btn-bouncy.btn-bouncy-violet:active {
  box-shadow: 0 1px 0 0 #136d63, 0 2px 6px -2px rgba(28, 167, 148, .3);
}

/* --- Fun progress bar (thicker, rounded, animated stripes) --- */
.progress-track-fun {
  height: 14px;
  border-radius: 9999px;
  background: rgba(23, 30, 48, .08);
  overflow: hidden;
  position: relative;
}
.progress-fill-fun {
  height: 100%;
  border-radius: 9999px;
  background: linear-gradient(90deg, #34d399, #10b981, #059669);
  transition: width .6s cubic-bezier(.22,1,.36,1);
  position: relative;
  overflow: hidden;
}
.progress-fill-fun::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 6px,
    rgba(255,255,255,.18) 6px,
    rgba(255,255,255,.18) 12px
  );
  animation: progressStripes 1.2s linear infinite;
  pointer-events: none;
}
@keyframes progressStripes {
  0% { background-position: 0 0; }
  100% { background-position: 24px 0; }
}

/* --- Destination cards: Duolingo lesson-node style --- */
.dest-card-duo {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: .5rem;
  aspect-ratio: 1 / 1;
  min-height: 160px;
  padding: 1rem .75rem;
  background: #fff;
  border: 2.5px solid rgba(23, 30, 48, .08);
  border-radius: var(--radius-lg);
  cursor: pointer;
  overflow: hidden;
  transition: transform .14s cubic-bezier(.22,1,.36,1), border-color .18s ease, box-shadow .18s ease;
  box-shadow: 0 3px 0 0 rgba(23, 30, 48, .08), var(--shadow-soft);
}
.dest-card-duo:hover {
  transform: translateY(-4px);
  border-color: var(--rose-400);
  box-shadow: 0 6px 0 0 rgba(229, 39, 40, .15), 0 16px 32px -16px rgba(192, 29, 33, .35);
}
.dest-card-duo:active { transform: translateY(0); box-shadow: 0 1px 0 0 rgba(23, 30, 48, .1); }
.dest-card-duo.is-done {
  border-color: rgba(16, 185, 129, .4);
  background: linear-gradient(170deg, #ecfdf5 0%, #fff 55%);
  box-shadow: 0 3px 0 0 rgba(16, 185, 129, .2), var(--shadow-soft);
}
.dest-card-duo.is-done:hover {
  border-color: var(--mint-500);
  box-shadow: 0 6px 0 0 rgba(16, 185, 129, .2), 0 16px 32px -16px rgba(5, 150, 105, .3);
}
.dest-card-duo .dest-icon { width: 3rem; height: 3rem; border-radius: 1rem; display: grid; place-items: center; flex-shrink: 0; font-size: 1.5rem; }
.dest-card-duo .dest-title { font-weight: 700; font-size: .82rem; line-height: 1.25; color: var(--ink-900); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; }
.dest-card-duo .dest-meta { font-size: .68rem; color: #94a3b8; line-height: 1.35; }
.dest-card-duo .dest-badge { position: absolute; top: .55rem; right: .55rem; }
.dest-card-duo .dest-action { font-size: .7rem; font-weight: 700; display: inline-flex; align-items: center; gap: .3rem; padding: .3rem .7rem; border-radius: 9999px; transition: background .15s ease; }
.dest-card-duo:not(.is-done) .dest-action { color: #c01d21; background: rgba(229, 39, 40, .08); }
.dest-card-duo:not(.is-done):hover .dest-action { background: rgba(229, 39, 40, .15); }
.dest-card-duo.is-done .dest-action { color: #047857; background: rgba(16, 185, 129, .08); }
.dest-card-duo.is-done:hover .dest-action { background: rgba(16, 185, 129, .15); }

/* --- Check circle for completed items --- */
.check-circle {
  width: 1.6rem; height: 1.6rem;
  border-radius: 9999px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--mint-400), var(--mint-600));
  color: #fff;
  box-shadow: 0 2px 6px -2px rgba(5, 150, 105, .5);
}
.check-circle svg { width: .9rem; height: .9rem; }

/* --- Score celebration ring --- */
.score-ring {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 5rem; height: 5rem;
  border-radius: 9999px;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(229, 39, 40, .15), 0 8px 24px -8px rgba(192, 29, 33, .3);
  position: relative;
}
.score-ring::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 9999px;
  background: conic-gradient(var(--rose-500) var(--pct, 0%), transparent var(--pct, 0%));
  z-index: -1;
  mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
}

/* --- Feedback phase cards (student report) --- */
.feedback-card {
  border-radius: var(--radius-md);
  padding: 1rem 1.15rem;
  border: 1.5px solid;
  transition: transform .15s ease;
}
.feedback-card:hover { transform: translateY(-1px); }
.feedback-card.feedback-ok {
  border-color: rgba(16, 185, 129, .3);
  background: linear-gradient(135deg, #ecfdf5, #fff);
}
.feedback-card.feedback-partial {
  border-color: rgba(251, 191, 36, .35);
  background: linear-gradient(135deg, #fffbeb, #fff);
}
.feedback-card.feedback-missing {
  border-color: rgba(229, 39, 40, .25);
  background: linear-gradient(135deg, #fef2f2, #fff);
}
.feedback-icon {
  width: 1.5rem; height: 1.5rem;
  border-radius: 9999px;
  display: grid; place-items: center;
  font-size: .75rem;
  font-weight: 800;
  flex-shrink: 0;
}
.feedback-ok .feedback-icon { background: #d1fae5; color: #065f46; }
.feedback-partial .feedback-icon { background: #fef3c7; color: #92400e; }
.feedback-missing .feedback-icon { background: #fde3e3; color: #9c1a1d; }

/* --- Stat cards (Duolingo summary style) --- */
.stat-card-duo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .35rem;
  padding: 1.1rem .8rem;
  background: #fff;
  border: 1.5px solid rgba(23, 30, 48, .07);
  border-radius: var(--radius-lg);
  box-shadow: 0 2px 0 0 rgba(23, 30, 48, .05), var(--shadow-soft);
  text-align: center;
}
.stat-card-duo .stat-value {
  font-family: 'Fredoka', 'Figtree', system-ui, sans-serif;
  font-weight: 800;
  font-size: 1.75rem;
  line-height: 1;
  background: linear-gradient(135deg, var(--rose-500), var(--violet-600));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.stat-card-duo .stat-label {
  font-size: .72rem;
  font-weight: 600;
  color: #687089;
  line-height: 1.3;
}

/* --- Fun confetti burst (triggered on good score) --- */
@keyframes confettiFall {
  0% { transform: translateY(-20px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(120px) rotate(360deg); opacity: 0; }
}
.confetti-piece {
  position: absolute;
  width: 8px; height: 8px;
  border-radius: 2px;
  animation: confettiFall 1.5s cubic-bezier(.25,.46,.45,.94) forwards;
  pointer-events: none;
}

/* --- Admin sidebar nav (future) + tab enhancements --- */
.tab-btn-duo {
  position: relative;
  padding: .75rem 1.2rem;
  font-size: .85rem;
  font-weight: 700;
  color: #687089;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: color .16s ease, background-color .16s ease, box-shadow .16s ease;
  white-space: nowrap;
}
.tab-btn-duo:hover { color: var(--rose-600); background: rgba(229, 39, 40, .06); }
.tab-btn-duo.is-active {
  color: #fff;
  background: linear-gradient(135deg, var(--rose-500), var(--rose-600));
  box-shadow: 0 3px 0 0 #9c1a1d, 0 4px 12px -4px rgba(192, 29, 33, .4);
}

/* --- Tooltip helper --- */
.tooltip-hint {
  position: relative;
  cursor: help;
}
.tooltip-hint::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) scale(.92);
  padding: .4rem .7rem;
  font-size: .72rem;
  font-weight: 600;
  color: #fff;
  background: var(--ink-800);
  border-radius: var(--radius-xs);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease, transform .15s ease;
  z-index: 10;
}
.tooltip-hint:hover::after { opacity: 1; transform: translateX(-50%) scale(1); }

/* --- Smooth section transitions --- */
.section-enter { animation: sectionSlideIn .35s cubic-bezier(.22,1,.36,1) both; }
@keyframes sectionSlideIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

/* --- Mascot speech bubble --- */
.speech-bubble {
  position: relative;
  background: #fff;
  border: 1.5px solid rgba(23, 30, 48, .1);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow-soft);
  font-size: .88rem;
  line-height: 1.55;
  color: #332f4a;
}
.speech-bubble::before {
  content: '';
  position: absolute;
  left: 1.5rem;
  bottom: -9px;
  width: 18px; height: 18px;
  background: #fff;
  border-right: 1.5px solid rgba(23, 30, 48, .1);
  border-bottom: 1.5px solid rgba(23, 30, 48, .1);
  transform: rotate(45deg);
  pointer-events: none;
}

/* --- Empty state illustration style --- */
.empty-state-circle {
  width: 4rem; height: 4rem;
  border-radius: 9999px;
  background: linear-gradient(135deg, #fde3e3, #d3f4ec);
  display: grid; place-items: center;
  margin: 0 auto 1rem;
}
.empty-state-circle svg { width: 1.8rem; height: 1.8rem; color: var(--rose-500); }

/* ── SONCAS Toggle Buttons ── */
.soncas-toggle {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.4rem 0.75rem; border-radius: 999px;
  border: 2px solid #e2e8f0; background: #fff;
  font-size: 0.8rem; font-weight: 600; color: #64748b;
  cursor: pointer; transition: all 0.2s ease;
  user-select: none;
}
.soncas-toggle:hover { border-color: #72d6c3; color: #14887a; }
.soncas-toggle.is-active {
  border-color: #14887a; background: linear-gradient(135deg, #d3f4ec 0%, #eefbf8 100%);
  color: #14887a; box-shadow: 0 0 0 3px rgba(28, 167, 148,0.12);
}
.soncas-toggle .soncas-letter {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.4rem; height: 1.4rem; border-radius: 50%;
  background: #f1f5f9; font-weight: 800; font-size: 0.65rem;
  color: #475569; transition: all 0.2s;
}
.soncas-toggle.is-active .soncas-letter {
  background: #14887a; color: #fff;
}
.soncas-toggle .soncas-label { font-size: 0.75rem; }

/* ── Sous-onglets (ex: Réglages) ── */
.settings-subnav { border-bottom: 1px solid #e2e8f0; margin-bottom: .25rem; }
.settings-subtab {
  padding: .55rem 1rem; border-radius: .7rem .7rem 0 0;
  font-size: .85rem; font-weight: 700; color: #64748b;
  border-bottom: 2.5px solid transparent; white-space: nowrap;
  transition: color .15s, border-color .15s, background .15s;
}
.settings-subtab:hover { color: #334155; background: #f8fafc; }
.settings-subtab.is-active { color: #e52728; border-bottom-color: #e52728; }

/* ── Cartes de choix du moteur IA ── */
.ia-card {
  position: relative; display: flex; flex-direction: column; align-items: flex-start;
  gap: .35rem; padding: .9rem 1rem; border-radius: 1rem; text-align: left;
  border: 2px solid #e2e8f0; background: #fff; cursor: pointer;
  transition: border-color .18s, box-shadow .18s, transform .18s;
}
.ia-card:hover { border-color: #72d6c3; transform: translateY(-1px); }
.ia-card.is-active {
  border-color: #14887a;
  box-shadow: 0 0 0 3px rgba(28, 167, 148, .13);
  background: linear-gradient(135deg, #f3fbf9 0%, #fff 60%);
}
.ia-card.is-active::after {
  content: '✓'; position: absolute; top: .55rem; right: .7rem;
  width: 1.15rem; height: 1.15rem; border-radius: 50%;
  background: #14887a; color: #fff; font-size: .68rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
.ia-card-logo {
  width: 2.1rem; height: 2.1rem; border-radius: .6rem;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px -4px rgba(0, 0, 0, .35);
}
.ia-card-name { font-weight: 800; font-size: .92rem; color: #0f172a; font-family: 'Fredoka', 'Figtree', system-ui, sans-serif; }
.ia-card-note { font-size: .68rem; color: #94a3b8; }
.ia-card-state { font-size: .68rem; font-weight: 700; }
.ia-card-state.key-ok { color: #059669; }
.ia-card-state.key-missing { color: #e52728; }

/* ── SONCAS/CAP Report Cards ── */
.soncas-cap-card {
  padding: 0.75rem 1rem; border-radius: 0.75rem;
  border: 1px solid #e2e8f0; background: #f8fafc;
  transition: all 0.2s;
}
.soncas-cap-card.cap-full { border-color: #86efac; background: #f0fdf4; }
.soncas-cap-card.cap-partial { border-color: #fde68a; background: #fffbeb; }
.soncas-cap-card.cap-missed { border-color: #fca5a5; background: #fef2f2; }
.cap-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.5rem; height: 1.5rem; border-radius: 50%;
  font-size: 0.6rem; font-weight: 800; border: 2px solid;
}
.cap-badge.cap-ok { border-color: #22c55e; color: #22c55e; background: #dcfce7; }
.cap-badge.cap-ko { border-color: #e2e8f0; color: #cbd5e1; background: #f8fafc; }

/* ===================================================================
   MOBILE — confort tactile et lisibilité sur téléphone
   =================================================================== */

/* iOS zoome automatiquement sur un champ dont le texte fait moins de 16px :
   on force 16px pour que la page ne saute pas à la saisie. */
@media (max-width: 640px) {
  .field, input[type="text"], input[type="email"], input[type="password"],
  input[type="number"], select, textarea {
    font-size: 16px;
  }
  /* Cibles tactiles : minimum 44px, recommandation Apple et Google */
  .btn, .btn-bouncy, .soncas-toggle, .tab-btn-duo, .ia-card {
    min-height: 44px;
  }
  .btn-sm { min-height: 38px; }

  /* Les onglets admin défilent horizontalement au lieu de s'empiler */
  .admin-nav-scroll {
    display: flex;
    gap: .5rem;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding-bottom: .25rem;
    scroll-snap-type: x proximity;
  }
  .admin-nav-scroll::-webkit-scrollbar { display: none; }
  .admin-nav-scroll > * { flex: 0 0 auto; scroll-snap-align: start; }

  /* Titres un peu resserrés pour éviter les débordements */
  .font-display { letter-spacing: -0.02em; }
}

/* ── Assistant "Nouvelle destination" en 5 étapes (wizard) ── */
.wizard-stepper {
  display: flex; flex-wrap: wrap; gap: .5rem;
  padding: .75rem; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 1rem;
}
.wizard-step-btn {
  display: flex; align-items: center; gap: .5rem;
  padding: .5rem .85rem; border-radius: .75rem;
  background: transparent; border: 1px solid transparent;
  font-size: .8rem; font-weight: 700; color: #94a3b8;
  transition: background .15s, color .15s, border-color .15s;
  cursor: pointer;
}
.wizard-step-btn:hover { background: #eef2f7; color: #475569; }
.wizard-step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.5rem; height: 1.5rem; border-radius: 50%;
  background: #e2e8f0; color: #64748b; font-size: .72rem; font-weight: 800;
  transition: background .15s, color .15s;
}
.wizard-step-btn.is-active { background: #fff1f5; color: #e52728; border-color: #fbcaca; }
.wizard-step-btn.is-active .wizard-step-num { background: #e52728; color: #fff; }
.wizard-step-btn.is-done .wizard-step-num { background: #22c55e; color: #fff; }
.wizard-step-btn.is-done { color: #15803d; }
@media (max-width: 640px) {
  .wizard-step-label { display: none; }
  .wizard-step-btn { padding: .5rem; }
}
.wizard-nav {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  padding: .25rem .25rem 1rem;
}
.wizard-nav[hidden], .wizard-step[hidden] { display: none !important; }

/* Menus de navigation (onglets principaux + sous-onglets) centrés sur
   écran large pour un rendu plus équilibré ; sur mobile, on les laisse
   collés à gauche pour que le défilement horizontal reste naturel. */
@media (min-width: 641px) {
  .admin-nav-scroll,
  .settings-subnav {
    justify-content: center;
  }
}

/* --- Menu élève persistant --- */
#student-nav .tab-btn-duo { padding: .55rem .9rem; font-size: .8rem; }

/* Évite le rebond élastique derrière les modales ouvertes */
body.overflow-hidden { overflow: hidden; position: relative; }

/* Respect des préférences système : pas d'animation si l'utilisateur
   a demandé à les réduire (confort et accessibilité). */


/* Impression du bilan */
@media print {
  body { background: #fff !important; }
  .bg-canvas, .bg-studio { background-image: none !important; }
  .no-print { display: none !important; }
  .card, .card-soft { box-shadow: none !important; border: 1px solid #ddd !important; }
  .hero-gradient { background: #20283f !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}



/* ===================================================================
   ABONNEMENT (onglet « Abonnement » de l'espace enseignant)
   =================================================================== */

/* Séparateurs entre les lignes d'un tableau simple */
.divide-slate > tr + tr { border-top: 1px solid rgba(23, 30, 48, .09); }
.divide-slate > tr > td { padding: .7rem 0; }

/* Carte d'offre sélectionnable */
.offre-card {
  border: 2px solid rgba(23, 30, 48, .1);
  border-radius: var(--radius-sm, 16px);
  padding: 1.1rem;
  text-align: left;
  background: #fff;
  cursor: pointer;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
  display: flex;
  flex-direction: column;
  gap: .4rem;
}
.offre-card:hover { border-color: rgba(229, 39, 40, .45); transform: translateY(-2px); }
.offre-card.is-active {
  border-color: var(--rose-600, #e52728);
  box-shadow: 0 12px 30px -16px rgba(229, 39, 40, .8);
}
.offre-card .offre-label { font-weight: 700; color: #2a3045; font-size: 1rem; }
.offre-card .offre-prix { font-weight: 800; color: var(--rose-600, #e52728); font-size: 1.35rem; line-height: 1.2; }
.offre-card .offre-prix small { font-weight: 600; color: #5f6782; font-size: .72rem; }
.offre-card .offre-detail { font-size: .78rem; color: #5f6782; line-height: 1.5; }
.offre-card.is-courante { border-color: #10b981; }

/* ===================================================================
   PANNEAU « ESPACE FERMÉ » (essai terminé / accès suspendu)
   Affiché par assets/espace-ferme.js par-dessus l'interface.
   =================================================================== */
.espace-ferme-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: rgba(15, 23, 42, .92);
  backdrop-filter: blur(6px);
}
.espace-ferme-boite {
  max-width: 28rem;
  text-align: center;
  color: #f1f5f9;
}
.espace-ferme-logo { background: #fff !important; object-fit: contain; padding: 3px;
  width: 52px;
  height: 52px;
  line-height: 52px;
  border-radius: 15px;
  margin: 0 auto 1.25rem;
  background: #e52728;
  font-size: 24px;
  font-weight: 800;
  color: #fff;
}
.espace-ferme-boite h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0 0 .75rem;
  line-height: 1.3;
}
.espace-ferme-boite p {
  color: #94a3b8;
  line-height: 1.6;
  margin: 0;
  font-size: .95rem;
}
.espace-ferme-cta {
  display: inline-block;
  margin-top: 1.5rem;
  padding: 13px 30px;
  border-radius: 12px;
  background: #e52728;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

/* ===================================================================
   PARCOURS D'INSCRIPTION (inscription.html)
   =================================================================== */

/* Pastilles de progression du formulaire en plusieurs étapes */
.progress-dot {
  flex: 1;
  height: 4px;
  border-radius: 9999px;
  background: rgba(23, 30, 48, .1);
  transition: background-color .3s ease;
}
.progress-dot.is-done { background: var(--rose-600, #e52728); }
.progress-dot.is-active { background: linear-gradient(90deg, var(--rose-600, #e52728), #14887a); }

/* Récapitulatif avant validation : liste clé / valeur */
.recap-list > div {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  padding: .625rem 1rem;
}
.recap-list > div + div { border-top: 1px solid rgba(23, 30, 48, .09); }
.recap-list dt { color: #5f6782; }
.recap-list dd { font-weight: 600; color: #2a3045; text-align: right; margin: 0; word-break: break-word; }
.recap-list dd.recap-url {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .78rem;
  color: var(--rose-600, #e52728);
}

/* Champ court (réponse au calcul anti-robot) */
.field-court { max-width: 9rem; }

/* Champ de recherche d'un tableau (panneau de pilotage) */
.field-recherche { max-width: 16rem; }

/* Bandeau de chiffres clés : s'adapte au nombre de cartes et à la largeur
   disponible, sans dépendre d'une grille Tailwind à 5 colonnes qui n'est
   pas générée dans la feuille livrée. */
.kpi-grid {
  display: grid;
  gap: .75rem;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
}

/* Aperçu d'un logo : l'image entière reste visible, sans recadrage */
.logo-contain { object-fit: contain; }

/* ===================================================================
   PRIORITÉ DU MASQUAGE
   theme.css est chargé après tailwind.css : sans cette règle, les
   composants qui définissent un display (.btn, .card…) l'emporteraient
   sur l'utilitaire .hidden et resteraient visibles à l'écran.
   =================================================================== */
.hidden { display: none !important; }

/* =====================================================================
   COUCHE DE MARQUE CHADIA
   Aplats francs comme le logo (pas de dégradés rose→violet), encre
   marine pour les zones sombres, rouge pour l'action, sarcelle pour ce
   qui concerne l'IA. Signature : la barre arrondie sous « Chad » dans le
   logo, reprise sous les titres et les onglets actifs.
   ===================================================================== */

body { font-family: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif; color: #1d2233; }
h1, h2, h3, h4, .font-display { font-family: 'Fredoka', 'Figtree', system-ui, sans-serif; letter-spacing: 0; font-weight: 600; }

.bg-canvas { background: #f7f8fa; background-image: none; }
.bg-studio {
  background-color: #171e30;
  background-image: radial-gradient(700px 420px at 50% 38%, rgba(28, 167, 148, .14), transparent 70%);
}

.hero-gradient { background: #171e30; }
.hero-gradient::before { background: radial-gradient(circle, rgba(229, 39, 40, .28), transparent 68%); }

/* La barre de marque, à poser sous un titre : <span class="barre-marque"></span> */
.barre-marque { display: block; width: 56px; height: 6px; border-radius: 99px; background: #171e30; margin-top: .6rem; }
.hero-gradient .barre-marque, .bg-studio .barre-marque { background: #e52728; }

/* Logo carré : toujours sur sa tuile blanche, visage centré */
.logo-tuile { background: #fff; border-radius: 22%; padding: 2px; object-fit: contain; box-shadow: 0 1px 2px rgba(14,18,32,.08); }
.logo-horizontal { height: 34px; width: auto; display: block; }

.brand-mark { background: #e52728; }

.btn-primary { background: #e52728; box-shadow: 0 10px 22px -14px rgba(192, 29, 33, .7); }
.btn-primary:hover:not(:disabled) { background: #c01d21; }
.btn-danger { background: #c01d21; }
.btn:focus-visible, .field:focus-visible, a:focus-visible, button:focus-visible { outline: 3px solid rgba(28, 167, 148, .55); outline-offset: 2px; }

.btn-bouncy { background: #e52728; }
.btn-bouncy.btn-bouncy-violet { background: #14887a; }

.tab-btn.is-active::after { background: #e52728; height: 4px; border-radius: 99px; }

/* Onglets de navigation (élève, enseignant) : texte encre + barre rouge */
.tab-btn-duo.is-active {
  background: #fff; color: #171e30; box-shadow: none;
  position: relative;
}
.tab-btn-duo.is-active::after {
  content: ''; position: absolute; left: 50%; bottom: 2px; transform: translateX(-50%);
  width: 26px; height: 4px; border-radius: 99px; background: #e52728;
}

.step-row.is-active { background: #fff7f7; }
.step-row.is-active .step-num { background: #e52728; }
.stat-card-duo .stat-value { background: none; -webkit-text-fill-color: currentColor; color: #171e30; }
.score-ring::before { background: conic-gradient(#e52728 var(--pct, 0%), transparent var(--pct, 0%)); }
.progress-dot.is-active { background: #e52728; }
.empty-state-circle { background: #eefbf8; }
.soncas-toggle.is-active { background: #eefbf8; border-color: #14887a; }
.ia-card.is-active { background: #f3fbf9; }
.espace-ferme-logo, .espace-ferme-cta { background: #e52728; }

/* Avatar de l'oral : halos aux couleurs de la marque */
.avatar-stage { background: #20283f; }


.halo-speaking { border-color: rgba(229, 39, 40, .85) !important; box-shadow: 0 0 0 1px rgba(229,39,40,.35), 0 30px 80px -40px rgba(229, 39, 40, .8) !important; }
.halo-listening { border-color: rgba(28, 167, 148, .85) !important; box-shadow: 0 0 0 1px rgba(28,167,148,.35), 0 30px 80px -40px rgba(28, 167, 148, .8) !important; }

/* ---------------------------------------------------------------------
   GUIDE DE MISE EN ROUTE (espace enseignant)
   --------------------------------------------------------------------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.guide-demarrage { background: #fff; border: 1px solid #e6e8ee; border-radius: var(--radius-lg); padding: 1.25rem 1.25rem 1.1rem; }
.guide-demarrage[hidden] { display: none; }
.guide-tete { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1rem; }
.guide-titre { font-size: 1.15rem; color: #171e30; }
.guide-titre::after { content: ''; display: block; width: 40px; height: 5px; border-radius: 99px; background: #171e30; margin-top: .4rem; }
.guide-sous { font-size: .85rem; color: #5f6782; margin-top: .5rem; }
.guide-masquer { font-size: .8rem; font-weight: 600; color: #949aae; padding: .3rem .5rem; border-radius: 8px; }
.guide-masquer:hover { color: #171e30; background: #f2f3f6; }
.guide-etapes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6rem; }
@media (max-width: 900px) { .guide-etapes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .guide-etapes { grid-template-columns: 1fr; } }
.guide-etape { width: 100%; height: 100%; display: flex; gap: .7rem; align-items: flex-start; text-align: left; padding: .8rem .85rem; border-radius: 14px; border: 1.5px solid #e6e8ee; background: #fafbfc; transition: border-color .15s, background .15s; }
.guide-etape:hover { border-color: #171e30; background: #fff; }
.guide-pastille { flex: none; width: 28px; height: 28px; border-radius: 99px; display: grid; place-items: center; font-family: 'Fredoka', sans-serif; font-weight: 600; font-size: .9rem; background: #eef0f4; color: #5f6782; }
.guide-texte { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.guide-nom { font-weight: 700; font-size: .9rem; color: #171e30; }
.guide-aide { font-size: .78rem; line-height: 1.35; color: #5f6782; }
.guide-etape.est-faite { background: #f3fbf9; border-color: #a8e8da; }
.guide-etape.est-faite .guide-pastille { background: #1ca794; color: #fff; }
.guide-etape.est-faite .guide-nom { color: #136d63; }
.guide-etape.est-suivante { background: #fff; border-color: #e52728; box-shadow: 0 10px 24px -18px rgba(192, 29, 33, .7); }
.guide-etape.est-suivante .guide-pastille { background: #e52728; color: #fff; }
/* En-tête élève : visage seul sur mobile, logo complet dès 640 px */
.logo-entete-marque { display: none; height: 40px; width: auto; }
@media (min-width: 640px) { .logo-entete-carre { display: none; } .logo-entete-marque { display: block; } }
/* « .hidden » est forcé (!important) plus haut : on rétablit les variantes
   responsives « hidden sm:… » utilisées dans les pages, sinon ces éléments
   restaient invisibles même sur grand écran. */
@media (min-width: 640px) {
  .hidden.sm\:block { display: block !important; }
  .hidden.sm\:inline { display: inline !important; }
  .hidden.sm\:inline-flex { display: inline-flex !important; }
  .hidden.sm\:flex { display: flex !important; }
}
@media (min-width: 768px) {
  .hidden.md\:block { display: block !important; }
  .hidden.md\:flex { display: flex !important; }
}
@media (min-width: 1024px) {
  .hidden.lg\:block { display: block !important; }
  .hidden.lg\:flex { display: flex !important; }
}

/* ---------------------------------------------------------------------
   PANNEAU DE PILOTAGE — RÉGLAGES
   --------------------------------------------------------------------- */
.reglages-grille { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 2rem; align-items: start; }
@media (max-width: 820px) { .reglages-grille { grid-template-columns: 1fr; } }
.reglages-nav { position: sticky; top: 1.5rem; display: flex; flex-direction: column; gap: .15rem; }
@media (max-width: 820px) { .reglages-nav { position: static; flex-direction: row; overflow-x: auto; gap: .4rem; } }
.reglages-nav a { padding: .5rem .75rem; border-radius: 10px; font-size: .88rem; font-weight: 600; color: #5f6782; white-space: nowrap; }
.reglages-nav a:hover { background: #fff; color: #171e30; }
.reglage-bloc { scroll-margin-top: 1.5rem; }
.reglage-titre { font-size: 1.2rem; color: #171e30; margin-bottom: .35rem; }
.reglage-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-top: 1.4rem; padding-top: 1.1rem; border-top: 1px solid #eef0f4; }
.reglage-test { display: flex; gap: .4rem; flex-wrap: wrap; }
.field-compact { width: 15rem; padding-top: .45rem; padding-bottom: .45rem; font-size: .85rem; }
.reglage-etat { flex-basis: 100%; font-size: .82rem; color: #5f6782; min-height: 1.1rem; }
.reglage-etat.est-ok { color: #136d63; font-weight: 600; }
.reglage-etat.est-erreur { color: #c01d21; font-weight: 600; }
.choix { display: flex; gap: .6rem; align-items: flex-start; padding: .65rem .8rem; border: 1.5px solid #e6e8ee; border-radius: 12px; margin-top: .5rem; font-size: .87rem; color: #3c4768; cursor: pointer; }
.choix:has(input:checked) { border-color: #1ca794; background: #f3fbf9; }
.choix input { margin-top: .2rem; accent-color: #14887a; }
.cle-ligne { display: flex; gap: .6rem; align-items: flex-start; }
.cle-ligne .btn { margin-top: 1.7rem; }
.lien-effacer { color: #c01d21; font-weight: 600; text-decoration: underline; }
.webhook-boite { background: #f7f8fa; border-radius: 14px; padding: .9rem 1rem; }
.webhook-url { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; font-size: .8rem; background: #fff; border: 1px solid #e6e8ee; border-radius: 8px; padding: .45rem .6rem; }
.mode-stripe { font-size: .85rem; font-weight: 600; padding: .6rem .8rem; border-radius: 10px; margin-bottom: 1rem; }
.mode-stripe.est-test { background: #fffbeb; color: #92400e; }
.mode-stripe.est-live { background: #f3fbf9; color: #136d63; }
.alerte-action { margin-top: .6rem; font-size: .8rem; font-weight: 700; padding: .35rem .7rem; border-radius: 8px; background: #171e30; color: #fff; }
.alerte-action:hover { background: #2c3552; }

/* Nom de marque : « Chad » couleur du texte, « ia » en sarcelle, comme le logo */
.nom-chadia { font-weight: inherit; white-space: nowrap; }
.nom-chadia .ia { color: #14887a; font-weight: 700; }
.hero-gradient .nom-chadia .ia, .bg-studio .nom-chadia .ia, .text-white .nom-chadia .ia { color: #3dbea8; }

/* Panneau : santé commerciale et usage IA */
.business-bande { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 1px; background: #e6e8ee; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid #e6e8ee; }
@media (max-width: 820px) { .business-bande { grid-template-columns: repeat(2, minmax(0,1fr)); } }
.business-bande > div { background: #171e30; color: #fff; padding: 1.1rem 1.2rem; }
.business-chiffre { font-family: 'Fredoka', sans-serif; font-weight: 600; font-size: 1.7rem; line-height: 1.1; }
.business-libelle { font-size: .78rem; color: rgba(255,255,255,.65); margin-top: .3rem; }
.jauge-ia { height: 5px; border-radius: 99px; background: #eef0f4; margin-top: .35rem; overflow: hidden; width: 110px; }
.jauge-ia span { display: block; height: 100%; background: #1ca794; }
.jauge-ia span.est-pleine { background: #e52728; }
.sauv-liste { display: flex; flex-direction: column; gap: .4rem; }
.sauv-liste li { display: flex; justify-content: space-between; align-items: center; gap: .8rem; flex-wrap: wrap; padding: .55rem .75rem; border: 1px solid #eef0f4; border-radius: 12px; font-size: .86rem; color: #3c4768; }

/* Courbe de progression de l'élève (SVG) */
.pg-svg { width: 100%; height: auto; display: block; }
.pg-grille { stroke: #eef0f4; stroke-width: 1; }
.pg-moyenne { stroke: #c9ced9; stroke-dasharray: 4 4; }
.pg-axe { font-size: 11px; fill: #949aae; font-family: 'Figtree', sans-serif; }
.pg-aire { fill: rgba(229, 39, 40, .08); }
.pg-ligne { fill: none; stroke: #e52728; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.pg-point { fill: #e52728; stroke: #fff; stroke-width: 2; }

/* Commentaire de l'enseignant */
.commentaire-prof { margin-top: .9rem; padding: .9rem 1rem; border-radius: 14px; background: #f3fbf9; border: 1px solid #a8e8da; }
.commentaire-eleve { border-radius: 16px; background: #f3fbf9; border: 1px solid #a8e8da; padding: 1rem 1.2rem; }
.commentaire-eleve h3 { font-size: 1rem; color: #136d63; margin-bottom: .35rem; }
.commentaire-eleve p { white-space: pre-line; color: #1d2233; font-size: .95rem; line-height: 1.55; }

/* Import d'élèves */
.import-carte .table-wrap td, .import-carte .table-wrap th { font-size: .8rem; padding: .4rem .6rem; }
.import-ko td { color: #c01d21; background: #fef2f2; }
.import-ok { color: #136d63; font-weight: 600; font-size: .9rem; }
.import-erreur { color: #c01d21; font-weight: 600; font-size: .9rem; }
.import-erreurs { font-size: .8rem; color: #9c1a1d; margin-top: .4rem; list-style: disc; padding-left: 1.2rem; }

/* Tableau de classe (carte de chaleur) */
.chaleur-wrap { max-height: 70vh; overflow: auto; }
.chaleur thead th { text-transform: none; letter-spacing: 0; white-space: normal; line-height: 1.25; background: none; border: 0; }
.chaleur td, .chaleur th { border: 0; }
.chaleur { border-collapse: separate; border-spacing: 3px; width: 100%; }
.chaleur th { font-size: .75rem; font-weight: 600; color: #5f6782; text-align: left; vertical-align: bottom; padding: .3rem .4rem; }
.chaleur thead th span { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; max-width: 9.5rem; }
.chaleur tbody th { min-width: 10rem; }
.chaleur-nom { display: block; color: #171e30; font-weight: 700; font-size: .85rem; }
.chaleur-sous { display: block; color: #949aae; font-weight: 500; font-size: .72rem; }
.chaleur td { text-align: center; font-size: .75rem; font-weight: 700; border-radius: 8px; padding: .55rem .4rem; background: #f7f8fa; color: #949aae; min-width: 5.5rem; }
.chaleur-1 { background: #fbcaca !important; color: #801b1e !important; }
.chaleur-2 { background: #fde68a !important; color: #78350f !important; }
.chaleur-3 { background: #a8e8da !important; color: #144843 !important; }
.chaleur-4 { background: #1ca794 !important; color: #fff !important; }
.chaleur-total th .chaleur-nom { color: #e52728; }
.chaleur-total td { outline: 2px solid #171e30; outline-offset: -2px; }
.chaleur-legende { display: flex; gap: .3rem; flex-wrap: wrap; }
.chaleur-legende span { font-size: .7rem; font-weight: 700; padding: .25rem .5rem; border-radius: 6px; }
.offre-choix { gap: .4rem; background: #fff; padding: 1rem; }
/* Sur petit écran, le nom de l'élève reste visible pendant le défilement */
.chaleur thead th:first-child, .chaleur tbody th { position: sticky; left: 0; background: #fff; z-index: 1; }

/* Bouton d'assistance (espace enseignant) */
.assistance-bouton { position: fixed; right: 1.1rem; bottom: calc(1.1rem + env(safe-area-inset-bottom, 0px)); z-index: 60;
  display: inline-flex; align-items: center; gap: .45rem; padding: .7rem 1.05rem; border-radius: 99px;
  background: #171e30; color: #fff; font-weight: 700; font-size: .88rem; box-shadow: 0 12px 30px -12px rgba(14,18,32,.6); }
.assistance-bouton:hover { background: #2c3552; }
.assistance-bouton[hidden] { display: none; }
.assistance-fond { position: fixed; inset: 0; z-index: 70; background: rgba(14,18,32,.55); display: flex; align-items: flex-end; justify-content: flex-end; padding: 1rem; }
.assistance-fond.hidden { display: none !important; }
.assistance-boite { width: 100%; max-width: 26rem; background: #fff; border-radius: 22px; padding: 1.4rem; box-shadow: 0 30px 60px -20px rgba(14,18,32,.5); }
.assistance-fermer { width: 2rem; height: 2rem; border-radius: 99px; color: #5f6782; }
.assistance-fermer:hover { background: #f2f3f6; }
@media (max-width: 520px) { .assistance-fond { align-items: flex-end; justify-content: center; padding: .5rem; } }
.report-visage { width: 52px; height: 52px; border-radius: 50%; background: #fff; object-fit: contain; padding: 2px; display: block; }
