/* ---------------------------
   STYLE INDEX CORRIGÉ
   --------------------------- */

/* Fond global multicolore */
body {
  margin: 0;
  font-family: "Poppins", Arial, sans-serif;
  background: linear-gradient(135deg, #e3f2fd 0%, #fff3e0 30%, #fce4ec 60%, #e8f5e9 100%);
  background-attachment: fixed;
  color: #333;
  line-height: 1.6;
  animation: gradientMove 12s ease infinite alternate;
}

@keyframes gradientMove {
  0% { background-position: left top; }
  100% { background-position: right bottom; }
}
/* ----- HERO avec image ancrée en BAS ----- */
.hero {
  position: relative;
  padding: 6rem 1rem;
  min-height: 70vh;
  color: #fff;
  text-align: left;
  overflow: hidden;

  /* 2 couches : 1) dégradé  2) image PC */
  background-image: linear-gradient(135deg, rgba(0,102,204,0.7), rgba(156,39,176,0.6)),
                    url('../images/primaire-bg.jpg');

  /* Position : gradient centré, image ancrée en bas */
  background-position: center center, center bottom;
  background-size: auto, cover;
  background-repeat: no-repeat, no-repeat;
  background-attachment: scroll, fixed; /* gradient scroll, image parallax PC */
}

/* Overlay */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0,102,204,0.25), rgba(255,193,7,0.25));
  z-index: 0;
}

/* Container au-dessus de l'image */
.hero .container {
  position: relative;
  z-index: 1;
}

/* 📱 Mobile (iOS / Android) */
@media (max-width: 768px) {
  .hero {
    background-image: linear-gradient(135deg, rgba(0,102,204,0.7), rgba(156,39,176,0.6)),
                      url('../images/primaire-bg.jpg');
    background-position: center center, center bottom !important; /* force bas */
    background-size: auto, cover !important;                     /* force cover */
    background-attachment: scroll, scroll !important;           /* iOS fix */
    padding: 4rem 1rem;
  }

  .hero::before {
    background: none;
    backdrop-filter: 0,75px;
  }
}

/* 🛠 Hack spécial iOS Safari */
@supports (-webkit-touch-callout: none) {
  .hero {
    background-position: center center, center bottom !important;
    background-size: auto, cover !important;
    background-attachment: scroll, scroll !important;
  }
}

.hero .container {
  position: relative;
  z-index: 1;
}

.hero .kicker {
  font-size: 1rem;
  text-transform: uppercase;
  color: #ffeb3b;
  font-weight: 600;
  letter-spacing: 2px;
}

.hero h1 {
  font-size: 2.8rem;
  font-weight: 700;
  margin: 1rem 0;
  line-height: 1.2;
  background: linear-gradient(90deg, #ffffff, #ffffff, #ffffff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: textGradient 5s ease infinite alternate;
}

@keyframes textGradient {
  0% { background-position: left; }
  100% { background-position: right; }
}

.hero .lead {
  font-size: 1.2rem;
  max-width: 650px;
  margin-bottom: 1.5rem;
}

/* Boutons */
.btn, .btn-outline {
  padding: .8rem 1.6rem;
  border-radius: 999px;
  font-weight: 600;
  transition: all .3s ease;
  text-decoration: none;
  font-size: 1rem;
}

.btn {
  background: linear-gradient(90deg, #ff4081, #ff9100, #00c853);
  color: #fff;
  border: none;
  background-size: 300%;
  animation: btnGradient 6s ease infinite;
}

@keyframes btnGradient {
  0% { background-position: left; }
  100% { background-position: right; }
}

.btn:hover {
  transform: scale(1.05);
}

.btn-outline {
  border: 2px solid #fff;
  color: #fff;
  background: transparent;
}

.btn-outline:hover {
  background: #fff;
  color: #0066cc;
}

/* -------------------- */
/* Sections             */
/* -------------------- */
.section {
  padding: 4rem 1rem;
  margin-top: 2rem; /* ajout espace entre sections pour mobile et iOS */
}

.section.alt {
  background: linear-gradient(135deg, #fafafa, #f3e5f5);
}

.section-head h2 {
  font-size: 2rem;
  margin-bottom: .5rem;
  background: linear-gradient(90deg, #ff6f61, #2196f3, #4caf50);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.section-head p {
  color: #666;
  max-width: 650px;
  margin: 0 auto;
}

/* Grilles de cartes */
.grid-3 {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  margin-top: 2rem;
}

.card.feat {
  background: linear-gradient(135deg, #ffffff, #f1f8e9);
  border-radius: 1rem;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
  padding: 2rem 1.5rem;
  text-align: center;
  transition: transform .3s ease, box-shadow .3s ease;
}

.card.feat:hover {
  transform: translateY(-6px) scale(1.03);
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

.card.feat .feat-emoji {
  font-size: 2.5rem;
  margin-bottom: .8rem;
  animation: emojiBounce 3s infinite ease-in-out;
}

@keyframes emojiBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.card.feat h3 {
  margin-bottom: .5rem;
  font-size: 1.3rem;
  background: linear-gradient(90deg, #ff4081, #2196f3);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* -------------------- */
/* CTA Section          */
/* -------------------- */
.section.center {
  text-align: center;
  background: linear-gradient(135deg, #ffecb3, #e1f5fe);
  padding: 3rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem; /* espace entre boutons et contenus */
}

.section.center h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
  background: linear-gradient(90deg, #ff7043, #7e57c2, #00c853);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ---------- Mobile ------------- */
@media (max-width: 768px) {
  .section.center {
    padding: 2rem 1rem;
    gap: 0.8rem;
  }

  .section.center .btn,
  .section.center .btn-outline {
    display: block;
    width: 90%;
    margin: 0 auto 1rem auto;
    text-align: center;
  }

  .grid-3 {
    grid-template-columns: 1fr; /* une carte par ligne */
    gap: 1.5rem;
  }
}

/* -------------------- */
/* Footer               */
/* -------------------- */
.site-footer {
  background: linear-gradient(135deg, #0066cc, #8e24aa);
  color: #fff;
  padding: 2rem 1rem;
}

.footer-nav a {
  color: #fff;
  text-decoration: none;
  margin-right: 1rem;
}

.footer-nav a:hover {
  text-decoration: underline;
}

/* -------------------- */
/* Responsive           */
/* -------------------- */
@media (max-width: 992px) {
  .hero {
    text-align: center;
  }
  .hero .container {
    margin: 0 auto;
  }
}

@media (max-width: 768px) {
  .hero {
    padding: 4rem 1rem;
    background-attachment: scroll !important; /* iOS/Android fix */
    background-position: center bottom !important;
    background-size: cover !important;
  }
}
