html.pre-theme * {
  opacity: 0 !important;
  transition: none !important;
}


/* =========================================================
   VARIABLES LIGHT / DARK (AUTO + SWITCH)
   ========================================================= */
html, html.light {
  --cer-red: #E2001A;
  --red-highlight: #C00;

  --bg: #f7f7f7;
  --bg-alt: #f1f1f1;
  --text: #333;
  --muted: #555;
  --card-bg: #fff;
  --card-border: #ddd;
  --footer-bg: #222;
  --footer-text: #f5f5f5;
  --hero-overlay: linear-gradient(120deg, rgba(0,0,0,0.7), rgba(0,0,0,0.3));
  --row-alt: rgba(0,0,0,0.1);
}
html.dark {
  --red-highlight: #C33;
  
  --bg: #050507;
  --bg-alt: #151621;
  --text: #f5f5f5;
  --muted: #b3b3b3;
  --card-bg: #111218;
  --card-border: #2a2b33;
  --footer-bg: #000;
  --footer-text: #b3b3b3;
  --hero-overlay: radial-gradient(circle at center, rgba(0,0,0,0.2), rgba(0,0,0,0.85));
  --row-alt: rgba(255,255,255,0.1);
}

html.light {
  --row-alt: rgba(0,0,0,0.1);
}

/* =========================================================
   RESET & BASE
   ========================================================= */
* {
  box-sizing: border-box;
  transition: background-color .25s ease, color .25s ease, border-color .25s ease;
}

html:not(.theme-ready) * {
  transition: none !important;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

a {
  color: inherit;
  text-decoration: none;
}

/* =========================================================
   SWITCH DARK/LIGHT
   ========================================================= */
#theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--cer-red);
  color: #fff;
  border: none;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 1.1rem;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

#theme-toggle:hover {
  background: #b80015;
}

/* Icônes masquées par défaut */
#theme-toggle .icon-sun,
#theme-toggle .icon-moon {
  display: none;
  width: 30px;
  height: 30px;
}

/* État par défaut si aucune classe n'est encore appliquée */
html:not(.dark) #theme-toggle .icon-sun {
  display: inline;
}

/* États normaux */
html.light #theme-toggle .icon-sun { display: inline; }
html.light #theme-toggle .icon-moon { display: none; }

html.dark #theme-toggle .icon-sun { display: none; }
html.dark #theme-toggle .icon-moon { display: inline; }

/* --- Responsive : icônes plus petites sous 768px --- */
@media (max-width: 768px) {
  #theme-toggle .icon-sun,
  #theme-toggle .icon-moon {
    width: 21px;
    height: 21px;
  }
}

/* =========================================================
   HERO — VERSION MEDIA QUERIES + WEBP + FALLBACK
   ========================================================= */

/* Fallback JPG par défaut (navigateurs anciens) */
.hero {
  position: relative;
  min-height: 80vh;
  background: url('../gfx/bg-1920.jpg') center/cover no-repeat;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

/* Overlay */
.hero::after {                    
  content: "";                    
  position: absolute;             
  inset: 0;                       
  background: var(--hero-overlay);
  z-index: 1;                     
}

/* --- VERSION JPG fallback (si WebP non supporté) --- */
@media (max-width: 1280px) {
  .hero {
    background-image: url('../gfx/bg-1280.jpg');
  }
}

@media (max-width: 768px) {
  .hero {
    background-image: url('../gfx/bg-768.jpg');
  }
}
                  
/* --- VERSION WEBP (si supporté) --- */
@supports (background-image: url("../gfx/bg-1920.webp")) {
  .hero {
    background-image: url('../gfx/bg-1920.webp');
  }

  @media (max-width: 1280px) {
    .hero {
      background-image: url('../gfx/bg-1280.webp');
    }
  }

  @media (max-width: 768px) {
    .hero {
      background-image: url('../gfx/bg-768.webp');
    }
  }
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 800px;
  padding: 20px;
  animation: fadeIn 1.2s ease-out forwards;
  opacity: 0;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* LOGO SVG */
.hero-logo {
  width: 220px;
  max-width: 70%;
  margin: 0 auto 20px;
}

.hero-logo svg {
  width: 100%;
  height: auto;
  display: block;
}

/* TITRES HERO */
.hero h1 {
  font-size: 3rem;
  margin-bottom: 10px;
}

.hero h2 {
  font-size: 1.4rem;
  font-weight: 400;
  margin-bottom: 18px;
}

.hero p {
  font-size: 1.05rem;
  margin-bottom: 24px;
}

/* CTA */
.hero-cta {
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
}

.btn-primary {
  background: var(--cer-red);
  color: #fff;
  padding: 12px 28px;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 600;
}

.btn-primary:hover {
  background: #b80015;
}

.btn-secondary {
  border: 1px solid #fff;
  color: #fff;
  padding: 12px 24px;
  border-radius: 999px;
}

.btn-secondary:hover {
  background: #fff;
  color: #000;
}

/* =========================================================
   SECTIONS
   ========================================================= */
section {
  padding: 60px 20px;
  max-width: 1200px;
  margin: auto;
}

section:nth-of-type(odd) {
  background: var(--bg);
}

section:nth-of-type(even) {
  background: var(--bg-alt);
}

h2.section-title {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 35px;
}

h2.section-title::after {
  content: "";
  display: block;
  width: 60px;
  height: 3px;
  background: var(--cer-red);
  margin: 12px auto 0;
}

h3.section-title {
  text-align: center;
  font-size: 1.6rem;
  margin: 50px 0 30px;
}
h3.section-title::after {
  content: "";
  display: block;
  width: 40px;
  height: 3px;
  background: var(--cer-red);
  margin: 10px auto 0;
}

/* =========================================================
   ABOUT
   ========================================================= */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1.2fr);
  gap: 30px;
  align-items: center;
}

.about-text p {
  line-height: 1.6;
  color: var(--muted);
}

.about-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 20px;
}

.email {
  display: inline-flex;
}

.email .user {
  order: 1;
}

.email .nospam {
  order: 2;
  width: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  user-select: none;
}

.email .domain {
  order: 3;
}

/* =========================================================
   CARDS (CODE / CONDUITE / TARIFS / AVIS)
   ========================================================= */
.columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 25px;
}
#avis .columns {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));  
}

/* --- CARDS GÉNÉRIQUES --- */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 22px;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp .8s forwards;
}

@keyframes fadeInUp {
  to { opacity: 1; transform: translateY(0); }
}

.card h3 {
  color: var(--cer-red);
}

.card p,
.card li {
  color: var(--muted);
}

.price {
  margin-top: 10px;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--cer-red);
}

/* =========================================================
   CORRECTION POUR LES AVIS - NOM EN BAS
   ========================================================= */
#avis .card {
  display: flex;
  flex-direction: column; /* empile les enfants verticalement */
  justify-content: flex-start; /* laisse le texte principal en haut */
}

#avis .card p:last-child {
  margin-top: auto; /* pousse le dernier <p> (nom de l'élève) en bas */
}




/* ===========================
   TARIFS
   =========================== */

/* Intro */
.tarifs-intro {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 30px;
  color: var(--muted);
  line-height: 1.5;
}

/* Sous-titres (Permis B, Code, etc.) */
.section-subtitle {
  text-align: center;
  font-size: 1.6rem;
  margin: 50px 0 30px;
  font-weight: 600;
}

.section-subtitle::after {
  content: "";
  display: block;
  width: 40px;
  height: 3px;
  background: var(--cer-red);
  margin: 10px auto 0;
  border-radius: 2px;
}

/* Cartes TARIFS en mode flex */
.card {
  display: flex;
  flex-direction: column;
  padding: 26px;
}

/* Zone haute (titre + inclus) */
.tarif-wrapper-top {
  flex: 1;
}

/* Titre des prestations */
.title-presta {
	text-align: center;
	font-size: 1.45rem;
	margin-bottom: 8px;
	color: var(--cer-red);
	font-weight: 700;
	padding: 12px;
	border: solid 3px;
	border-radius: 30px;
}

/* Listes inclus */
.presta-inclus {
  list-style: none;
  margin: 45px 0 12px 0;
  padding: 0;
  line-height: 1.55;
}

.presta-inclus li::before {
  content: "- ";
  color: var(--muted);
}

/* Zone basse (prix + non inclus) */
.tarif-wrapper-bottom {
  margin-top: auto;
}

/* Prix */
.card .price {
	text-align: center;
	font-size: 1.8rem;
	font-weight: 700;
	margin: 0 0 10px;
	/* background: var(--red-highlight); */
	/* color: #FFF; */
	padding: 12px;
	border-radius: 30px;
	border: solid 3px var(--row-alt);
}

/* Bloc Non inclus */
.noninclus-wrapper {
  margin-top: 8px;
}

.title-noninclus {
  margin-bottom: 6px;
  font-size: 0.81rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--red-highlight);
  text-decoration: underline;
  font-style: italic;
}

.presta-noninclus {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.81rem;
  font-style: italic;
  line-height: 1.55;
}

.presta-noninclus li::before {
  content: "- ";
  color: var(--muted);
}


.tarif-wrapper-top,
.tarif-wrapper-bottom {
  display: flex;
  flex-direction: column;
}

.tarif-wrapper-top > *:first-child {
  margin-top: 0;
}
.tarif-wrapper-bottom > *:last-child {
  margin-bottom: 0;
}


@media (min-width: 900px) {
  .tarif-wrapper-top{
    min-height: 390px;
  }
  .tarif-wrapper-bottom{
    min-height: 180px;
  }
}


/* =========================================================
   HORAIRES
   ========================================================= */

/* TABLEAU */
.hours-table {
  width: 100%;
  max-width: 600px;
  margin: auto;
  border-collapse: collapse;
  background: var(--card-bg);
  border-radius: 10px;
  overflow: hidden;
  text-align: center;
}

.hours-table thead {
  background: var(--cer-red);
  color: #fff;
}

.hours-table td,
.hours-table th {
  padding: 12px 14px;
  text-align: center;
}

/* Ligne en pointillé entre chaque jour */
.hours-table tbody tr {
  border-bottom: 1px dashed var(--card-border);
}

.hours-table tbody tr:last-child {
  border-bottom: none;
}

/* Alignements verticaux */
.hours-table td {
  vertical-align: top;
}

.hours-table td:first-child {
  vertical-align: middle;
  font-weight: 600;
}

.hours-table td:last-child {
  vertical-align: top;
}

.hours-table tbody tr:nth-child(even) {
  background: var(--row-alt);
}

/* Créneaux horaires */
.slot {
  white-space: nowrap;
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
}

.slot-empty {
  opacity: 0;
  height: 1.2em; /* même hauteur qu'une ligne normale */
}

/* =========================================================
   WRAPPER DES DEUX TABLEAUX
   ========================================================= */

.horaires-wrapper {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
}
.bloc-horaires {
  display: block;
  height: auto;
  width: 100%;
}
/* Deux colonnes sur desktop */
@media (min-width: 900px) {
  .horaires-wrapper {
    grid-template-columns: 1fr 1fr;
    align-items: stretch; /* ← étire les colonnes */
    position: relative;
  }

  /* Ligne verticale subtile */
  .horaires-wrapper::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 1px;
    background: var(--card-border);
    opacity: 0.4;
    transform: translateX(-0.5px);
  }

  /* Chaque bloc doit pouvoir s'étirer */
  .bloc-horaires {
    padding-left: 20px;
    padding-right: 20px;
    height: 100%; /* ← permet au tableau interne de s'étirer */
    display: flex;
    flex-direction: column;
  }

  /* Le tableau occupe toute la hauteur disponible */
  .bloc-horaires .hours-table {
    flex: 1;
  }
}

/* Titres alignés */
.bloc-horaires h2.section-title {
  margin-top: 0;
}

/* =========================================================
   CONTACT + MAP
   ========================================================= */
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.4fr);
  gap: 30px;
}

.contact-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 20px;
}

.map-embed iframe {
  width: 100%;
  min-height: 260px;
  border: 0;
  border-radius: 12px;
}

/* ===========================
   BOUTON BACK TO TOP
   =========================== */

#back-to-top {
  position: fixed;
  bottom: calc(25px + env(safe-area-inset-bottom));
  right: 25px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--cer-red);
  color: #fff;
  border: none;
  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: center;

  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: opacity .3s ease, transform .3s ease, visibility .3s;

  z-index: 9999;
}

#back-to-top svg {
  width: 26px;
  height: 26px;
}

#back-to-top:hover {
  background: #b80015;
}

/* Visible quand on scrolle */
#back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* =========================================================
   FOOTER
   ========================================================= */
footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  text-align: center;
  padding: 20px 10px;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 900px) {
  .about-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    font-size: 2.4rem;
  }
}

@media (max-width: 600px) {
  .hero {
    min-height: 70vh;
    padding: 20px;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .hero h2 {
    font-size: 1.05rem;
  }
}






/* =========================================================
   PROMOTIONS — Bandeau promo animé
   ========================================================= */

.promo-banner {
  position: fixed;
  bottom: 20px; /* léger décalage pour respirer */
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  max-width: 900px;

  background: var(--cer-red);
  color: #fff;
  text-align: center;

  padding: 14px 20px;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.5px;

  border-radius: 30px;
  box-shadow: 0 21px 21px -12px rgba(0,0,0,0.45);

  z-index: 9999;

  /* Animation fluide */
  opacity: 1;
  transform: translate(-50%, 0);
  transition:
    opacity 0.45s ease,
    transform 0.45s ease;
}

/* État caché (scroll > 300px) */
.promo-banner.hidden {
  opacity: 0;
  transform: translate(-50%, 40px); /* glisse vers le bas */
  pointer-events: none;
}

