/* ===============================
   FAQ.CSS - Styles spécifiques page FAQ
   Cohérent avec la charte (variables déjà définies dans home.css / base)
================================== */

:root {
  /* Fallbacks si variables absentes */
  --faq-accent: var(--color-detail, #0b40e0);
  --faq-accent-rgb: 11,64,224;
  --faq-bg: var(--color-secondary, #f5f5f5);
  --faq-item-bg: #ffffff;
  --faq-item-border: rgba(0,0,0,0.06);
  --faq-radius: var(--border-radius-base, 12px);
  --faq-transition: 0.35s cubic-bezier(.4,.2,.2,1);
  --faq-shadow: 0 4px 14px -2px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
  --faq-shadow-hover: 0 10px 28px -4px rgba(0,0,0,0.15), 0 4px 10px rgba(0,0,0,0.08);
}

/* Container principal */
.faq-container {
  background: linear-gradient(135deg, var(--faq-bg) 0%, #ffffff 100%);
  position: relative;
  overflow: hidden;
}

.faq-container::before,
.faq-container::after {
  content: "";
  position: absolute;
  width: 520px;
  height: 520px;
  background: radial-gradient(circle at 30% 30%, rgba(var(--faq-accent-rgb),0.08), transparent 70%);
  top: -180px;
  left: -160px;
  pointer-events: none;
  opacity: .7;
  filter: blur(2px);
}
.faq-container::after {
  top: auto;
  bottom: -220px;
  left: auto;
  right: -220px;
  background: radial-gradient(circle at 70% 70%, rgba(var(--faq-accent-rgb),0.10), transparent 75%);
}

/* Titre principal */
.section-title {
  text-align: center;
  font-size: clamp(1.9rem, 4.2vw, 2.8rem);
  font-weight: 700;
  margin-bottom: 2.3rem;
  background: linear-gradient(90deg, var(--faq-accent) 0%, #1750fd 50%, var(--faq-accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: -0.5px;
  position: relative;
}
.section-title::after {
  content: "";
  display: block;
  width: 70px;
  height: 4px;
  border-radius: 4px;
  margin: 0.9rem auto 0;
  background: linear-gradient(90deg, var(--faq-accent) 0%, rgba(var(--faq-accent-rgb),0.3) 100%);
  box-shadow: 0 2px 6px -1px rgba(var(--faq-accent-rgb),0.4);
}

/* Grille principale (stack vertical, possibilité multicolonnes si besoin plus tard) */
.faq-grid {
  display: flex;
  flex-direction: column;
  gap: 2.75rem;
}

/* Section wrapper */
.faq-section {
  position: relative;
  padding: 0.25rem 0 0.5rem;
}
.faq-section + .faq-section::before {
  content: "";
  position: absolute;
  top: -1.25rem;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0, rgba(0,0,0,0.08) 15%, rgba(0,0,0,0.08) 85%, transparent 100%);
}

.faq-section__title {
  font-size: clamp(1.15rem, 2.4vw, 1.45rem);
  font-weight: 600;
  margin: 0 0 1.2rem;
  color: var(--color-tertiary, #171a1c);
  display: flex;
  align-items: center;
  gap: .65rem;
  position: relative;
  line-height: 1.3;
}
.faq-section__title::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--faq-accent);
  box-shadow: 0 0 0 5px rgba(var(--faq-accent-rgb),0.18), 0 0 0 10px rgba(var(--faq-accent-rgb),0.07);
}

/* Item */
.faq-item {
  background: var(--faq-item-bg);
  border: 1px solid var(--faq-item-border);
  border-radius: var(--faq-radius);
  box-shadow: var(--faq-shadow);
  overflow: hidden;
  transition: border-color var(--faq-transition), box-shadow var(--faq-transition), transform var(--faq-transition), background-color .4s;
  position: relative;
}
.faq-item:not(.faq-item--active):hover {
  border-color: rgba(var(--faq-accent-rgb),0.5);
  box-shadow: var(--faq-shadow-hover);
  transform: translateY(-2px);
}
.faq-item--active {
  border-color: var(--faq-accent);
  box-shadow: 0 0 0 2px rgba(var(--faq-accent-rgb),0.15), var(--faq-shadow-hover);
}

/* Question */
.faq-question {
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1.05rem 1.25rem 1.05rem 1.25rem;
  position: relative;
  font-weight: 500;
  user-select: none;
  background: linear-gradient(135deg, rgba(var(--faq-accent-rgb),0.05) 0%, rgba(var(--faq-accent-rgb),0.0) 70%);
  transition: background-color var(--faq-transition), color var(--faq-transition);
}
.faq-item--active .faq-question {
  background: linear-gradient(135deg, rgba(var(--faq-accent-rgb),0.14) 0%, rgba(var(--faq-accent-rgb),0.06) 70%);
}
.faq-question:focus-visible {
  outline: 2px solid var(--faq-accent);
  outline-offset: 2px;
  border-radius: 6px;
}
.faq-question h4 {
  font-size: clamp(.95rem, 2.2vw, 1.05rem);
  margin: 0;
  line-height: 1.35;
  font-weight: 600;
  color: var(--color-text, #111);
}
.faq-item--active .faq-question h4 { color: var(--color-tertiary, #171a1c); }

/* Flèche */
.faq-arrow {
  font-size: 0.95rem;
  line-height: 1;
  margin-top: 0.2rem;
  background: var(--faq-accent);
  color: #fff;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-weight: 600;
  box-shadow: 0 4px 12px -2px rgba(var(--faq-accent-rgb),0.5);
  transition: transform var(--faq-transition), background-color var(--faq-transition), box-shadow var(--faq-transition);
  transform: rotate(0deg); /* orientation droite par défaut */
}
.faq-item--active .faq-arrow {
  transform: rotate(90deg) scale(1.05); /* orientation vers le bas quand ouvert */
  background: linear-gradient(135deg, var(--faq-accent) 0%, #1b5afc 100%);
}

/* Réponse (acc + animation hauteur) */
.faq-answer {
  padding: 0 1.6rem 0 1.6rem; /* plus d'espace latéral */
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--faq-transition), padding-top var(--faq-transition), padding-bottom var(--faq-transition), filter .45s;
  filter: blur(3px);
}
.faq-item--active .faq-answer {
  padding-top: .45rem;
  padding-bottom: 1.35rem;
  filter: blur(0);
  overflow: visible; /* permet à la vignette flottante de dépasser */
  position: relative; /* crée un contexte pour le z-index */
  z-index: 2; /* s'affiche au-dessus du titre/question */
}
.faq-answer p {
  margin: 0.65rem 0 0;
  font-size: clamp(.9rem, 1.9vw, .98rem);
  line-height: 1.55;
  color: var(--color-text, #222);
}

/* CTA bloc */
.faq-cta {
  margin-top: 2.8rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}
.faq-cta .btn {
  min-width: 220px;
  position: relative;
  overflow: hidden;
  transition: transform .35s ease, box-shadow .35s ease;
}
.faq-cta .btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.25), transparent 70%);
  opacity: 0;
  transition: opacity .5s ease;
}
.faq-cta .btn:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 28px -6px rgba(var(--faq-accent-rgb),0.4);
}
.faq-cta .btn:hover::after { opacity: .9; }

/* Animations apparition progressive */
@keyframes faqFadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
.faq-item { animation: faqFadeUp .7s ease forwards; opacity: 0; }
.faq-section .faq-item:nth-child(1) { animation-delay: .05s; }
.faq-section .faq-item:nth-child(2) { animation-delay: .1s; }
.faq-section .faq-item:nth-child(3) { animation-delay: .15s; }
.faq-section .faq-item:nth-child(4) { animation-delay: .2s; }

/* Mode réduit / Responsive */
@media (max-width: 800px) {
  .faq-grid { gap: 2.25rem; }
  .faq-question { padding: .95rem 1.05rem; gap: .9rem; }
  .faq-answer { padding-left: 1.05rem; padding-right: 1.05rem; }
  .faq-cta { justify-content: center; }
}
/* Tactile: supprimer hover intrusifs */
@media (pointer: coarse) {
  .faq-item:not(.faq-item--active):hover { transform: none; box-shadow: var(--faq-shadow); border-color: var(--faq-item-border); }
  .faq-cta .btn:hover { transform: none; box-shadow: none; }
}
@media (prefers-reduced-motion: reduce) {
  .faq-item, .faq-answer, .faq-arrow { animation: none !important; transition: none !important; }
}

/* Impression */
@media print {
  .faq-arrow { display: none; }
  .faq-answer { max-height: none !important; filter: none !important; padding: .4rem 1.25rem 1rem; }
  .faq-item { box-shadow: none; border: 1px solid #ccc; }
  .faq-cta { display: none; }
}
