/* Variables */
:root {
  --bg: #ffffff;
  --card: #ebebeb;
  --text: #0f1724; /* Noir foncé */
  --muted: #6b7280;
  --tab-font: #e9f2ee;
  --tab-border : #ccc;
  --form-bg: #ffffff;
  --text-shadow: #0000001a;
  --luglon-green: #166136; 
  --resa-shadow: #00000080;
  
  --accent: var(--luglon-green);
  --error-red: #dc3545;
  --warning-orange-font: #ffa5001a;
  --warning-orange-border: #ffa500;

  --sending-bg: #ffe0b2;
  --sending-border: #e65100;
  --error-bg: #ffebee;
  --error-border: #c62828;
  --success-bg: #e8f5e9;
  --success-border: #2e7d32;
}

/* --- DARK MODE --- */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1a1a; /* Fond principal (BODY) */
    --card: #121212; /* Fond des cartes/boîtes sombre (HERO) */
    --text: #f6f6f6; /* Blanc cassé */
    --muted: #a1a1a1;
    --tab-font: #222222;
    --form-bg: #222222;
    --text-shadow: #16613680;
    --tab-border : #444444;
    --resa-shadow: #000000cc;
  }
}

/* ---------------------------------------------------------- */
/* -------------- STYLES GÉNÉRAUX ET STRUCTURE -------------- */
/* ---------------------------------------------------------- */

* {
  box-sizing: border-box;
}

/* Courte description des boutons "Programme" et "Réservation" */
body {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  margin: 0;
  background: var(--bg); /* Fond principal */
  color: var(--text); /* Couleur de texte principal */
}

/* Incrustation pleine largeur dans le navigateur (pas de marge) */
.wrap {
  max-width: 100%;
  margin: 0;
  padding: 0;
}

/* Certains textes : corps du programme, titre des cases à remplir dans les formulaires */
.card {
  padding: 18px;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  color: var(--text);
}

/* Logo dynamique (image) */
.floating-logo img {
  width: 60px;
  height: 60px;
  border-radius: 50%;
}

/* Logo dynamique (position fixe en haut à gauche) */
.floating-logo {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 1000;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  transition: opacity 0.3s;
  color: var(--text);
}

/* Textes de feedback (type merci de remplir la case) */
.empty, .small {
    color: var(--muted);
}

/* FOOTER CENTRÉ */
footer {
  text-align: center;
  padding: 20px;
  color: var(--muted);
}

/* MISE EN PAGE DE LA PAGE D'ACCUEIL (NON BLOC) */
.main-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start; 
  padding: 100px 5% 50px;
  background: var(--card); 
}
.hero-content {
  flex-basis: 70%;
  padding-right: 15px;
}
.hero-image {
  max-width: 30%;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

/* TITRES PRINCIPAUX : police Special Gothic Condensed One */
.main-title {
  font-size: 9rem;
  font-family: "Special Gothic Condensed One", sans-serif;
  line-height: 1.1;
  margin: 0 0 10px;
  color: var(--text);
}
.main-subtitle {
  font-size: 3rem;
  font-family: "Special Gothic Condensed One", sans-serif;
  color: var(--text);
}

/* ---------------------------------------------------------- */
/* ---------------- STYLES PROPRES À L'INDEX ---------------- */
/* ---------------------------------------------------------- */

/* 1. Paragraphe avec images de fougère */
.history-images-container {
  display: flex; 
  align-items: center; 
  justify-content: center; 
  gap: 20px; 
  padding: 50px 5%; 
  max-width: 1400px; 
  margin: 0 auto;
  background-color: transparent; 
}
.history-image-placeholder {
  width: 200px; 
  border-radius: 12px;
  display: flex; 
  align-items: center;
  justify-content: center;
  overflow: hidden; 
  box-shadow: none;
}
.history-image-placeholder img {
    width: 100%; 
    height: auto; 
    object-fit: contain; 
    display: block; 
}
.history-section {
  flex-shrink: 0;
  max-width: 900px;
  width: auto; 
  padding: 0; 
  margin: 0;
  text-align: center;
  background-color: transparent; 
}
.history-section h3 {
  font-family: "Special Gothic Condensed One", sans-serif;
  font-size: 4rem;
  margin-bottom: 0px;
  color: var(--text);
}
.history-text {
  font-family: "Special Gothic Condensed One", sans-serif;
  font-size: 2rem; 
  margin-top: 0;
  color: var(--text);
}

/* 2. Grilles de navigation et zones cliquables */
.nav-grid {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  max-width: 1200px;
  margin: 0 auto; 
  padding: 80px 10%;
  text-align: center;
  gap: 40px;
}
.nav-card {
  max-width: 450px;
  flex-basis: 48%; /* Permet aux cartes de prendre presque la moitié de la largeur chacune */
  display: flex; /* Activer Flexbox sur la carte */
  flex-direction: column; /* Organiser le contenu verticalement */
  justify-content: space-between; /* Pousser le premier contenu vers le haut et le dernier (bouton) vers le bas */
}

a.nav-card, 
a.nav-card:visited, 
a.nav-card:active {
  max-width: 450px;
  text-decoration: none !important;
  color: var(--text) !important; /* Force ta couleur noire/blanche selon le mode */
  flex-basis: 48%; 
  display: flex; 
  flex-direction: column; 
  justify-content: space-between;
  border: 2px solid var(--tab-border);
  border-radius: 12px;
  padding: 25px;
}

.nav-card:hover {
  transform: none;
  box-shadow: none;
}
.nav-card h3 {
  margin-top: 0;
  font-size: 1.5rem;
  font-family: "Special Gothic Condensed One", sans-serif;
  color: var(--text);
}
.nav-card p {
  font-size: 1.2rem; 
  margin-top: 10px;
  margin-bottom: 20px;
  font-family: "Special Gothic Condensed One", sans-serif;
}
.nav-logo {
  width: 160px;
  height: 160px;
  object-fit: contain;
  display: block; /* Traiter le logo comme un bloc */
  margin: 0 auto; /* Centrer le bloc horizontalement */
}
.nav-button {
  color: white;
  background: var(--luglon-green);
  border-radius: 10px;
  padding: 15px;
  display: block;
  width: 100%;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  text-decoration: none;
  font-family: "Special Gothic Condensed One", sans-serif;
}

/* ---------------------------------------------------------- */
/* -------------- STYLES PROPRES AU PROGRAMME -------------- */
/* ---------------------------------------------------------- */

/* 1. Styles du planning (Jours, horaires, activités) */
.day-title h4 {
  font-family: "Fascinate Inline", cursive;
  font-size: 4rem;
  font-weight: 400;
  text-transform: uppercase;
  margin-right: 20px; margin-left: 20px;
  margin-bottom: 0;
  margin-top: 100px;
  color: var(--luglon-green);
  text-shadow: 0 0 5px var(--text-shadow);
}
.day-content {
  padding: 15px 0;
  background-color: transparent;
  display: block;
}

.committee-name, .logo-fixed-text .logo-line-2 {
    color: var(--luglon-green);
    text-shadow: 0 0 5px var(--text-shadow);
}

/* Alternance G/D des jours */
.align-left .day-title,
.align-left .day-content {
    text-align: left;
}
.align-right .day-title,
.align-right .day-content {
    text-align: right;
}
.day-content p { /* Alignement du programme (Heure et Activité) */
  font-family: "Special Gothic Condensed One", sans-serif;
  font-style: normal;
  font-size: 1.5rem;
  margin: 0;
  margin-left: 10px;
  margin-right: 10px;
  padding: 2px 0; 
}
.activity-time { /* Style spécifique à l'horaire (pour le mettre en valeur) */
    font-weight: 700;
    color: var(--luglon-green);
    margin-right: 15px; 
    display: inline-block; 
    min-width: 80px;
    /* text-align: left/right est géré par le parent align-left/align-right */
}
.planning-section {
  border-bottom: none !important;
}

/* ---------------------------------------------------------- */
/* ------------- STYLES PROPRES À LA RÉSERVATION ------------ */
/* ---------------------------------------------------------- */

.wrap.res-wrap {
    /* Centrage et Largeur 70% */
    max-width: 70%; 
    margin: 40px auto; 
    padding: 0 0 20px;
}

.res-wrap .card { /* Ombrage et cadre la width de 80% */
    background: var(--bg);
    border-radius: 12px;
    box-shadow: 0 6px 18px var(--resa-shadow);
}
/* 1. STYLES DU TABLEAU DE PRIX */

.price-plaque {
  padding: 15px;
  background: var(--tab-font); /* Fond du tableau des prix */
  border-radius: 8px;
  margin-bottom: 20px;
  text-align: center;
  border: 1px solid var(--luglon-green); 
  color: var(--text);
}
.price-plaque h3 { /* Titre des colonnes du tableau des prix */
  color: var(--luglon-green);
  margin-top: 0;
  font-size: 18px;
}
.price-table { /* Tableau des prix sauf titres des colonnes */
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  color: var(--text);
}
.price-table th, .price-table td { /* Bordures du tableau des prix */
  padding: 8px 5px;
  border: 1px solid var(--tab-border);/* Bordures générales */
}
.price-table th {
  color: var(--luglon-green);
  text-align: center;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 13px;
  padding-bottom: 10px;
}
.price-table td {
  text-align: center;
}

/* 2. STYLES DE LA NOTE D'AVERTISSEMENT */

.warning-note {
  padding: 10px 12px;
  border-radius: 8px;
  background-color: var(--warning-orange-font); 
  border: 1px solid var(--warning-orange-border);
  font-size: 13px;
  margin-bottom: 15px; 
}
.warning-note strong {
  font-weight: 700;
}

/* 3. STYLES DE FORMULAIRE ET INPUTS */
label {
  font-size: 16px;
  display: block;
  margin-bottom: 10px;
  margin-top: 15px;
}
input, textarea, select { /* Styles communs aux cases de formulaire */
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  background-color: var(--form-bg);
  border: 1px solid var(--tab-border);
}
select { /* Styles spécifiques au menu de choix du soir */
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 width%3D%22292.4%22 height%3D%22292.4%22%3E%3Cpath fill%3D%22%236b7280%22 d%3D%22M287 197.8L156.4 67.2c-4.8-4.8-12.5-4.8-17.3 0L5.3 197.8c-4.8 4.8-4.8 12.5 0 17.3l23 23c4.8 4.8 12.5 4.8 17.3 0l101.4-101.4c-4.8-4.8-12.5-4.8-17.3 0l101.4 101.4c4.8 4.8 12.5 4.8 17.3 0l23-23c-4.8-4.8-4.8-12.5 0-17.3z%22%2F%3E%3C%2Fsvg%3E");
  background-repeat: no-repeat;
  background-position: right 10px top 50%;
  background-size: 10px auto;
}
.field-auto { /* Classe pour les champs qui doivent s'adapter en largeur */
    flex: 1;
}
.field-small { /* Classe pour les petits champs (ex: Téléphone) */
    width: 160px;
    flex-shrink: 0; /* Empêche  de rétrécir si l'écran est petit */
}
.field-end {
    align-items: flex-end; /* Utilisé pour les consignes qui doivent aligner leur contenu au bas de la ligne. */
}
.reservation-count {
    margin-left: auto; /* Assure que le compteur de réservations est poussé complètement à droite. */
    font-size: 13px;
}
form .row {
    display: flex; /* Active Flexbox pour les lignes contenant plusieurs champs (ex: Nom et Téléphone). */
    gap: 10px; /* Espace entre les éléments de la ligne (ex: entre Nom et Téléphone). */
}

/* 2. STYLES DE LA SECTION RÉSERVATION INDIVIDUELLE DE MENUS */
#menu-container { /* Rend les choix de menu individuels compacts sur une même ligne */
  display: flex;
  flex-wrap: wrap; 
  gap: 15px 10px; 
  margin-top: 12px;
}
.menu-selection-group {/* Encadre les choix de menu individuels */
  flex: 0 0 calc(25% - 7.5px); /* 4 colonnes (- ajustement pour le gap) */
  min-width: 120px; /* Taille minimale pour ne pas trop compresser */
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--tab-border);
}
.menu-selection-group h5 { /* Stylise et ajuste les marges des choix de menu individuel */
  margin: 0 0 8px;
  font-size: 14px;
  color: var(--accent);
}
.menu-options {
  display: block; 
}
.total-price {
  display: inline-block;
  margin-top: 15px;
  font-weight: bold;
  color: var(--accent);
}
.form-submit-row { /* Bouton réserver */
  margin-top: 14px;
  display: flex;  /* Utilise Flexbox pour aligner le bouton, le statut, et le compteur sur une seule ligne. */
  gap: 8px; /* Espace entre les éléments (Bouton, Statut, Compteur). */
  align-items: center; /* Centre les éléments verticalement dans la ligne. */
}
.submit-button {
  width: 30%;
  display: inline-block;
  padding: 15px;
  margin-top: 15px; margin-bottom: 15px;
  border-radius: 10px;
  background: var(--accent);
  color: white;
  cursor: pointer;
  font-size: 1.4rem;
  text-decoration: none;
  border: none;
  font-family: "Special Gothic Condensed One", sans-serif;
}
/* Erreur de remplissage des champs */
.error-feedback {
  color: var(--error-red);
  font-size: 12px;
  margin: 2px 0 0 0;
  height: 15px; 
}
/* Style pour le champ en erreur */
.input-error {
  border-color: var(--error-red);
}
input[type="number"] {
  max-width: 120px;
}

/* 4. STYLES DU STATUT DE RÉSERVATION */
#submission-status {
        margin-left: auto; /* Aligne à droite */
        font-size: 14px;
        padding: 5px 10px;
        border-radius: 6px;
        background-color: var(--muted);
        color: var(--text);
        display: none; /* Caché par défaut */
        align-items: center; /* Pour aligner avec un potentiel spinner */
        gap: 8px;
}
#submission-status.sending {
  background-color: var(--sending-bg);
  color: var(--sending-border);
  display: flex;
}
#submission-status.success {
  background-color: var(--success-bg);
  color: var(--success-border);
  display: flex;
}
#submission-status.error {
  background-color: var(--error-bg);
  color: var(--error-border);
  display: flex;
}
/* STYLES DE LA LISTE DES RÉSERVATIONS PRÉCÉDENTES */
.res-item {
  padding: 12px;
  border-radius: 10px;
  margin-bottom: 10px;
  border: 1px solid var(--tab-border); 
  background: var(--form-bg); 
}
.res-item h4 {
    margin: 0 0 4px;
    font-size: 15px;
}
.meta {
  color: var(--muted);
  font-size: 13px;
}

/* ---------------------------------------------------------- */
/* -------------- ADAPTATION MOBILE (MAX-WIDTH 768PX) ------- */
/* ---------------------------------------------------------- */

@media (max-width: 768px) {

  /* --- STYLES GÉNÉRAUX --- */

  /* Le wrap de réservation doit prendre plus de place sur petit écran */
  .wrap.res-wrap {
      max-width: 95%; 
      margin: 20px auto; 
  }

  .floating-logo {
    position: relative; /* Annule le mode fixe */
    top: 0;
    left: 0;
    justify-content: center; /* Centre le logo sur mobile, c'est plus joli */
    padding: 15px 0;
    background: var(--card); /* Assure que le fond est propre */
  }
  
  /* --- PAGE D'ACCUEIL --- */

  /* 1. MISE EN PAGE PRINCIPALE (HEADER) */
  .main-hero {
    display: block; /* Empile les éléments (titre puis image) */ 
    padding: 10px 5% 30px; /* Réduit le padding pour plus d'espace */
    text-align: center; /* Centre le texte */
  }
  .hero-content {
    margin-top: 0;
    flex-basis: auto; /* Annule le 70% */
    padding-right: 0;
  }
  
  .hero-image {
    max-width: 50%; /* L'image prend toute la largeur */
    margin-top: 20px;
  }
  
  /* Ajustement de la taille des titres pour mobile */
  .main-title {
    font-size: 4rem; /* Réduit 9rem -> 4rem */
    line-height: 1;
    margin-bottom: 5px;
  }
  .main-subtitle {
    font-size: 1.5rem; /* Réduit 3rem -> 1.5rem */
  }

  /* 2. SECTION HISTOIRE ET IMAGES DE FOUGÈRE */
  .history-images-container {
    display: block; /* Empile les images et le texte */
    padding: 30px 5%;
  }
  .history-section {
    max-width: 100%;
    margin-bottom: 20px;
  }
  .history-image-placeholder {
    width: 25%; /* Les images peuvent prendre toute la largeur si vous le souhaitez */
    max-width: 250px; /* Ou définir une taille maximale pour les centrer */
    margin: 10px auto;
    display: none;
  }
  .history-section h3 {
    font-size: 2.5rem;
  }
  .history-text {
    font-size: 1.2rem;
  }
  
  /* 3. GRILLE DE NAVIGATION */
  .nav-grid {
    flex-direction: row; /* Empile les cartes verticalement */
    padding: 20px 5%;
    gap: 10px;
  }

  a.nav-card, 
  a.nav-card:visited, 
  a.nav-card:active {
    flex-basis: 50%; /* Chaque carte prend la moitié de l'écran */
    flex-direction: column; /* Remet l'icône au-dessus du texte */
    padding: 15px 10px; /* Réduit un peu les marges intérieures */
    text-align: center; /* Centre le texte */
  }

  .nav-logo {
      width: 60px; /* Icône plus petite pour rentrer */
      height: 60px;
      margin: 0 auto 10px auto; /* Centre l'icône */
    }

  .nav-card h3 {
    font-size: 1.1rem; /* Texte plus petit */
    line-height: 1.2;
    margin-bottom: 10px;
  }

  /* On garde le texte caché car il n'y a pas la place */
  .nav-card p {
    display: none; 
  }

  .nav-button {
    width: 100%;
    padding: 8px 5px;
    font-size: 1rem;
    margin: 0;
  }
  
  .nav-card {
    max-width: 100%;
    flex-basis: auto; /* Annule le 48% */
  }
  
  /* --- PAGE PROGRAMME --- */

  .day-title h4 {
    font-size: 3rem;
    text-transform: uppercase;
    margin-right: 0; margin-left: 0;
    margin-bottom: 0;
  }
  .day-content {
    padding: 15px 0;
  }

  /* --- PAGE RÉSERVATION --- */

  /* 1. STRUCTURE DU FORMULAIRE */
  form .row {
    flex-direction: column; /* Empile les champs (Nom et Téléphone) */
    gap: 0;
  }
  .field-small {
      width: 100%; /* Le petit champ prend toute la largeur */
  }
  
  /* 2. CHOIX DES MENUS INDIVIDUELS */
  #menu-container {
    /* Passer de 4 colonnes (25%) à 2 colonnes sur mobile */
    gap: 15px 5px;
  }
  .menu-selection-group {
    /* Deux colonnes par ligne sur mobile */
    flex: 0 0 calc(50% - 7.5px); 
    min-width: 45%; /* S'assure qu'ils ne sont pas trop compressés */
  }
  
  /* 3. BOUTON RÉSERVER */
  .form-submit-row {
    flex-wrap: wrap; /* Permet au statut de passer à la ligne */
    align-items: center;
    margin-left: 0 auto; margin-right: 0 auto;
  }
  .submit-button {
    width: 60%;
    padding: 12px;
    margin: 0 auto;
    font-size: 1.3rem;
  }
  #submission-status {
    /* Le statut ne s'aligne plus forcément à droite, il suit le bouton */
    margin-left: 0; 
    margin-top: 10px;
  }
}
