/* =========================================================
   main.css (global)
   Dépend de /css/theme.css pour toutes les couleurs
   Garde tes classes existantes : navbar, burger, footer, etc.
   ========================================================= */

/* =========================================================
   main.css (global)
   Dépend de /css/theme.css pour toutes les couleurs
   Garde tes classes existantes : navbar, burger, footer, etc.
   ========================================================= */

/* Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border: 0;
}

textarea { resize: none; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 50px; /* Décale le scroll de la hauteur de ta navbar + un peu de marge */
}

body {
  font-family: Montserrat, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  /* le background est appliqué globalement dans theme.css */
  
  /* Force le footer en bas de page */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Le contenu principal s'étire pour prendre toute la place disponible */
main {
  flex: 1;
}

.small-caps {
    font-variant-caps: small-caps;
}

.small-caps {
    font-variant: small-caps;
}

/* Container page (si tu l’utilises) */
.container-page{
  margin: 0 auto;
  padding: 0 0 60px;
}

/* =========================================================
   Navbar
   ========================================================= */
.navbar {
  position: sticky;
  top: 0;
  width: 100%;
  z-index: 1000;

  padding: 18px 20px;
  font-size: 18px;

  background: color-mix(in srgb, var(--ink-1) 80%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-1);
  transition: padding 220ms ease, background 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}



@media (min-width: 768px) and (max-width: 1024px) {
  .navbar { padding: 16px 18px; }
}

.navbar-container {
  max-width: 1350px;
  margin: 0 auto;

  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}

/* Logo */
.navbar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.logo-img {
  height: 110px; /* <-- Augmente cette valeur */
  width: auto;
  display: block;
  filter: brightness(1.06) drop-shadow(0 0 4px rgba(90, 176, 255, 0.18));
  transform-origin: left center;
  transition: transform 220ms ease, filter 220ms ease, height 220ms ease;
}


.navbar-logo:hover .logo-img,
.navbar-logo:focus-visible .logo-img {
  transform: translateY(-1px) scale(1.035);
  filter: brightness(1.22) drop-shadow(0 0 10px rgba(90, 176, 255, 0.48));
}

/* Burger (desktop hidden) */
/* Burger (desktop hidden) */
.burger{
  display: none;
  width: 26px;
  height: 26px;
  cursor: pointer;
  border: none;
  background: transparent;
  align-items: center;
  position: relative;
}

.burger span{
  display: block;
  width: 100%;
  height: 2px;
  background: color-mix(in srgb, var(--text) 75%, transparent);
  position: absolute;
  pointer-events: none;
  transition: opacity 0.3s 0.15s ease-out, transform 0.3s ease-out;
}

.burger span:nth-child(1) { transform: translateY(7px); }
.burger span:nth-child(3) { transform: translateY(-7px); }

.burger.open span:nth-child(1) { transform: rotate(135deg); }
.burger.open span:nth-child(2) { opacity: 0; }
.burger.open span:nth-child(3) { transform: rotate(-135deg); }

/* Links */
.navbar-links {
  display: flex;
  list-style: none;
  gap: 18px;
}

.navbar-links a {
  font-size: 0.98rem;
  font-weight: 560;
  text-decoration: none;
  color: var(--muted);
  display: inline-block;
  position: relative;
  padding: 10px 10px;
  border-radius: 10px;
  transition: background 180ms ease, color 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
  white-space: nowrap;
}

.navbar-links a:hover{
  background: var(--surface-2);
  color: var(--text);
}

/* underline animation (plus discret) */
.navbar-links a::after {
  content: "";
  display: block;
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 6px;
  height: 1.5px;
  transform: scaleX(0);
  transform-origin: left;
  background: color-mix(in srgb, var(--text) 70%, transparent);
  transition: transform 0.25s ease-out;
  border-radius: 2px;
}

.navbar-links a:hover::after { transform: scaleX(1); }

.navbar-links a[aria-current="page"],
.navbar-links a.is-active {
  color: var(--text);
  background: color-mix(in srgb, #5AB0FF 13%, var(--surface-2));
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, #5AB0FF 28%, transparent),
    0 0 16px rgba(90, 176, 255, 0.12);
}

.navbar-links a[aria-current="page"]::after,
.navbar-links a.is-active::after {
  transform: scaleX(1);
  background: #5AB0FF;
  box-shadow: 0 0 8px rgba(90, 176, 255, 0.55);
}


/* =========================================================
   Bouton Espace / Connexion dans la Navbar
   ========================================================= */
#navAccountLink {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px !important;
  border-radius: 12px;
  background: color-mix(in srgb, #5AB0FF 8%, transparent);
  border: 1px solid color-mix(in srgb, #5AB0FF 20%, transparent);
  color: var(--text);
  transition: all 0.2s ease;
}

#navAccountLink:hover {
  background: color-mix(in srgb, #5AB0FF 15%, transparent);
  border-color: color-mix(in srgb, #5AB0FF 35%, transparent);
  color: var(--text);
  box-shadow: 0 0 12px rgba(90, 176, 255, 0.1);
}

/* Enlève la petite barre de survol classique de la navbar pour ce bouton spécifique */
#navAccountLink::after {
  display: none !important;
}

/* 
 * ASTUCE : Si votre JavaScript affiche l'avatar (display: block ou inline),
 * le CSS cache automatiquement l'icône de connexion pour éviter les doublons.
 */
#navAccountLink:has(#navAvatarIcon[style*="block"]) #navLoginIcon,
#navAccountLink:has(#navAvatarIcon[style*="inline"]) #navLoginIcon {
  display: none !important;
}

/* =========================================================
   Mobile nav (keeps your JS hooks: .open, .shadowingNav.active)
   ========================================================= */
@media (max-width: 767px) {

  .navbar-container{
    align-items: flex-start;
    gap: 16px;
  }

  .burger{ display: flex; }

  .logo-img{
      height: 56px !important;
      width: auto !important;
  }

  .navbar.is-scrolled .logo-img{ height: 56px; }

  .navbar-links{
    display: flex;
    flex-direction: column;
    align-items: flex-start;

    position: absolute;
    top: 100%;
    left: 0;

    height: 100vh;
    padding: 14px 48px 14px 18px;

    background: color-mix(in srgb, var(--ink-1) 92%, transparent);
    border-right: 1px solid var(--border-1);

    transform: translateX(-100%);
    transition: transform 0.28s ease-out;
    z-index: 5;
  }

  .navbar-links.open{
    transform: translateX(0);
  }

  .navbar-links a{
    width: 100%;
    padding: 10px 8px;
    margin: 2px 0;
  }

  /* Overlay */
  .shadowingNav{
    position: absolute;
    top: 64px; /* hauteur navbar */
    left: 0;
    width: 100%;
    height: calc(100vh - 64px);

    background: rgba(0,0,0,0.35);
    opacity: 0;
    transform: translateX(-100%);
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 1;
  }

  .shadowingNav.active{
    opacity: 1;
    transform: translateX(0);
  }
}

/* =========================================================
   Footer (Cours Kerel - 3 colonnes)
   ========================================================= */
.site-footer {
  padding: 60px 20px 30px;
  background: var(--bg-1);
  border-top: 1px solid var(--border-1);
  margin-top: auto;
  text-align: left; /* Annule le centrage par défaut qui cassait la grille */
}

.footer-container {
  max-width: 1100px;
  margin: 0 auto;
}
.footer-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1.4fr) repeat(3, minmax(150px, 1fr));
  gap: 32px;
  margin-bottom: 40px;
  align-items: start;
}

.footer-grid > :nth-child(2),
.footer-grid > :last-child {
  justify-self: start;
}


.footer-logo-text {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 15px;
  /* Couleur violette appliquée à l'ensemble du texte */
  color: rgba(var(--accent), 0.95); 
  /* Optionnel : un léger halo pour faire ressortir le nom sur le fond sombre */
  text-shadow: 0 0 20px rgba(var(--accent), 0.25);
}

.footer-logo-text span {
  /* On annule la couleur spécifique du span pour qu'il soit identique au reste */
  color: inherit; 
}

.footer-description {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
  max-width: 300px;
}

.footer-col-title {
  display: block;
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 20px;
  color: var(--text);
}

/* --- Style et couleur des liens (Correction lisibilité) --- */
.footer-nav-col .no-bullets {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-nav-col li { 
  margin-bottom: 12px; 
}

.footer-nav-col a {
  text-decoration: none;
  color: var(--muted); /* Ce gris clair résout le problème du bleu foncé illisible */
  font-size: 0.95rem;
  transition: color 0.2s ease;
}

.footer-nav-col a:hover { 
  color: var(--text); /* Devient blanc pur au survol */
}

/* --- Contact & Liens spécifiques --- */
.footer-nav-col .contact-item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.footer-nav-col .contact-item svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.highlight-link {
  color: color-mix(in srgb, rgba(var(--accent), 0.95) 70%, var(--text)) !important;
  font-weight: 600;
}

.highlight-link:hover {
  text-decoration: underline;
}

/* --- Bas du footer (Mentions légales, etc.) --- */
.footer-separator {
  border: 0;
  border-top: 1px solid var(--border-1);
  margin-bottom: 25px;
  opacity: 0.5;
}

.footer-bottom {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  overflow-wrap: anywhere;
}

.meta-info {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 10px;
  line-height: 1.8;
}

.meta-info a {
  color: var(--muted);
  text-decoration: none;
  margin: 0;
}


.meta-info a:hover {
  color: var(--text);
  text-decoration: underline;
}

/* --- NOUVEAUTÉS CI-DESSOUS --- */

/* Ajout du bullet avant chaque lien */
.meta-info a::before {
  content: "•";
  margin-right: 10px; /* Aligné symétriquement avec le gap de 10px */
  opacity: 0.5;
  display: inline-block;
  pointer-events: none; /* Le bullet n'est pas cliquable */
}

/* Empêche le bullet d'être souligné et de changer de couleur au survol */
.meta-info a:hover::before {
  text-decoration: none;
  color: var(--muted); 
}

/* Gestion mobile : affichage en colonne propre sans bullets */
@media (max-width: 500px) {
  .meta-info {
    flex-direction: column;
    gap: 8px; /* Un peu plus d'espace en hauteur pour faciliter le clic */
  }
  
  .meta-info a::before {
    display: none; /* On cache les bullets sur petit écran */
  }
}

/* --- Responsive pour les téléphones (1 seule colonne) --- */
@media (max-width: 768px) {
  .footer-grid { 
    grid-template-columns: 1fr; 
    text-align: center; 
    gap: 30px;
  }
  
  /* Sur mobile, on recentre tous les blocs */
  .footer-grid > :nth-child(2),
  .footer-grid > :last-child {
    justify-self: center;
  }
  
  .footer-description { 
    margin: 0 auto; 
  }
  .footer-nav-col .contact-item {
    justify-content: center;
  }
}

@media (max-width: 900px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 600px) {
  .footer-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .footer-grid > * {
    justify-self: center;
  }

  .footer-description {
    margin: 0 auto;
  }

  .footer-nav-col .contact-item {
    justify-content: center;
  }
}
/* ====== pour scroll décalé ===========================*/
/*html{
  scroll-padding-top: 45px;
}*/

@media (max-width: 768px) {
  #navUserIdentity {
    padding: 10px 15px;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: 5px;
    justify-content: flex-start;
  }
}

/* Style des liens dans les pages légales (Mentions, CGV) */
.cgv-card article a {
  color: #5AB0FF; /* Utilise le bleu d'accentuation de votre site */
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px solid transparent;
  transition: all 0.2s ease;
}

.cgv-card article a:hover {
  color: var(--text); /* Devient blanc pur au survol */
  border-bottom-color: #5AB0FF; /* Ajoute un soulignement discret au survol */
  text-shadow: 0 0 8px rgba(90, 176, 255, 0.4); /* Léger effet de lueur */
}

/* =========================================================
   ERREURS GLOBALES (Factorisation pour tous les formulaires)
   ========================================================= */
:root {
  --danger-base: rgba(180, 35, 24, 0.95);
  /* La couleur mixée parfaite pour une lisibilité optimale sur fond sombre */
  --text-danger: color-mix(in srgb, var(--danger-base) 60%, var(--text));
}

/* Boîtes d'erreur (Réservation, Copies, Forfaits, Stripe) */
.cp-error, .cc-error {
  text-align: left;
  border-radius: 12px;
  padding: 12px 14px;
  margin: 16px 0 14px 0 !important; /* Gère l'espacement avec le calendrier/champs */
  border: 1px solid rgba(180, 35, 24, 0.22) !important;
  background: rgba(180, 35, 24, 0.10) !important;
  color: var(--text-danger) !important;
}

/* Force la couleur sur le texte à l'intérieur (titres, listes) */
.cp-error *, .cc-error * {
  color: var(--text-danger) !important;
}

/* Gère automatiquement l'indentation de 18px et enlève les puces */
.cp-error ul, .cc-error ul {
  list-style: none !important;
  padding: 0 !important;
  margin: 8px 0 0 18px !important; 
}

/* Champs Invalides (Stripe & Formulaires standards) */
.cp-field-invalid, 
.cc-field-invalid,
.dt-input.StripeElement--invalid {
  border-color: rgba(180, 35, 24, 0.55) !important;
  box-shadow: 0 0 0 4px rgba(180, 35, 24, 0.12) !important;
  background: rgba(180, 35, 24, 0.03) !important;
}

/* Les petits messages d'erreur sous les champs individuels */
.cp-field-msg.is-error, 
.cc-field-msg.is-error {
  color: var(--text-danger) !important;
  font-weight: 650;
}


/* =========================================================
   Cartes Jolies (Accès Libre)
   ========================================================= */
.grille-cartes-jolies {
    padding: 20px 0; 
    position: relative;
    width: 100%;
    display: grid;
    grid-gap: 40px;
    grid-template-columns: repeat(auto-fit, 250px);
    justify-content: center; 
}

.carte-jolie {
    position: relative; 
    height: 250px;
    width: 250px;
    display: block;
    text-decoration: none;
}

/* Le reste de ton CSS (.carte-jolie-bg, .carte-jolie-content, hover...) reste identique ! */

.carte-jolie-bg {
    background-size: cover;
    background-position: center;
    position: absolute;
    left: 0; top: 0; right: 0; bottom: 0;
    border-radius: 20px;
    filter: brightness(.75) saturate(1.2) contrast(0.85);
    transition: .3s;
}

.carte-jolie-content {
    position: absolute;
    padding: 24px;
    font-family: arial, sans-serif;
    color: white;
    transition: .3s;
    filter: brightness(.9);
}

.carte-jolie-content h3 {
    line-height: 1.5;
    padding: 15px 10px;
    font-size: 20px;
    color: rgba(255, 255, 255, .9);
    text-shadow: 2px 2px 20px rgba(0,0,0,.2);
    margin: 0;
}

.carte-jolie:hover .carte-jolie-bg,
.carte-jolie:hover .carte-jolie-content {
    transform: scale(1.05); 
}

/* L'effet de flou sur les autres cartes au survol */
.grille-cartes-jolies:hover > .carte-jolie:not(:hover) > .carte-jolie-bg {
    filter: brightness(.5) saturate(0) contrast(1.2) blur(8px);
}

/* --- Adaptation Mobile --- */
@media (max-width: 900px) {
    .grille-cartes-jolies {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        grid-gap: 20px;
    }
    .carte-jolie { width: 200px; height: 200px; }
    .carte-jolie-content { padding: 20px; }
    .carte-jolie-content h3 { padding: 10px 5px; font-size: 17px; }
}

@media (max-width: 540px) {
    .grille-cartes-jolies {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        grid-gap: 10px;
    }
    .carte-jolie { width: 160px; height: 160px; }
    .carte-jolie-content { padding: 16px; }
    .carte-jolie-content h3 { padding: 4px 2px; font-size: 14px; }
}

/* =========================================================
   Cartes Chapitres Horizontales (Mix : Sombre repos / Gris ardoise étendu au survol)
   ========================================================= */
.grille-chapitres-liste {
  max-width: 950px; 
  margin: 0 auto;
  display: grid;
  gap: 30px;
  padding: 20px 15px;
}

.carte-horizontale {
    display: grid;
    grid-template-columns: 220px 1fr 340px;
  background: #2a2d35; /* Fond sombre au repos */
  border: 1px solid #3f4450;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.2);
  overflow: hidden;
  transition: all 0.6s ease;
  color: #fff; 
}

/* LE MIX AJUSTÉ : Gris "moins clair" (ardoise), texte foncé, et extension */
.carte-horizontale:hover {
  background: #a9b2c3; /* Un beau gris moyen/clair, beaucoup moins éblouissant */
  color: #1a1d24; /* Texte très foncé pour un contraste net */
  border-color: #8d98a9;
  box-shadow: -10px 20px 40px rgba(0,0,0,0.35);
  transform: scale(1.03) translateY(-4px); /* L'effet 3D */
  z-index: 1;
}

.ch-image {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 160px;
  background-size: cover;
  background-position: center;
  border-right: 1px solid #3f4450;
  filter: brightness(0.85);
  transition: all 0.6s ease;
}

.carte-horizontale:hover .ch-image {
  filter: brightness(0.95);
  border-right-color: #8d98a9; 
}

.ch-content {
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.ch-numero {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6ab0ff; 
  font-weight: 700;
  margin-bottom: 8px;
  transition: color 0.6s ease;
}

.carte-horizontale:hover .ch-numero {
  color: #0a4f77; /* Bleu plus sombre sur le fond gris */
}

.ch-titre {
  font-size: 1.25rem;
  font-weight: 750;
  color: inherit;
  margin-bottom: 6px;
  line-height: 1.3;
}

.ch-desc {
  color: #a0a6b5;
  font-size: 0.95rem;
  line-height: 1.5;
  transition: color 0.6s ease;
}

.carte-horizontale:hover .ch-desc {
  color: #3b4252; /* Gris foncé bien lisible */
}

/* La zone des boutons (Tiroir) */
.ch-actions {
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  background: rgba(0, 0, 0, 0.15); 
  border-left: 1px solid #3f4450;
  
  opacity: 0;
  transform: translateX(15px);
  transition: all 0.6s ease;
}

.carte-horizontale:hover .ch-actions {
  opacity: 1;
  transform: translateX(0);
  background: rgba(0, 0, 0, 0.06); /* Assombrit légèrement la zone des boutons sur le fond gris */
  border-left-color: #8d98a9;
}

/* === L'ASTUCE DES BOUTONS SOMBRES === */
/* On force tous les boutons à adopter le style "primary" sombre de Cours Kerel */
.carte-horizontale:hover .ch-actions .btn {
  background: #0e71a6 !important; 
  color: #ffffff !important;
  border: none;
  font-weight: 600;
  transition: background 0.2s ease;
  border-radius: 6px !important; /* Remplace l'arrondi extrême par un léger adoucissement */
}


.carte-horizontale:hover .ch-actions .btn:hover {
  background: #094a6d !important; /* Devient encore plus sombre au survol du bouton */
}


/* =========================================================
   Carte Spéciale TP (Largeur totale et Grille interne)
   ========================================================= */
/* On passe à 2 colonnes : l'image à gauche, et tout le reste à droite */
.carte-tp {
  grid-template-columns: 220px 1fr !important; 
}

.ch-tp-container {
  padding: 24px;
  display: flex;
  flex-direction: column;
}

.ch-tp-header {
  margin-bottom: 24px;
  padding-bottom: 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: border-color 0.6s ease;
}

.carte-horizontale:hover .ch-tp-header {
  border-bottom-color: rgba(0,0,0,0.1); /* S'assombrit au survol de la carte */
}

/* Grille adaptative pour placer les 12 TP */
.grille-tps {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); /* Crée 2, 3 ou 4 colonnes automatiquement */
  gap: 15px;
}

.tp-tuile {
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.6s ease;
}

.carte-horizontale:hover .tp-tuile {
  background: rgba(0, 0, 0, 0.06); /* S'éclaircit légèrement sur le fond ardoise */
  border-color: rgba(0, 0, 0, 0.1);
}

.tp-tuile-titre {
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 12px;
  line-height: 1.3;
}

.tp-tuile-actions {
  display: flex;
  gap: 8px;
}

/* Style forcé des boutons de la carte TP (similaire au tiroir de droite) */
.carte-tp .btn {
  flex: 1;
  padding: 6px 0;
  font-size: 0.75rem;
  background: #0e71a6 !important; 
  color: #ffffff !important;
  border: none;
  font-weight: 600;
  border-radius: 6px !important;
  transition: background 0.2s ease;
}

.carte-tp .btn:hover { background: #094a6d !important; }

.carte-tp .btn:disabled {
  background: #7a8496 !important;
  color: rgba(255, 255, 255, 0.85) !important;
  cursor: not-allowed;
}

.carte-tp .btn-reserve {
  display: flex !important;
  flex-direction: column !important;
  align-items: center;
  justify-content: center;
  padding: 4px 0 !important;
}
.carte-tp .acces-reserve { font-size: 0.55rem; }

/* Adaptation sur Mobile */
@media (max-width: 768px) {
  .carte-tp { grid-template-columns: 1fr !important; }
  .grille-tps { grid-template-columns: 1fr; } /* 1 seule colonne de TP sur téléphone */
}


/* === Adaptation Mobile === */
@media (max-width: 768px) {
  .carte-horizontale {
    grid-template-columns: 1fr;
    grid-template-rows: 140px auto auto;
    /* On force l'état gris moyen sur mobile */
    background: #a9b2c3;
    color: #1a1d24;
  }
  .ch-image { 
    border-right: none; 
    border-bottom: 1px solid #8d98a9; 
    filter: brightness(0.95);
  }
  .ch-numero { color: #0a4f77; }
  .ch-desc { color: #3b4252; }
  
  .ch-actions {
    border-left: none;
    border-top: 1px solid #8d98a9;
    background: rgba(0, 0, 0, 0.06);
    opacity: 1;
    transform: none; 
    flex-direction: row;
    flex-wrap: wrap;
  }
  
  /* Sur mobile, on applique aussi le style sombre aux boutons */
  .ch-actions .btn {
    background: #0e71a6 !important; 
    color: #ffffff !important;
    border: none;
  }
}

/* =========================================================
   Lien de retour discret (Fil d'Ariane)
   ========================================================= */
.lien-retour-discret {
  display: inline-flex;
  align-items: center;
  color: #a0a6b5; /* Un gris-bleu très doux et effacé au repos */
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 25px; /* Espace avec les cartes en dessous */
  transition: all 0.3s ease;
}

.lien-retour-discret:hover {
  color: #ffffff; /* S'illumine en blanc pur au survol */
  transform: translateX(-5px); /* Glisse très légèrement vers la gauche pour accentuer l'idée de "retour" */
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.3); /* Léger halo lumineux */
}


/* =========================================================
   Boutons Verrouillés (Accès Réservé)
   ========================================================= */
/* Transforme le bouton en conteneur flexible vertical */
.btn-reserve {
  display: flex !important;
  flex-direction: column !important;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
  padding: 6px 10px !important; /* Ajustement du padding pour la double ligne */
}

/* Le style du petit texte */
.acces-reserve {
  font-size: 0.6rem;
  font-weight: 400;
  text-transform: lowercase;
  opacity: 0.8;
  margin-top: 2px;
}

/* Le style du bouton désactivé (Gris élégant) */
.carte-horizontale:hover .ch-actions .btn:disabled {
  background: #7a8496 !important; /* Un gris moyen qui s'accorde avec le fond */
  color: rgba(255, 255, 255, 0.85) !important;
  cursor: not-allowed;
  transform: none !important; /* Pas d'effet d'enfoncement au clic */
}


/* =========================================================
   En-tête flexible et Bascule de Filières (Accueil)
   ========================================================= */
.section-head-flex {
  display: grid;
  grid-template-columns: 1fr auto 1fr; /* Crée 3 colonnes pour un équilibre parfait */
  align-items: center;
  margin-bottom: 32px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05); /* Ligne discrète */
  padding-bottom: 15px;
}

.section-head-flex h2 {
  grid-column: 2; /* Place le titre au centre absolu de la grille */
  text-align: center;
  margin: 0;
}

.selecteur-classe-container {
  grid-column: 3; /* Place la bascule dans la colonne de droite */
  justify-self: end; /* Ferre la bascule tout à droite */
  display: flex;
  align-items: center;
  gap: 15px;
}

.sf-label {
  color: #a0a6b5;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.selecteur-classe {
  display: inline-flex;
  background: #2a2d35;
  border-radius: 8px;
  padding: 5px;
  border: 1px solid #3f4450;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

.sf-btn {
  background: transparent;
  color: #a0a6b5;
  border: none;
  padding: 8px 18px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.sf-btn:hover { color: #ffffff; }

.sf-btn.active {
  background: #0e71a6;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

/* Adaptation sur écrans moyens et Mobile : on empile le titre et la bascule */
@media (max-width: 900px) {
  .section-head-flex {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 18px;
    border-bottom: none;
  }
}


/* =========================================================
   Carte Spéciale TP (Largeur totale et Grille interne)
   ========================================================= */
/* On passe à 2 colonnes : l'image à gauche, et tout le reste à droite */
.carte-tp {
  grid-template-columns: 220px 1fr !important; 
}

.ch-tp-container {
  padding: 24px;
  display: flex;
  flex-direction: column;
}

.ch-tp-header {
  margin-bottom: 24px;
  padding-bottom: 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: border-color 0.6s ease;
}

.carte-horizontale:hover .ch-tp-header {
  border-bottom-color: rgba(0,0,0,0.1); /* S'assombrit au survol de la carte */
}

/* Grille adaptative pour placer les 12 TP */
.grille-tps {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); /* Crée 2, 3 ou 4 colonnes automatiquement */
  gap: 15px;
}

.tp-tuile {
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.6s ease;
}

.carte-horizontale:hover .tp-tuile {
  background: rgba(0, 0, 0, 0.06); /* S'éclaircit légèrement sur le fond ardoise */
  border-color: rgba(0, 0, 0, 0.1);
}

.tp-tuile-titre {
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 12px;
  line-height: 1.3;
}

.tp-tuile-actions {
  display: flex;
  gap: 8px;
}

/* Style forcé des boutons de la carte TP (similaire au tiroir de droite) */
.carte-tp .btn {
  flex: 1;
  padding: 6px 0;
  font-size: 0.75rem;
  background: #0e71a6 !important; 
  color: #ffffff !important;
  border: none;
  font-weight: 600;
  border-radius: 6px !important;
  transition: background 0.2s ease;
}

.carte-tp .btn:hover { background: #094a6d !important; }

.carte-tp .btn:disabled {
  background: #7a8496 !important;
  color: rgba(255, 255, 255, 0.85) !important;
  cursor: not-allowed;
}

.carte-tp .btn-reserve {
  display: flex !important;
  flex-direction: column !important;
  align-items: center;
  justify-content: center;
  padding: 4px 0 !important;
}
.carte-tp .acces-reserve { font-size: 0.55rem; }

/* Adaptation sur Mobile */
@media (max-width: 768px) {
  .carte-tp { grid-template-columns: 1fr !important; }
  .grille-tps { grid-template-columns: 1fr; } /* 1 seule colonne de TP sur téléphone */
}

/* =========================================================
   Grilles des boutons de TD (Cartes Chapitres)
   ========================================================= */
.btn-cours-seul {
  width: 100%;
  margin-bottom: 5px;
}

/* Nouvelles rangées Flexbox pour les TD */
.td-row-1, .td-row-2 {
  display: flex;
  gap: 10px;
  width: 100%;
}

.td-row-1 {
  margin-bottom: 10px;
}

/* Force les boutons à se répartir l'espace équitablement */
.td-row-1 > button, .td-row-2 > button {
  flex: 1;
  min-width: 0; /* Empêche le débordement si le texte est long */
}

/* Ajustement de la taille du texte pour que les 3 boutons rentrent bien (Aide/Rep/Cor) */
.td-row-2 > button {
  padding-left: 2px !important;
  padding-right: 2px !important;
  font-size: 0.85rem !important;
}


/* =========================================================
   REFONTE INTERFACE D'ÉVALUATION DES COLLES
   ========================================================= */

/* Disposition des élèves en 3 colonnes (Corrigée pour éviter le rognage) */
.eleves-grid-3 {
    display: grid;
    /* L'astuce magique : minmax(0, 1fr) autorise la colonne à rétrécir sans forcer le débordement */
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 15px;
    align-items: start;
    width: 100%;
}

/* On réduit très légèrement l'espacement interne des cartes pour les faire respirer 
.eleves-grid-3 .eleve-eval-bloc {
    padding: 20px;
}*/

/* On restaure la taille normale des boutons puisque le menu est masqué */
.eleves-grid-3 .carteItemNiveau {
    width: 38px;
    height: 38px;
    font-size: 1.1rem;
}

/* Sécurité : si l'écran est vraiment trop petit (ex: tablette), 
   on laisse la grille passer à 2 colonnes ou 1 colonne dynamiquement */
@media (max-width: 1150px) {
    .eleves-grid-3 {
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    }
}

/* Boutons de questions (Banque) */
.btn-q-drag {
    display: inline-block;
    padding: 6px 12px;
    background: var(--surface-2);
    border: 1px solid var(--border-3);
    border-radius: 6px;
    cursor: grab;
    margin: 4px;
    font-weight: 700;
    color: var(--accent);
    transition: all 0.2s;
    user-select: none;
}
.btn-q-drag:hover { border-color: var(--accent); background: var(--surface-3); }
.btn-q-drag:active { cursor: grabbing; }

/* Afficheur du texte complet de la question */
.q-viewer-box {
    margin-top: 15px;
    padding: 15px;
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    border-left: 4px solid var(--accent);
    border-radius: 6px;
    display: none;
    font-size: 0.95rem;
}

/* Zone de dépôt sur la carte de l'élève */
.q-dropzone {
    min-height: 44px;
    border: 1px dashed var(--border-3);
    border-radius: 6px;
    padding: 6px;
    margin-top: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-size: 0.85rem;
    transition: all 0.2s;
    background: var(--surface-1);
}
.q-dropzone.drag-over {
    background: color-mix(in srgb, var(--accent) 15%, transparent);
    border-color: var(--accent);
}
.q-dropzone .btn-q-drag { margin: 0; cursor: default; width: 100%; text-align: center; }


/* Curseur et style pour intervertir les cartes élèves */
.eleve-eval-bloc {
    cursor: grab;
    transition: transform 0.2s;
}
.eleve-eval-bloc.is-dragging {
    /* Transforme la carte en un simple "trou" en pointillé dans la grille */
    background: transparent !important;
    border: 2px dashed var(--border-3) !important;
    transform: none;
}
.eleve-eval-bloc.is-dragging > * {
    /* Rend tout le contenu de la carte invisible pendant le déplacement */
    opacity: 0;
}

/* MODE PLEIN ÉCRAN */
.colle-eval-container.is-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 99999;
    background: var(--surface-1);
    overflow-y: auto;
    padding: 30px 40px;
    box-sizing: border-box;
}

/* Annuler l'espace de la ligne parente quand on est en plein écran */
.prof-table tr.prof-detail-row.has-fullscreen td {
    padding: 0 !important;
}

/* =========================================================
   AFFICHEUR DE QUESTIONS DE COURS (LAYOUT 2 COLONNES)
   ========================================================= */
.q-split-layout {
    display: grid;
    /* C'est cette ligne qui change : 1fr pour les boutons, 2.5fr pour le texte */
    grid-template-columns: 1fr 2.5fr; 
    gap: 20px;
    margin-top: 15px;
    align-items: stretch;
    min-height: 140px; /* Garde la zone ouverte pour éviter les sauts de page */
}

/* L'encart gris à droite qui attend la question */
.q-viewer-col {
    background: color-mix(in srgb, var(--surface-2) 40%, transparent);
    border: 1px dashed var(--border-3);
    border-radius: 8px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow-y: auto;
    max-height: 250px;
}

.q-viewer-placeholder {
    text-align: center;
    color: var(--muted);
    font-size: 0.9rem;
    font-style: italic;
}

/* On annule les anciennes marges de la boîte dynamique */
.q-viewer-col .q-viewer-box {
    border-left: none !important;
    margin-top: 0 !important;
    padding: 0 !important;
    background: transparent !important;
}


/* Sur les petits écrans (tablettes), on empile les deux zones */
@media (max-width: 950px) {
    .q-split-layout {
        grid-template-columns: 1fr;
        min-height: auto;
    }
}
