/* ===================================
   GRADIENT TIMELINE - VERSION CORRIGÉE
   Sans scroll automatique sur mobile
   =================================== */

.gradient-timeline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  width: 100%;
  max-width: 1200px;
  margin: 60px auto;
  gap: 30px;
}

/* ligne dégradée centrale - DESKTOP (horizontal) */
.gradient-timeline::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #220660, #f91e5a, #5ce1e6);
  border-radius: 2px;
  z-index: 1;
}

/* Flèche de fin - DESKTOP (horizontale vers la droite) */
.gradient-timeline::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -25px;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 20px solid #5ce1e6;
  border-top: 12px solid transparent;
  border-bottom: 12px solid transparent;
  z-index: 2;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
  animation: arrowPulse 2s ease-in-out infinite;
}

/* Animation subtile de la flèche */
@keyframes arrowPulse {
  0%, 100% { 
    opacity: 1; 
    transform: translateY(-50%) scale(1);
  }
  50% { 
    opacity: 0.7; 
    transform: translateY(-50%) scale(1.1);
  }
}

/* cartes */
.timeline-step {
  position: relative;
  flex: 1;
  background: #fff;
  border-radius: 20px;
  padding: 40px 20px 20px;
  text-align: center;
  z-index: 2;
  box-shadow: 0 8px 25px rgba(0,0,0,0.1);
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  transform: scale(1);
  cursor: pointer;
}

/* carte active = plus grande */
.timeline-step.active {
  transform: scale(1.1);
  z-index: 5;
  box-shadow: 0 12px 30px rgba(0,0,0,0.2);
}

/* effet hover pour améliorer l'UX */
.timeline-step:hover:not(.active) {
  transform: scale(1.02);
  box-shadow: 0 10px 28px rgba(0,0,0,0.15);
}

/* cercle central de connexion - DESKTOP */
.timeline-step::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -20px;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f91e5a, #8b5cf6);
  border: 4px solid #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  z-index: 3;
}

/* pas de cercle pour le premier bloc */
.timeline-step:first-child::before {
  display: none;
}

/* icônes + texte */
.timeline-step .icon {
  font-size: 28px;
  margin-bottom: 12px;
  color: #8b5cf6; /* violet */
  transition: transform 0.3s ease;
}

.timeline-step.active .icon {
  transform: scale(1.1);
}

.timeline-step h3 {
  font-size: 18px;
  font-weight: 700;
  color: #111;
  margin-bottom: 10px;
}

.timeline-step p {
  font-size: 14px;
  color: #555;
  line-height: 1.5;
}

/* Bordure dégradée uniquement sur le haut (odd) */
.timeline-step:nth-child(odd)::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 8px;
  background: linear-gradient(90deg, #f91e5a, #5ce1e6);
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
}

/* Bordure dégradée uniquement sur le bas (even) */
.timeline-step:nth-child(even)::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 8px;
  background: linear-gradient(90deg, #f91e5a, #5ce1e6);
  border-bottom-left-radius: 20px;
  border-bottom-right-radius: 20px;
}

.timeline-step .badge {
  display: inline-block;
  margin: 8px 0 12px;
  padding: 6px 12px 4px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  color: #333;
  background: #f8f9fa;
  border-top: 3px solid transparent;
  background-image: 
    linear-gradient(#f8f9fa, #f8f9fa),
    linear-gradient(90deg, #f91e5a, #5ce1e6);
  background-origin: border-box;
  background-clip: padding-box, border-box;
}

/* Description cachée par défaut */
.timeline-step .desc {
  display: none;
  font-size: 14px;
  color: #555;
  line-height: 1.5;
  margin-top: 10px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* Description visible quand active */
.timeline-step.active .desc {
  display: block;
  opacity: 1;
}

.timeline-step .desc ul {
  padding-left: 18px;
  margin: 10px 0 0;
  text-align: left; /* pour bien aligner les puces */
}

.timeline-step .desc ul li {
  margin-bottom: 6px;
  font-size: 14px;
  color: #6A7995;
  line-height: 1.5;
}

/* ===========================
   RESPONSIVE - MOBILE/TABLET
   =========================== */

@media (max-width: 1024px) {
  .gradient-timeline {
    gap: 20px;
    margin: 40px auto;
  }
  
  .timeline-step {
    padding: 30px 15px 15px;
  }
  
  .timeline-step.active {
    transform: scale(1.05); /* moins d'agrandissement sur tablet */
  }
}

@media (max-width: 768px) {
  /* Container principal - passage en vertical */
  .gradient-timeline {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin: 30px auto;
    padding: 0 20px;
  }

  /* ligne dégradée verticale pour mobile */
  .gradient-timeline::before {
    top: 0;
    bottom: 0;
    left: 50%;
    right: auto;
    width: 4px;
    height: auto;
    background: linear-gradient(180deg, #220660, #f91e5a, #5ce1e6);
    transform: translateX(-50%);
  }

  /* Flèche de fin - MOBILE (verticale vers le bas) */
  .gradient-timeline::after {
    top: auto;
    bottom: -25px;
    right: auto;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-top: 20px solid #5ce1e6;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-bottom: none;
    animation: arrowPulseMobile 2s ease-in-out infinite;
  }

  /* Animation mobile adaptée */
  @keyframes arrowPulseMobile {
    0%, 100% { 
      opacity: 1; 
      transform: translateX(-50%) scale(1);
    }
    50% { 
      opacity: 0.7; 
      transform: translateX(-50%) scale(1.1);
    }
  }

  /* cartes en mobile */
  .timeline-step {
    flex: none;
    margin-bottom: 30px;
    padding: 25px 20px 20px;
    position: relative;
    max-width: 100%;
  }

  .timeline-step:last-child {
    margin-bottom: 0;
  }

  /* cercles de connexion repositionnés pour mobile */
  .timeline-step::before {
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 30px;
  }

  /* le premier bloc a aussi un cercle en mobile */
  .timeline-step:first-child::before {
    display: block;
  }

  /* cartes actives plus discrètes sur mobile */
  .timeline-step.active {
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
  }

  .timeline-step:hover:not(.active) {
    transform: scale(1.01);
  }

  /* bordures dégradées adaptées pour mobile */
  .timeline-step:nth-child(odd)::after,
  .timeline-step:nth-child(even)::after {
    top: 0;
    bottom: auto;
    height: 6px;
    background: linear-gradient(90deg, #f91e5a, #5ce1e6);
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
  }

  /* textes et espacements optimisés pour mobile */
  .timeline-step .icon {
    font-size: 24px;
    margin-bottom: 8px;
  }

  .timeline-step h3 {
    font-size: 16px;
    margin-bottom: 8px;
  }

  .timeline-step .badge {
    font-size: 12px;
    padding: 3px 10px;
    margin: 6px 0 10px;
  }

  .timeline-step .desc {
    font-size: 13px;
    margin-top: 8px;
  }

  .timeline-step .desc ul {
    padding-left: 16px;
    margin: 8px 0 0;
  }

  .timeline-step .desc ul li {
    font-size: 13px;
    margin-bottom: 4px;
  }
}

/* Très petits écrans */
@media (max-width: 480px) {
  .gradient-timeline {
    padding: 0 15px;
  }
  
  .timeline-step {
    padding: 20px 15px 15px;
    margin-bottom: 25px;
  }
  
  .timeline-step .icon {
    font-size: 22px;
  }
  
  .timeline-step h3 {
    font-size: 15px;
  }
}