/* ==========================================================================
   Labolycée — système de design « banquise »
   ========================================================================== */

@font-face {
  font-family: 'Inter Variable';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/static/fonts/inter-var.woff2') format('woff2-variations');
}

@font-face {
  font-family: 'Outfit Variable';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/static/fonts/outfit-var.woff2') format('woff2-variations');
}

:root {
  /* Palette */
  --marine-950: #081527;
  --marine-900: #0c1f38;
  --marine-800: #122b4c;
  --marine-700: #1a3a64;
  --bleu-600: #1d6ceb;
  --bleu-500: #3b82f6;
  --bleu-100: #dbeafe;
  --glacier-50: #f5f9fd;
  --glacier-100: #e9f1fa;
  --glacier-200: #d4e3f3;
  --encre: #17233a;
  --gris-600: #47566e;
  --gris-500: #64748b;
  --gris-300: #cbd5e1;
  --bord: #e2e9f2;
  --ambre-500: #f7a325;
  --ambre-600: #e08c12;
  --corail: #e8593f;
  --vert: #0e9f6e;

  /* Typo */
  --police-titres: 'Outfit Variable', system-ui, sans-serif;
  --police-texte: 'Inter Variable', system-ui, sans-serif;

  /* Divers */
  --rayon: 14px;
  --rayon-sm: 9px;
  --ombre-carte: 0 1px 2px rgba(12, 31, 56, 0.05), 0 4px 14px rgba(12, 31, 56, 0.05);
  --ombre-survol: 0 2px 4px rgba(12, 31, 56, 0.07), 0 14px 34px rgba(12, 31, 56, 0.13);
  --transition: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--police-texte);
  font-size: 16px;
  color: var(--encre);
  background: #fff;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--police-titres);
  font-weight: 650;
  letter-spacing: -0.015em;
  line-height: 1.2;
  margin: 0;
}

a {
  color: var(--bleu-600);
}

.conteneur {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 32px);
}

/* Animations d'entrée (handoff § Interactions) */
@keyframes montee { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes popin { from { opacity: 0; transform: translateY(16px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes surgi {
  0% { opacity: 0; transform: translateY(24px) scale(.9) rotate(-4deg); }
  60% { transform: translateY(-4px) scale(1.02) rotate(1deg); }
  100% { opacity: 1; transform: none; }
}
@keyframes flotte { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }

.anim { animation: montee .6s cubic-bezier(.2, .7, .2, 1) both; animation-delay: var(--retard, 0s); }
.anim-surgi { animation: surgi .75s cubic-bezier(.34, 1.4, .5, 1) both; animation-delay: var(--retard, 0s); }
.tux-flotte { animation: flotte 5s ease-in-out infinite; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Messages flash ---------- */
.flash {
  max-width: 1140px;
  margin: 0.9rem auto 0;
  padding: 0.7rem 1.2rem;
  border-radius: var(--rayon-sm);
  font-weight: 550;
}

.flash-ok {
  background: #d1fae5;
  color: #065f46;
}

.flash-erreur {
  background: #fee2e2;
  color: #991b1b;
}

/* ==========================================================================
   En-tête public
   ========================================================================== */

.entete {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--marine-900);
  color: #fff;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05), 0 4px 18px rgba(8, 21, 39, 0.14);
}

.entete-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 13px clamp(16px, 4vw, 32px);
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #fff;
}

.logo-medaillon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  background: #f2f7fc;
  border-radius: var(--rayon);
  flex-shrink: 0;
}

.logo-texte {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.logo-nom {
  font-family: var(--police-titres);
  font-weight: 700;
  font-size: 1.42rem;
  letter-spacing: -0.02em;
}

.logo-nom em {
  font-style: italic;
  font-weight: 800;
}

.logo-surtitre {
  font-size: 0.66rem;
  color: #8fabd4;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-top: 4px;
}

.nav-principale {
  display: flex;
  gap: 4px;
  margin-left: auto;
  align-items: center;
  flex-wrap: wrap;
}

.nav-principale a {
  color: #c8d8ef;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 8px 13px;
  border-radius: var(--rayon-sm);
  transition: var(--transition);
  white-space: nowrap;
}

/* Le menu compte sept entrées : on resserre avant que le bouton « Soutenir »
   ne bascule à la ligne, plutôt que de sacrifier une rubrique. */
@media (max-width: 1290px) {
  .nav-principale a {
    font-size: 0.87rem;
    padding: 8px 9px;
  }
  .entete-inner {
    gap: 12px;
  }
}

@media (max-width: 1080px) {
  .logo-surtitre {
    display: none;
  }
  .nav-principale a {
    font-size: 0.84rem;
    padding: 7px 7px;
  }
}

.nav-principale a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.nav-principale a[aria-current='page'] {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.entete .bouton-don {
  margin-left: 8px;
  background: var(--ambre-500);
  color: var(--marine-900);
  font-weight: 700;
  font-size: 0.92rem;
  padding: 10px 18px;
  border-radius: 999px;
  text-decoration: none;
  box-shadow: 0 3px 10px rgba(224, 140, 18, 0.28);
  transition: var(--transition);
  white-space: nowrap;
}

.entete .bouton-don:hover {
  background: var(--ambre-600);
}

/* ==========================================================================
   Barre de recherche instantanée (persistante sous l'en-tête)
   ========================================================================== */

.bandeau-recherche {
  background: var(--marine-950);
  padding: 0 clamp(16px, 4vw, 32px) 14px;
}

.recherche-vive {
  position: relative;
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 1.5px solid var(--bleu-600);
  border-radius: 16px;
  padding: 4px 8px 4px 16px;
  box-shadow: 0 0 0 4px rgba(29, 108, 235, 0.09), 0 6px 18px rgba(12, 31, 56, 0.07);
  transition: box-shadow 0.18s;
}

.recherche-vive:focus-within {
  box-shadow: 0 0 0 5px rgba(29, 108, 235, 0.22), 0 6px 18px rgba(12, 31, 56, 0.1);
}

.recherche-vive .icone-loupe {
  color: var(--gris-500);
  flex-shrink: 0;
}

.recherche-vive input {
  flex: 1;
  border: 0;
  outline: 0;
  font: inherit;
  font-size: 0.98rem;
  padding: 0.4rem 0;
  background: transparent;
  min-width: 0;
}

.recherche-vive input::-webkit-search-cancel-button {
  display: none;
}

.recherche-vive .raccourci {
  font-family: inherit;
  font-size: 0.72rem;
  color: var(--gris-500);
  border: 1px solid var(--bord);
  border-radius: 5px;
  padding: 0.05rem 0.4rem;
  background: var(--glacier-50);
}

.recherche-vive:focus-within .raccourci {
  display: none;
}

.effacer-recherche {
  border: 0;
  background: transparent;
  color: var(--gris-500);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0.1rem 0.3rem;
}

/* Liste de résultats */
.recherche-resultats {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 60;
  background: #fff;
  border: 1px solid var(--bord);
  border-radius: var(--rayon);
  box-shadow: 0 18px 44px rgba(12, 31, 56, 0.18);
  overflow: hidden auto;
  max-height: min(70vh, 520px);
}

.recherche-resultats[hidden] {
  display: none;
}

.recherche-resultats.chargement::after {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--bleu-500), transparent);
  animation: barre-chargement 0.9s linear infinite;
}

@keyframes barre-chargement {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}

.rv-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.65rem 1rem;
  text-decoration: none;
  color: var(--encre);
  border-bottom: 1px solid var(--bord);
}

.rv-item:last-of-type {
  border-bottom: 0;
}

.rv-item:hover,
.rv-item.survol {
  background: var(--bleu-100);
}

.rv-titre {
  font-weight: 620;
  font-size: 0.96rem;
}

.rv-titre mark {
  background: #fef08a;
  color: inherit;
  border-radius: 3px;
  padding: 0 1px;
}

.rv-meta {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  align-items: center;
  font-size: 0.78rem;
  color: var(--gris-500);
}

.rv-centre {
  font-weight: 600;
  color: var(--marine-800);
}

.rv-thema,
.rv-corrige {
  border-radius: 999px;
  padding: 0.05rem 0.55rem;
  background: var(--glacier-100);
}

.rv-corrige {
  background: #d1fae5;
  color: #065f46;
  font-weight: 600;
}

.rv-vide {
  padding: 1.1rem;
  color: var(--gris-500);
  text-align: center;
}

.rv-tout {
  display: block;
  padding: 0.7rem 1rem;
  text-align: center;
  font-weight: 650;
  font-size: 0.9rem;
  text-decoration: none;
  background: var(--glacier-50);
  border-top: 1px solid var(--bord);
}

.rv-tout:hover {
  background: var(--bleu-100);
}

/* ==========================================================================
   Accueil — héros clair, filtres, grille interactive (handoff Claude Design)
   ========================================================================== */

.heros-clair {
  background: #f4f8fc;
  border-bottom: 1px solid var(--bord);
  padding: clamp(26px, 4vw, 48px) 0 clamp(24px, 3vw, 34px);
}

.heros-haut {
  display: flex;
  align-items: center;
  gap: clamp(20px, 4vw, 48px);
  flex-wrap: wrap;
  margin-bottom: 26px;
}

.heros-texte {
  flex: 1;
  min-width: 290px;
}

.pilule-asso {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.8rem;
  font-weight: 650;
  color: var(--gris-600);
  background: #fff;
  border: 1px solid var(--bord);
  padding: 5px 13px;
  border-radius: 999px;
  margin-bottom: 16px;
}

.heros-clair h1 {
  font-family: var(--police-titres);
  font-weight: 800;
  font-size: clamp(1.9rem, 4.2vw, 2.9rem);
  line-height: 1.06;
  letter-spacing: -0.03em;
  margin: 0 0 13px;
  color: var(--marine-900);
  text-wrap: balance;
}

.heros-clair h1 span {
  color: var(--bleu-600);
}

.heros-texte > p {
  margin: 0 0 22px;
  font-size: clamp(1rem, 1.6vw, 1.14rem);
  color: var(--gris-600);
  max-width: 44ch;
  text-wrap: pretty;
}

.heros-stats {
  display: flex;
  gap: clamp(20px, 3vw, 34px);
  flex-wrap: wrap;
}

.heros-stats .valeur {
  font-family: var(--police-titres);
  font-weight: 800;
  font-size: 1.75rem;
  color: var(--marine-900);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.heros-stats .valeur.vert {
  color: var(--vert);
}

.heros-stats .libelle {
  font-size: 0.82rem;
  color: var(--gris-500);
  margin-top: 5px;
}

.heros-mascotte {
  flex-shrink: 0;
  width: clamp(180px, 26vw, 240px);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.heros-mascotte img {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 14px 22px rgba(12, 31, 56, 0.18));
}

.mascotte-legende {
  font-size: 0.76rem;
  color: var(--gris-500);
  margin-top: 6px;
  text-align: center;
}

/* ---------- Filtres ---------- */

.filtres {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.filtres-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--gris-500);
}

.filtres select {
  border: 1px solid var(--glacier-200);
  background: #fff;
  color: var(--encre);
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 9px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: var(--transition);
}

.filtres select:hover {
  border-color: var(--bleu-600);
}

.filtres select:focus-visible {
  outline: 2px solid var(--bleu-600);
  outline-offset: 1px;
}

/* ---------- Corps de l'accueil ---------- */

.accueil-corps {
  padding-top: clamp(24px, 4vw, 42px);
  padding-bottom: 20px;
}

.bloc-themes {
  margin-bottom: clamp(30px, 4vw, 46px);
}

.bloc-themes h2,
.ligne-titre h2 {
  font-family: var(--police-titres);
  font-weight: 700;
  font-size: 1.4rem;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
  color: var(--marine-900);
}

.grille-themes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}

button.tuile-theme {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #fff;
  border: 1px solid var(--bord);
  border-radius: 16px;
  padding: 18px 18px 16px;
  cursor: pointer;
  font: inherit;
  transition: var(--transition);
}

button.tuile-theme:hover {
  box-shadow: 0 12px 28px rgba(12, 31, 56, 0.1);
  transform: translateY(-3px);
  border-color: var(--glacier-200);
}

button.tuile-theme.active {
  border-color: var(--bleu-600);
  box-shadow: 0 0 0 3px rgba(29, 108, 235, 0.12);
}

button.tuile-theme .icone {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: var(--glacier-100);
  color: var(--bleu-600);
}

.tuile-titre {
  font-family: var(--police-titres);
  font-weight: 700;
  font-size: 1rem;
  color: var(--marine-900);
  line-height: 1.2;
}

.tuile-compte {
  font-size: 0.85rem;
  color: var(--gris-500);
}

.ligne-titre {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.ligne-titre h2 {
  margin: 0;
}

.compteur {
  font-size: 0.9rem;
  color: var(--gris-500);
  font-weight: 500;
}

.puces {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-left: auto;
  align-items: center;
}

.puce {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--glacier-200);
  background: var(--glacier-100);
  color: var(--marine-800);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
  cursor: pointer;
}

.puce:hover {
  background: var(--glacier-200);
}

.puce span {
  color: var(--gris-500);
}

.tout-effacer {
  border: 0;
  background: transparent;
  color: var(--bleu-600);
  font: inherit;
  font-weight: 650;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 5px 8px;
}

.tout-effacer:hover {
  text-decoration: underline;
}

/* ---------- Cartes enrichies ---------- */

.grille .carte {
  animation: popin .5s cubic-bezier(.2, .7, .2, 1) both;
  animation-delay: calc(var(--i, 0) * 45ms);
  border-radius: 16px;
}

.grille .carte:hover {
  border-color: #c3d8ef;
}

.badge-video {
  background: #fbe9d3;
  color: #9a5312;
}

.pilule-thema {
  align-self: flex-start;
  font-size: 0.76rem;
  font-weight: 550;
  padding: 3px 11px;
  border-radius: 999px;
  background: #f0f5fa;
  color: var(--gris-600);
}

.carte .pied-carte {
  border-top: 1px solid #eef3f9;
  padding-top: 8px;
}

.carte .etoiles {
  margin-left: auto;
}

.actions-carte {
  display: flex;
  gap: 8px;
  margin-top: 4px;
  position: relative;
  z-index: 1;
}

.btn-sujet,
.btn-corrige {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: 650;
  font-size: 0.86rem;
  padding: 9px;
  border-radius: 10px;
  text-decoration: none;
  transition: var(--transition);
}

.btn-sujet {
  background: var(--bleu-600);
  color: #fff;
}

.btn-sujet:hover {
  background: #1558c4;
}

.btn-corrige {
  border: 1px solid #a7e0c6;
  background: #eafaf2;
  color: #0b6b47;
}

.btn-corrige:hover {
  background: #d6f4e6;
}

.etat-vide-grille {
  text-align: center;
  padding: 60px 20px;
  background: #fff;
  border: 1px dashed var(--glacier-200);
  border-radius: 18px;
  color: var(--gris-500);
}

.etat-vide-grille .emoji {
  font-size: 2.4rem;
  margin-bottom: 10px;
}

.etat-vide-grille .titre {
  font-family: var(--police-titres);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--marine-900);
  margin-bottom: 6px;
}

.voir-tout {
  text-align: center;
  margin-top: 1.8rem;
}

.voir-tout a {
  font-weight: 650;
  text-decoration: none;
}

.voir-tout a:hover {
  text-decoration: underline;
}

.bloc-don {
  padding: 0 0 clamp(30px, 4vw, 48px);
}

/* ==========================================================================
   Héros (autres pages)
   ========================================================================== */

.heros {
  position: relative;
  background:
    radial-gradient(900px 420px at 78% -10%, rgba(59, 130, 246, 0.35), transparent 65%),
    radial-gradient(700px 380px at 8% 110%, rgba(29, 108, 235, 0.28), transparent 60%),
    linear-gradient(165deg, var(--marine-950) 0%, var(--marine-900) 55%, var(--marine-800) 100%);
  color: #fff;
  overflow: hidden;
}

.heros::after {
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  height: 54px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 54' preserveAspectRatio='none'%3E%3Cpath d='M0 54 L0 34 L90 22 L200 40 L330 16 L460 38 L590 20 L730 42 L870 18 L1010 36 L1120 24 L1200 34 L1200 54 Z' fill='%23ffffff'/%3E%3C/svg%3E") bottom / 100% 54px no-repeat;
}

.heros-inner {
  position: relative;
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  align-items: center;
  gap: 2rem;
  padding: 4.5rem 0 6rem;
  max-width: 1140px;
  margin: 0 auto;
}

@media (max-width: 860px) {
  .heros-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .heros-mascotte {
    display: none;
  }
}

.heros .surtitre {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  font-weight: 650;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #93c5fd;
  margin-bottom: 1.1rem;
}

.heros h1 {
  font-size: clamp(2rem, 4.6vw, 3.1rem);
  font-weight: 750;
  margin-bottom: 1rem;
}

.heros h1 em {
  font-style: normal;
  color: var(--ambre-500);
}

.heros .sous-titre {
  font-size: 1.13rem;
  color: #c8dcf7;
  max-width: 34rem;
  margin: 0 0 1.9rem;
}

@media (max-width: 860px) {
  .heros .sous-titre {
    margin-inline: auto;
  }
}

.heros-recherche {
  display: flex;
  max-width: 34rem;
  border-radius: 999px;
  background: #fff;
  padding: 0.35rem;
  box-shadow: 0 18px 44px rgba(4, 12, 26, 0.42);
}

@media (max-width: 860px) {
  .heros-recherche {
    margin-inline: auto;
  }
}

.heros-recherche input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: 1rem;
  color: var(--encre);
  padding: 0.55rem 1.1rem;
  min-width: 0;
}

.heros-recherche button {
  border: 0;
  background: var(--bleu-600);
  color: #fff;
  font: inherit;
  font-weight: 650;
  padding: 0.55rem 1.5rem;
  border-radius: 999px;
  cursor: pointer;
  transition: var(--transition);
}

.heros-recherche button:hover {
  background: var(--bleu-500);
}

.heros-suggestions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-top: 1.05rem;
  font-size: 0.85rem;
  color: #7fa4d4;
}

@media (max-width: 860px) {
  .heros-suggestions {
    justify-content: center;
  }
}

.heros-suggestions a {
  color: #d3e4fa;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 0.22rem 0.75rem;
  border-radius: 999px;
  transition: var(--transition);
}

.heros-suggestions a:hover {
  background: rgba(255, 255, 255, 0.18);
}

.heros-mascotte {
  justify-self: center;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 24px 30px rgba(4, 12, 26, 0.45));
}

/* Vitrine des Tux historiques dans le héros */
.vitrine-tux {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.1rem;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 22px;
  padding: 1.5rem 1.9rem 1.2rem;
  box-shadow: 0 24px 50px rgba(4, 12, 26, 0.4);
}

.vitrine-titre {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #93c5fd;
}

.vitrine-rangee {
  display: flex;
  align-items: flex-end;
  gap: 1.3rem;
}

.badge-tux {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: #d3e4fa;
  font-size: 0.78rem;
  font-weight: 600;
  transition: var(--transition);
}

.badge-tux:hover {
  transform: translateY(-4px);
  color: #fff;
}

.badge-tux .cercle {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 24%, #ffffff, #dbeafe 62%, #b6d3f2);
  display: grid;
  place-items: center;
  overflow: hidden;
  box-shadow:
    inset 0 -10px 16px rgba(29, 108, 235, 0.22),
    0 10px 22px rgba(4, 12, 26, 0.38);
}

.badge-tux .cercle img {
  height: 68px;
  transform: translateY(4px);
}

.badge-tux.grand .cercle {
  width: 118px;
  height: 118px;
}

.badge-tux.grand .cercle img {
  height: 90px;
}

.vitrine-lien {
  font-size: 0.85rem;
  font-weight: 650;
  color: #d3e4fa;
  text-decoration: none;
}

.vitrine-lien:hover {
  color: #fff;
  text-decoration: underline;
}

/* Tux « crystal » : petites images, ne jamais les agrandir au-delà du natif */
img.tux {
  filter: drop-shadow(0 6px 10px rgba(12, 31, 56, 0.22));
}

/* Bandeau statistiques */
.stats {
  background: #fff;
  padding: 0.4rem 0 2.6rem;
}

.stats-inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  text-align: center;
}

.stat .valeur {
  font-family: var(--police-titres);
  font-size: 2rem;
  font-weight: 750;
  color: var(--marine-900);
  line-height: 1.1;
}

.stat .valeur em {
  font-style: normal;
  color: var(--bleu-600);
}

.stat .libelle {
  font-size: 0.88rem;
  color: var(--gris-500);
  margin-top: 0.15rem;
}

/* ==========================================================================
   Sections & cartes
   ========================================================================== */

section.bloc {
  padding: 3.4rem 0;
}

section.bloc.fond-glacier {
  background: var(--glacier-50);
  border-top: 1px solid var(--bord);
  border-bottom: 1px solid var(--bord);
}

.bloc-titre {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.6rem;
  flex-wrap: wrap;
}

.bloc-titre .surtitre {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--bleu-600);
  margin-bottom: 0.3rem;
}

.bloc-titre h2 {
  font-size: 1.65rem;
}

.bloc-titre .tout-voir {
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.bloc-titre .tout-voir:hover {
  text-decoration: underline;
}

.grille {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 1.15rem;
}

.carte {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  background: #fff;
  border: 1px solid var(--bord);
  border-radius: var(--rayon);
  padding: 1.25rem 1.3rem 1.15rem;
  box-shadow: var(--ombre-carte);
  transition: var(--transition);
}

.carte:hover {
  box-shadow: var(--ombre-survol);
  transform: translateY(-3px);
  border-color: var(--glacier-200);
}

.carte h3 {
  font-size: 1.06rem;
  font-weight: 640;
}

.carte h3 a {
  color: var(--encre);
  text-decoration: none;
}

.carte h3 a::after {
  content: '';
  position: absolute;
  inset: 0;
}

.carte h3 a:hover {
  color: var(--bleu-600);
}

.carte .description {
  font-size: 0.9rem;
  color: var(--gris-600);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.carte .pied-carte {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-top: auto;
  padding-top: 0.55rem;
  color: var(--gris-500);
  font-size: 0.83rem;
}

.meta {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.76rem;
  font-weight: 650;
  padding: 0.16rem 0.68rem;
  border-radius: 999px;
  background: var(--bleu-100);
  color: var(--marine-800);
  white-space: nowrap;
}

.badge-theme {
  background: #fef3c7;
  color: #92400e;
}

.badge-thema {
  background: var(--glacier-100);
  color: var(--gris-600);
  font-weight: 550;
}

.badge-corrige {
  background: #d1fae5;
  color: #065f46;
}

.etoiles {
  color: var(--ambre-500);
  letter-spacing: 0.1em;
  font-size: 0.8rem;
}

.etoiles .vide {
  color: var(--gris-300);
}

/* ==========================================================================
   Tuiles thèmes / centres / années / thémas
   ========================================================================== */

.grille-themes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.15rem;
}

.tuile-theme {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: #fff;
  border: 1px solid var(--bord);
  border-radius: var(--rayon);
  padding: 1.4rem 1.35rem;
  text-decoration: none;
  color: var(--encre);
  box-shadow: var(--ombre-carte);
  transition: var(--transition);
}

.tuile-theme:hover {
  box-shadow: var(--ombre-survol);
  transform: translateY(-3px);
}

.tuile-theme .icone {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--bleu-100);
  color: var(--bleu-600);
}

.tuile-theme h3 {
  font-size: 1.02rem;
  line-height: 1.35;
}

.tuile-theme .compte {
  font-size: 0.85rem;
  color: var(--gris-500);
}

.grille-centres {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1.15rem;
}

.tuile-centre {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  background: #fff;
  border: 1px solid var(--bord);
  border-radius: var(--rayon);
  padding: 1.3rem 1rem 1.1rem;
  text-decoration: none;
  color: var(--encre);
  text-align: center;
  box-shadow: var(--ombre-carte);
  transition: var(--transition);
}

.tuile-centre:hover {
  box-shadow: var(--ombre-survol);
  transform: translateY(-3px);
}

.tuile-centre svg,
.tuile-centre img {
  transition: var(--transition);
}

.tuile-centre:hover svg,
.tuile-centre:hover img {
  transform: scale(1.07) rotate(-2deg);
}

.tuile-centre h3 {
  font-size: 0.98rem;
}

.tuile-centre .compte {
  font-size: 0.82rem;
  color: var(--gris-500);
}

.liste-annees {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.liste-annees a {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
  background: #fff;
  border: 1px solid var(--bord);
  border-radius: 999px;
  padding: 0.55rem 1.3rem;
  text-decoration: none;
  color: var(--encre);
  font-family: var(--police-titres);
  font-weight: 650;
  font-size: 1.05rem;
  box-shadow: var(--ombre-carte);
  transition: var(--transition);
}

.liste-annees a:hover {
  border-color: var(--bleu-600);
  color: var(--bleu-600);
  transform: translateY(-2px);
}

.liste-annees .compte {
  font-family: var(--police-texte);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--gris-500);
}

.nuage-themas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.nuage-themas a {
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 560;
  color: var(--gris-600);
  background: #fff;
  border: 1px solid var(--bord);
  border-radius: 999px;
  padding: 0.34rem 0.95rem;
  transition: var(--transition);
}

.nuage-themas a:hover {
  color: var(--bleu-600);
  border-color: var(--bleu-600);
  background: var(--bleu-100);
}

/* ==========================================================================
   Fiche annale
   ========================================================================== */

.fiche-entete {
  background:
    radial-gradient(700px 300px at 85% -20%, rgba(59, 130, 246, 0.3), transparent 60%),
    linear-gradient(160deg, var(--marine-950), var(--marine-800));
  color: #fff;
  padding: 2.6rem 0 2.9rem;
}

.fiche-entete .conteneur {
  max-width: 1140px;
}

.fiche-entete h1 {
  font-size: clamp(1.5rem, 3.2vw, 2.25rem);
  margin: 0.4rem 0 1rem;
  max-width: 52rem;
}

.fiche-entete .meta {
  gap: 0.5rem;
}

.fiche-entete .badge {
  background: rgba(255, 255, 255, 0.13);
  color: #dbeafe;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.fiche-entete a.badge {
  text-decoration: none;
}

.fiche-entete a.badge:hover {
  background: rgba(255, 255, 255, 0.24);
}

.ariane {
  font-size: 0.84rem;
  color: #7fa4d4;
}

.ariane a {
  color: #a9c6ec;
  text-decoration: none;
}

.ariane a:hover {
  text-decoration: underline;
}

.fiche-corps {
  padding: 2.6rem 1.5rem 3.5rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 2.6rem;
  align-items: start;
}

@media (max-width: 880px) {
  .fiche-corps {
    grid-template-columns: 1fr;
  }
}

.fiche-corps main h2 {
  font-size: 1.3rem;
  margin: 1.8rem 0 0.7rem;
}

.fiche-corps main > p:first-child {
  font-size: 1.06rem;
  color: var(--gris-600);
}

.panneau {
  position: sticky;
  top: 88px;
  background: #fff;
  border: 1px solid var(--bord);
  border-radius: var(--rayon);
  box-shadow: var(--ombre-carte);
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.panneau .manchot-panneau {
  align-self: center;
  margin-top: -58px;
  filter: drop-shadow(0 8px 14px rgba(12, 31, 56, 0.18));
}

.bouton-pdf {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.78rem 1rem;
  border-radius: var(--rayon-sm);
  font-weight: 650;
  font-size: 0.97rem;
  text-decoration: none;
  transition: var(--transition);
}

.bouton-pdf.sujet {
  background: var(--bleu-600);
  color: #fff;
}

.bouton-pdf.sujet:hover {
  background: var(--bleu-500);
}

.bouton-pdf.corrige {
  background: var(--vert);
  color: #fff;
}

.bouton-pdf.corrige:hover {
  filter: brightness(1.08);
}

.bouton-pdf.video {
  background: var(--glacier-100);
  color: var(--marine-800);
}

dl.details {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.42rem 1.1rem;
  margin: 0.4rem 0 0;
  font-size: 0.92rem;
  border-top: 1px solid var(--bord);
  padding-top: 1rem;
}

dl.details dt {
  color: var(--gris-500);
}

dl.details dd {
  margin: 0;
  font-weight: 620;
  text-align: right;
}

/* ==========================================================================
   Visionneuse PDF (page annale)
   ========================================================================== */

.visionneuse {
  margin-top: 1.7rem;
}

.visionneuse-barre {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.onglets {
  position: relative;
  display: inline-flex;
  gap: 2px;
  background: var(--glacier-100);
  border: 1px solid var(--bord);
  border-radius: 999px;
  padding: 4px;
}

.onglet {
  position: relative;
  z-index: 1;
  border: 0;
  background: transparent;
  font: inherit;
  font-weight: 650;
  font-size: 0.95rem;
  color: var(--gris-600);
  padding: 0.5rem 1.35rem;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.2s;
}

.onglet.actif {
  color: #fff;
}

.pilule {
  position: absolute;
  top: 4px;
  bottom: 4px;
  border-radius: 999px;
  background: var(--bleu-600);
  box-shadow: 0 3px 10px rgba(29, 108, 235, 0.35);
  transition: left 0.28s cubic-bezier(0.4, 0, 0.2, 1), width 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.ouvrir-nouvel-onglet {
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.ouvrir-nouvel-onglet:hover {
  text-decoration: underline;
}

.cadres {
  margin-top: 0.9rem;
  overflow: hidden;
  border: 1px solid var(--bord);
  border-radius: var(--rayon);
  background: var(--glacier-50);
  box-shadow: var(--ombre-carte);
}

.cadres-int {
  display: flex;
  width: 200%;
  transition: transform 0.38s cubic-bezier(0.4, 0, 0.2, 1);
}

.cadres-int[style*='100%'] {
  width: 100%;
}

.cadre {
  flex: 1;
  min-width: 0;
}

.cadre iframe {
  display: block;
  width: 100%;
  height: 74vh;
  min-height: 480px;
  border: 0;
  background: #fff;
}

/* ==========================================================================
   Espace perso (favoris, auto-évaluation)
   ========================================================================== */

.perso {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  border-top: 1px solid var(--bord);
  padding-top: 1rem;
}

.bouton-favori {
  border: 1.5px solid var(--gris-300);
  background: #fff;
  color: var(--encre);
  font: inherit;
  font-weight: 650;
  padding: 0.6rem 1rem;
  border-radius: var(--rayon-sm);
  cursor: pointer;
  transition: var(--transition);
}

.bouton-favori:hover {
  border-color: var(--ambre-500);
}

.bouton-favori.actif {
  background: #fef3c7;
  border-color: var(--ambre-500);
  color: #92400e;
}

.autoeval {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.autoeval-titre {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--gris-600);
}

.autoeval-boutons {
  display: flex;
  gap: 0.35rem;
  flex: 1;
}

.autoeval-boutons button {
  flex: 1;
  border: 1.5px solid var(--bord);
  background: #fff;
  border-radius: var(--rayon-sm);
  font-size: 1.15rem;
  padding: 0.3rem 0;
  cursor: pointer;
  filter: grayscale(0.7);
  transition: var(--transition);
}

.autoeval-boutons button:hover {
  filter: none;
  transform: translateY(-1px);
}

.autoeval-boutons button.actif {
  filter: none;
  border-color: var(--bleu-600);
  background: var(--bleu-100);
}

.lien-espace {
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: none;
}

.lien-espace:hover {
  text-decoration: underline;
}

/* ==========================================================================
   Page « Mon espace »
   ========================================================================== */

.bloc-espace {
  margin-bottom: 2.4rem;
}

.bloc-espace h2 {
  font-size: 1.3rem;
  margin-bottom: 1rem;
}

.etat-vide {
  text-align: center;
  color: var(--gris-500);
  background: var(--glacier-50);
  border: 1px dashed var(--gris-300);
  border-radius: var(--rayon);
  padding: 2rem 1.4rem;
}

.eval-resume {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.9rem;
}

.liste-evals {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.ligne-eval {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  background: #fff;
  border: 1px solid var(--bord);
  border-radius: var(--rayon-sm);
  padding: 0.55rem 0.9rem;
  font-size: 0.94rem;
}

.ligne-eval a {
  flex: 1;
  text-decoration: none;
  color: var(--encre);
  font-weight: 550;
}

.ligne-eval a:hover {
  color: var(--bleu-600);
}

.ligne-eval .pastille {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.ligne-eval.note-reussi .pastille { background: var(--vert); }
.ligne-eval.note-a-revoir .pastille { background: var(--ambre-500); }
.ligne-eval.note-rate .pastille { background: var(--corail); }

.ligne-eval .note-lib {
  font-size: 0.85rem;
  color: var(--gris-500);
  white-space: nowrap;
}

.maquette-compte {
  position: relative;
}

.ruban-maquette {
  position: absolute;
  top: -12px;
  right: 16px;
  background: var(--ambre-500);
  color: var(--marine-950);
  font-size: 0.74rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.2rem 0.75rem;
  border-radius: 999px;
  box-shadow: 0 4px 10px rgba(12, 31, 56, 0.18);
}

.maquette-compte h3 {
  font-size: 1.1rem;
}

.maquette-compte .formulaire {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  opacity: 0.65;
}

.maquette-compte input:disabled,
.maquette-compte button:disabled {
  cursor: not-allowed;
}

/* ==========================================================================
   Maquettes : partage, livre d'or, flashcards, chatbot, version texte
   ========================================================================== */

.bouton-partage {
  border: 1.5px solid var(--gris-300);
  background: #fff;
  color: var(--encre);
  font: inherit;
  font-weight: 650;
  padding: 0.6rem 1rem;
  border-radius: var(--rayon-sm);
  cursor: pointer;
  transition: var(--transition);
}

.bouton-partage:hover {
  border-color: var(--bleu-600);
  color: var(--bleu-600);
}

/* Version texte (onglet bêta de la visionneuse) */
.onglet sup {
  font-size: 0.62rem;
  color: var(--ambre-600);
  font-weight: 750;
}

.onglet.actif sup {
  color: #fde68a;
}

.cadre-texte {
  background: #fff;
}

.maquette-texte {
  position: relative;
  padding: 2rem 2.2rem;
  height: 74vh;
  min-height: 480px;
  overflow: auto;
  box-sizing: border-box;
}

.maquette-texte h3 {
  font-size: 1.15rem;
  margin-bottom: 0.4rem;
}

.apercu-texte {
  margin-top: 1.2rem;
  border: 1px solid var(--bord);
  border-radius: var(--rayon-sm);
  padding: 1.4rem 1.6rem;
  max-width: 44rem;
}

.apercu-texte h4 {
  margin-bottom: 0.6rem;
}

.formule {
  font-family: 'Cambria Math', Georgia, serif;
  font-size: 1.12rem;
  text-align: center;
  background: var(--glacier-50);
  border-radius: var(--rayon-sm);
  padding: 0.7rem;
}

/* Livre d'or */
.messages-livredor {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.message-or {
  background: #fff;
  border: 1px solid var(--bord);
  border-left: 4px solid var(--ambre-500);
  border-radius: var(--rayon-sm);
  padding: 1rem 1.3rem;
  box-shadow: var(--ombre-carte);
}

.message-or .message-tete {
  font-size: 0.86rem;
  color: var(--gris-500);
  margin-bottom: 0.35rem;
}

.message-or p {
  margin: 0;
}

/* Livre d'or : pot de miel + modération */
.pot-de-miel {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.pastille-attente {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  margin-left: 0.4rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: var(--corail);
  color: #fff;
  font-size: 0.74rem;
  font-weight: 750;
}

.stat-carte.alerte {
  border-color: var(--corail);
  background: #fff5f3;
}

.stat-carte.alerte .valeur {
  color: var(--corail);
}

.messages-moderation {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.message-mod {
  background: #fff;
  border: 1px solid var(--bord);
  border-left: 4px solid var(--ambre-500);
  border-radius: var(--rayon-sm);
  padding: 1rem 1.3rem;
  box-shadow: var(--ombre-carte);
}

.message-mod .message-tete {
  font-size: 0.86rem;
  color: var(--gris-500);
  margin-bottom: 0.35rem;
}

.actions-mod {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-top: 0.8rem;
  flex-wrap: wrap;
}

/* Flashcards */
.zone-cartes {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.4rem;
  background: #fff;
  border: 1px solid var(--bord);
  border-radius: var(--rayon);
  box-shadow: var(--ombre-carte);
  padding: 2.6rem 1.5rem 2rem;
}

.flashcard {
  width: min(480px, 100%);
  height: 280px;
  perspective: 1200px;
  cursor: pointer;
}

.flashcard-int {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
}

.flashcard.retournee .flashcard-int {
  transform: rotateY(180deg);
}

.flashcard-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.8rem;
  text-align: center;
  padding: 1.6rem;
  border-radius: var(--rayon);
  font-size: 1.08rem;
}

.flashcard-face.recto {
  background: linear-gradient(150deg, var(--marine-900), var(--marine-800));
  color: #fff;
  box-shadow: 0 14px 34px rgba(12, 31, 56, 0.3);
}

.flashcard-face.verso {
  background: #fff;
  border: 2px solid var(--bleu-600);
  transform: rotateY(180deg);
}

.flashcard-etiquette {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #93c5fd;
}

.flashcard-indice {
  font-size: 0.8rem;
  color: #7fa4d4;
}

.flashcard-nav {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

/* Chatbot (maquette) */
.chatbot-bulle {
  position: fixed;
  right: 1.4rem;
  bottom: 1.4rem;
  z-index: 90;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 0;
  background: var(--bleu-600);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(12, 31, 56, 0.35);
  transition: var(--transition);
}

.chatbot-bulle:hover {
  transform: scale(1.07);
}

.chatbot-bulle.ouvert {
  background: var(--marine-900);
}

.chatbot-panneau[hidden] {
  display: none;
}

.chatbot-panneau {
  position: fixed;
  right: 1.4rem;
  bottom: 5.9rem;
  z-index: 90;
  width: min(360px, calc(100vw - 2rem));
  background: #fff;
  border: 1px solid var(--bord);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(4, 12, 26, 0.35);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.chatbot-tete {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  background: linear-gradient(150deg, var(--marine-950), var(--marine-800));
  color: #fff;
  padding: 0.9rem 1.1rem 1.2rem;
}

.chatbot-tete strong {
  display: block;
  font-family: var(--police-titres);
}

.chatbot-tete span {
  font-size: 0.78rem;
  color: #a9c6ec;
}

.chatbot-tete .ruban-maquette {
  position: absolute;
  right: 44px;
  top: 10px;
}

.chatbot-fermer {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: #a9c6ec;
  font-size: 1rem;
  cursor: pointer;
}

.chatbot-fil {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  max-height: 320px;
  overflow: auto;
  background: var(--glacier-50);
  font-size: 0.92rem;
}

.bulle-bot,
.bulle-eleve {
  max-width: 85%;
  padding: 0.6rem 0.9rem;
  border-radius: 14px;
  line-height: 1.5;
}

.bulle-bot {
  background: #fff;
  border: 1px solid var(--bord);
  border-bottom-left-radius: 4px;
  align-self: flex-start;
}

.bulle-eleve {
  background: var(--bleu-600);
  color: #fff;
  border-bottom-right-radius: 4px;
  align-self: flex-end;
}

.chatbot-saisie {
  display: flex;
  gap: 0.5rem;
  padding: 0.7rem;
  border-top: 1px solid var(--bord);
  background: #fff;
}

.chatbot-saisie input {
  flex: 1;
  border: 1px solid var(--gris-300);
  border-radius: 999px;
  padding: 0.5rem 1rem;
  font: inherit;
}

.chatbot-saisie button {
  border: 0;
  background: var(--bleu-600);
  color: #fff;
  width: 40px;
  border-radius: 50%;
  cursor: not-allowed;
  opacity: 0.55;
}

/* ==========================================================================
   Recherche
   ========================================================================== */

.barre-recherche {
  display: flex;
  max-width: 40rem;
  border: 1px solid var(--bord);
  border-radius: 999px;
  background: #fff;
  padding: 0.3rem;
  box-shadow: var(--ombre-carte);
  margin-bottom: 1.6rem;
}

.barre-recherche input {
  flex: 1;
  border: 0;
  outline: 0;
  font: inherit;
  padding: 0.5rem 1.05rem;
  background: transparent;
  min-width: 0;
}

.barre-recherche button {
  border: 0;
  background: var(--bleu-600);
  color: #fff;
  font: inherit;
  font-weight: 650;
  padding: 0.5rem 1.4rem;
  border-radius: 999px;
  cursor: pointer;
}

.resultat-compte {
  color: var(--gris-600);
  font-weight: 550;
}

/* ==========================================================================
   Bandeau association, en-têtes de page, pied
   ========================================================================== */

.bandeau-asso {
  background: linear-gradient(150deg, var(--marine-900), var(--marine-800));
  border-radius: calc(var(--rayon) + 6px);
  color: #fff;
  padding: 2.4rem 2.6rem;
  display: flex;
  align-items: center;
  gap: 2.4rem;
  overflow: hidden;
}

@media (max-width: 720px) {
  .bandeau-asso {
    flex-direction: column;
    text-align: center;
    padding: 2rem 1.4rem;
  }
}

.bandeau-asso h2 {
  font-size: 1.45rem;
  margin-bottom: 0.5rem;
}

.bandeau-asso p {
  color: #b7cdec;
  margin: 0 0 1.2rem;
  max-width: 38rem;
}

.bandeau-asso .bouton-plein {
  display: inline-block;
  background: var(--ambre-500);
  color: var(--marine-950);
  font-weight: 700;
  padding: 0.62rem 1.5rem;
  border-radius: 999px;
  text-decoration: none;
}

.bandeau-asso .bouton-plein:hover {
  background: var(--ambre-600);
}

.entete-page {
  background:
    radial-gradient(700px 300px at 85% -30%, rgba(59, 130, 246, 0.28), transparent 60%),
    linear-gradient(160deg, var(--marine-950), var(--marine-800));
  color: #fff;
  padding: 2.5rem 0 2.7rem;
}

.entete-page h1 {
  font-size: clamp(1.6rem, 3.4vw, 2.3rem);
  margin: 0.35rem 0 0.5rem;
}

.entete-page p {
  color: #b7cdec;
  margin: 0;
  max-width: 44rem;
}

.pied {
  background: var(--marine-950);
  color: #8aa3c4;
  margin-top: 3.6rem;
  padding: 3rem 0 2rem;
  font-size: 0.92rem;
}

.pied-grille {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 28px;
  padding-bottom: 1.6rem;
}

.pied-marque {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  margin-bottom: 12px;
}

.pied-marque .logo-nom {
  font-family: var(--police-titres);
  font-weight: 700;
  font-size: 1.15rem;
}

.pied-marque .logo-nom em {
  font-style: italic;
  font-weight: 800;
}

.pied h4 {
  color: #e2ecf9;
  font-size: 0.86rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.75rem;
}

.pied ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
}

.pied a {
  color: #b3c8e5;
  text-decoration: none;
}

.pied a:hover {
  color: #fff;
  text-decoration: underline;
}

.pied-bas {
  border-top: 1px solid #16294a;
  padding-top: 1.2rem;
  font-size: 0.8rem;
  color: #5f7aa3;
  text-align: center;
}

/* ==========================================================================
   Administration
   ========================================================================== */

.admin-corps {
  background: var(--glacier-50);
}

.admin-cadre {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

@media (max-width: 820px) {
  .admin-cadre {
    grid-template-columns: 1fr;
  }
}

.admin-menu {
  background: var(--marine-950);
  color: #b3c8e5;
  padding: 1.4rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
}

.admin-menu .logo {
  color: #fff;
  font-size: 1.2rem;
}

.admin-menu nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.admin-menu nav a {
  color: #b3c8e5;
  text-decoration: none;
  padding: 0.55rem 0.85rem;
  border-radius: 8px;
  font-weight: 550;
  transition: var(--transition);
}

.admin-menu nav a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.admin-menu nav a[aria-current='page'] {
  background: var(--bleu-600);
  color: #fff;
}

.admin-profil {
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 1rem;
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.admin-contenu {
  padding: 2.2rem 2.4rem 3rem;
  max-width: 1100px;
}

.admin-contenu h1 {
  font-size: 1.7rem;
  margin-bottom: 1.4rem;
}

.admin-contenu h2 {
  font-size: 1.2rem;
  margin: 2.2rem 0 0.9rem;
}

.admin-entete-page {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.2rem;
}

.admin-entete-page h1 {
  margin: 0;
}

.compte-total {
  color: var(--gris-500);
  font-weight: 500;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.6rem;
}

.stat-carte {
  background: #fff;
  border: 1px solid var(--bord);
  border-radius: var(--rayon);
  padding: 1.1rem 1.3rem;
  box-shadow: var(--ombre-carte);
}

.stat-carte .valeur {
  font-family: var(--police-titres);
  font-size: 1.9rem;
  font-weight: 750;
  color: var(--marine-900);
}

.stat-carte .libelle {
  color: var(--gris-500);
  font-size: 0.88rem;
}

.admin-actions {
  margin: 0 0 1.4rem;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid var(--bord);
  border-radius: var(--rayon);
  overflow: hidden;
  box-shadow: var(--ombre-carte);
  font-size: 0.93rem;
}

.admin-table th {
  text-align: left;
  font-family: var(--police-titres);
  font-weight: 650;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gris-500);
  background: var(--glacier-100);
  padding: 0.7rem 0.9rem;
}

.admin-table td {
  padding: 0.65rem 0.9rem;
  border-top: 1px solid var(--bord);
  vertical-align: middle;
}

.cellule-themas {
  color: var(--gris-500);
  font-size: 0.85rem;
  max-width: 260px;
}

.cellule-actions {
  white-space: nowrap;
}

.cellule-actions form {
  display: inline;
  margin-left: 0.6rem;
}

/* ---------- Formulaires ---------- */

.formulaire label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-weight: 550;
  font-size: 0.92rem;
}

.formulaire input,
.formulaire select,
.formulaire textarea {
  font: inherit;
  font-weight: 400;
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--gris-300);
  border-radius: var(--rayon-sm);
  background: #fff;
  color: var(--encre);
}

.formulaire input:focus,
.formulaire select:focus,
.formulaire textarea:focus {
  outline: 2px solid var(--bleu-500);
  outline-offset: 0;
  border-color: var(--bleu-500);
}

.formulaire textarea {
  width: 100%;
  resize: vertical;
  font-family: ui-monospace, 'Cascadia Code', Consolas, monospace;
  font-size: 0.9rem;
}

.formulaire-ligne {
  display: flex;
  align-items: end;
  gap: 1rem;
  flex-wrap: wrap;
  background: #fff;
  border: 1px solid var(--bord);
  border-radius: var(--rayon);
  padding: 1.2rem 1.4rem;
  box-shadow: var(--ombre-carte);
}

.formulaire-annale fieldset {
  border: 1px solid var(--bord);
  border-radius: var(--rayon);
  background: #fff;
  box-shadow: var(--ombre-carte);
  padding: 1.3rem 1.5rem 1.5rem;
  margin: 0 0 1.4rem;
}

.formulaire-annale legend {
  font-family: var(--police-titres);
  font-weight: 650;
  padding: 0 0.5rem;
  color: var(--marine-800);
}

.grille-champs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 1rem;
}

.pleine-largeur {
  grid-column: 1 / -1;
  margin-bottom: 1rem;
}

.groupe-cases {
  margin-bottom: 1.1rem;
}

.groupe-cases .etiquette {
  display: block;
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 0.5rem;
}

.case {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 0.45rem !important;
  font-weight: 450 !important;
  margin: 0.15rem 1.1rem 0.15rem 0;
}

.case input {
  accent-color: var(--bleu-600);
  width: 1.05rem;
  height: 1.05rem;
}

.cases-compactes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.1rem 0.8rem;
}

.barre-validation {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  flex-wrap: wrap;
  background: #fff;
  border: 1px solid var(--bord);
  border-radius: var(--rayon);
  box-shadow: var(--ombre-carte);
  padding: 1rem 1.4rem;
  position: sticky;
  bottom: 1rem;
}

.note {
  font-size: 0.82rem;
  color: var(--gris-500);
  font-weight: 400;
}

.bouton-primaire {
  display: inline-block;
  border: 0;
  background: var(--bleu-600);
  color: #fff;
  font: inherit;
  font-weight: 650;
  padding: 0.6rem 1.4rem;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
}

.bouton-primaire:hover {
  background: var(--bleu-500);
}

.bouton-secondaire {
  display: inline-block;
  border: 1px solid var(--gris-300);
  background: #fff;
  color: var(--encre);
  font: inherit;
  font-weight: 600;
  padding: 0.55rem 1.3rem;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
}

.lien-bouton {
  border: 0;
  background: none;
  color: var(--bleu-600);
  font: inherit;
  font-weight: 550;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

.lien-bouton.danger {
  color: var(--corail);
}

/* ---------- Page de connexion ---------- */

.connexion-fond {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(800px 400px at 80% -10%, rgba(59, 130, 246, 0.3), transparent 60%),
    linear-gradient(160deg, var(--marine-950), var(--marine-800));
  margin: 0;
  padding: 2rem 1rem;
}

.carte-connexion {
  background: #fff;
  border-radius: calc(var(--rayon) + 6px);
  box-shadow: 0 24px 60px rgba(4, 12, 26, 0.4);
  padding: 2.4rem 2.6rem;
  text-align: center;
  width: min(400px, 100%);
}

.carte-connexion h1 {
  font-size: 1.45rem;
  margin-top: 0.6rem;
}

.carte-connexion > p {
  color: var(--gris-500);
  margin: 0.2rem 0 1.4rem;
}

.carte-connexion .formulaire {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  text-align: left;
}

.carte-connexion .flash {
  margin: 0 0 1rem;
}
