/* Variables CSS */
:root {
  --primary-orange: #ff6a00;
  --secondary-yellow: #ffe066;
  --text-dark: #222;
  --text-gray: #555;
  --background-light: #fff2be;
  --gradient-primary: linear-gradient(135deg, #ff6a00, #ff9500);
  --border-radius: 16px;
  --transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Poppins", sans-serif;
  line-height: 1.6;
  color: var(--text-dark);
  background: var(--background-light);
  overflow-x: hidden;
  text-align: center;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

/* --- HERO --- */
.hero-modern {
  padding: 80px 0 40px;
  text-align: center;
  position: relative;
  overflow: hidden;
  z-index: 2;
}

.hero-badge {
  display: inline-block;
  background: rgba(255, 106, 0, 0.1);
  color: var(--primary-orange);
  padding: 8px 20px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 20px;
  border: 1px solid rgba(255, 106, 0, 0.2);
}

.modern-title {
  font-size: 4rem;
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 20px;
  letter-spacing: -1px;
}

.word-rotator {
  display: inline-grid;
  vertical-align: bottom;
  height: 1.1em;
  overflow: hidden;
  color: var(--primary-orange);
  position: relative;
  width: auto;
  min-width: auto;
  text-align: center;
  justify-items: center;
  margin: 0 auto;
}

.word-rotator span {
  grid-column: 1;
  grid-row: 1;
  display: inline-block;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(50px);
  transition: opacity 0.5s ease,
    transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.word-rotator span.active {
  opacity: 1;
  transform: translateY(0);
}

/* SOUS-TITRE */
.modern-subtitle {
  font-size: 1.1rem;
  color: var(--text-gray);
  max-width: 700px;
  margin: 0 auto;
  padding: 0 20px;
  font-weight: 400;
}

/* NOUVEAU : Highlight orange pour "gratuitement" */
.highlight-orange {
  color: var(--primary-orange);
  font-weight: 700;
  /* Un peu plus gras pour ressortir */
}

/* --- RESTE DU SITE (Accès rapide etc) --- */
.section-title {
  font-size: 2.2rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 2rem;
  /* CORRECTION ESPACE : Réduit la marge du haut */
  margin-top: 1rem;
}

.nav-grid,
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  padding-bottom: 40px;
}

.nav-card,
.feature-card {
  background: var(--secondary-yellow);
  padding: 30px;
  border-radius: var(--border-radius);
  text-decoration: none;
  color: var(--text-dark);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  transition: var(--transition);
  opacity: 0;
  transform: translateY(30px);
  text-align: left;
}

.feature-card {
  text-align: center;
}

.animate-in {
  opacity: 1;
  transform: translateY(0);
}

.nav-card:hover,
.feature-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
  background: #fde998;
}

.nav-card-icon,
.feature-icon {
  font-size: 2.5rem;
  margin-bottom: 15px;
  display: block;
}

.nav-card h3,
.feature-card h3 {
  font-size: 1.5rem;
  margin-bottom: 10px;
}

.nav-card-arrow {
  position: absolute;
  bottom: 30px;
  right: 30px;
  font-size: 1.5rem;
  color: var(--primary-orange);
  transition: transform 0.3s;
}

.nav-card:hover .nav-card-arrow {
  transform: translateX(5px);
}

/* --- ESPACEMENT SPÉCIFIQUE --- */
.quick-navigation {
  margin-top: 60px;
  /* Ajoute de l'air entre le slider et cette section */
}

/* Responsive */
@media (max-width: 768px) {
  .modern-title {
    font-size: 2.5rem;
  }

  .video-wrapper-full {
    width: 95% !important;
    border-radius: 20px !important;
    height: 40vh;
  }

  /* .word-rotator { display: block; text-align: center; width: 100%;}  <-- REMOVED to fix overlap */
  .hero-modern {
    padding: 60px 0 30px;
  }

  .modern-subtitle {
    font-size: 1rem;
  }

  /* --- AMÉLIORATIONS LISIBILITÉ MOBILE --- */

  /* 1. Grille en une seule colonne pour éviter l'écrasement */
  .nav-grid,
  .features-grid {
    grid-template-columns: 1fr;
    gap: 20px;
    /* Espace réduit entre les cartes */
  }

  /* 2. Cartes plus compactes */
  .nav-card,
  .feature-card {
    padding: 20px;
    /* Moins de padding interne */
  }

  .nav-card h3,
  .feature-card h3 {
    font-size: 1.3rem;
    /* Titres de cartes un peu plus petits */
  }

  /* 3. Titres de section ajustés */
  .section-title {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
  }
}

@media (max-width: 480px) {
  .modern-title {
    font-size: 1.8rem;
    /* Significantly smaller to fit "année de Terminale" */
    line-height: 1.2;
  }

  .word-rotator {
    font-size: 1.8rem;
    /* Ensure rotator matches title size */
    height: 1.2em;
    /* Adjust height for new line-height */
    max-width: 100%;
    white-space: nowrap;
    /* Keep it on one line if possible */
  }

  /* If it still overflows on very small screens, allow wrapping but it might break animation slightly */
  /* Better to just shrink font more if needed. 1.8rem should fit 320px width. */
}

/* --- VOTING MODAL STYLES --- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(5px);
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.vote-modal {
  background: white;
  width: 90%;
  max-width: 500px;
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  transform: translateY(20px);
  transition: transform 0.3s ease;
  position: relative;
  text-align: left;
}

.modal-overlay.active .vote-modal {
  transform: translateY(0);
}

.modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: transparent;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-gray);
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-orange);
  margin-bottom: 20px;
  text-align: center;
}

.candidates-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.candidate-item {
  display: flex;
  align-items: center;
  padding: 15px;
  border: 2px solid #eee;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.candidate-item:hover {
  border-color: var(--secondary-yellow);
  background: #fffdf5;
}

.candidate-item.selected {
  border-color: var(--primary-orange);
  background: #fff0e0;
}

.candidate-radio {
  margin-right: 15px;
  accent-color: var(--primary-orange);
}

.candidate-info h4 {
  margin-bottom: 3px;
  font-size: 1.1rem;
}

.candidate-info p {
  font-size: 0.85rem;
  color: var(--text-gray);
  margin: 0;
}

.vote-submit-btn {
  width: 100%;
  margin-top: 25px;
  background: var(--gradient-primary);
  border: none;
  color: white;
  padding: 12px;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.vote-submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(255, 106, 0, 0.3);
}

.vote-btn-feedback {
  background: white;
  color: var(--primary-orange);
  padding: 10px 20px;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
}

.vote-btn-feedback:hover {
  background: #fff0e0;
  transform: translateY(-3px);
}
