/* ===== FAQ — LABEL ÉVASION ===== */
.faq-page {
  --faq-text: #0f172a;
  --faq-muted: #334155; /* WCAG AA compliant */
  --faq-soft: #334155; /* WCAG AA compliant */
  --faq-bg: #fff;
  --faq-subtle: #f8fafc;
  --faq-border: rgba(2, 6, 23, 0.08);
  --faq-border-light: rgba(2, 6, 23, 0.06);
  --faq-accent: var(--ghost-accent-color, #2563eb);
  --faq-accent-purple: #7c3aed;
  --faq-rad-lg: var(--radius-md);  /* 14px → 12px (standard) */
  --faq-rad-md: var(--radius-md);  /* Déjà 12px ✅ */
  --faq-rad-sm: var(--radius-sm);  /* Déjà 8px ✅ */
  --faq-shadow-lg: 0 10px 26px rgba(2, 6, 23, 0.06);
  --faq-shadow-md: 0 8px 20px rgba(2, 6, 23, 0.06);
  --faq-wrap-max: 1360px;
  font-family: var(--codex-body-font);
}

.faq-wrap {
  max-width: var(--faq-wrap-max);
  margin: 0 auto;
  padding: 0 4vw;
}

/* ===== EN-TÊTE ===== */
.faq-header {
  text-align: center;
  margin-bottom: 32px;
}

.faq-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  background: var(--faq-border-light);
  padding: 0.48em 0.95em;
  border-radius:var(--radius-pill);
  font-weight: 800;
  color: var(--faq-text);
  font-size: 0.95rem;
  margin-bottom: 12px;
}

.faq-badge__icon {
  font-size: 1.1em;
}

.faq-title {
  margin: 0.4em 0 0.25em 0;
  font-weight: 900;
  letter-spacing: 0.3px;
  font-size: clamp(1.8rem, 3.2vw, 2.4rem);
  color: var(--faq-text);
}

.faq-subtitle {
  margin: 0 auto 24px;
  color: var(--faq-muted);
  max-width: 880px;
  font-size: clamp(1.02rem, 1.8vw, 1.12rem);
  line-height: 1.5;
}

/* ===== RECHERCHE ===== */
.faq-search {
  max-width: 720px;
  margin: 0 auto 16px;
  position: relative;
}

.faq-search input {
  width: 100%;
  padding: 14px 44px 14px 14px;
  border-radius: var(--faq-rad-md);
  border: 1px solid var(--faq-border);
  box-shadow: var(--faq-shadow-md);
  font-size: 1rem;
  outline: none;
  font-family: inherit;
  color: var(--faq-text);
  background: var(--faq-bg);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.faq-search input:focus {
  border-color: var(--faq-accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1), 0 8px 24px rgba(37, 99, 235, 0.15);
}

.faq-search__icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--faq-soft);
  pointer-events: none;
}

.faq-help {
  margin: 0;
  color: #4a5568;
  font-size: 0.95rem;
}

/* ===== ACCORDÉON ===== */
.faq-accordion {
  max-width: 1000px;
  margin: 0 auto 32px;
  display: grid;
  gap: 12px;
}

.faq-item {
  background: var(--faq-bg);
  border: 1px solid var(--faq-border);
  border-radius: var(--faq-rad-lg);
  box-shadow: var(--faq-shadow-lg);
  overflow: hidden;
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  will-change: transform;
  position: relative;
  isolation: isolate;
}
.faq-item:focus-within{
  box-shadow: 0 10px 24px rgba(2, 6, 23, 0.10);
  border-color: rgba(37, 99, 235, 0.12);
  transform: translateY(-1px);
}

.faq-item:hover {
  box-shadow: 0 10px 22px rgba(2, 6, 23, 0.08);
  transform: translateY(-0.5px);
  border-color: rgba(37, 99, 235, 0.10);
  background: color-mix(in oklab, #fff 98.5%, var(--faq-accent) 1.5%);
}

.faq-question {
  all: unset;
  display: flex;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 16px 16px 16px 14px;
  cursor: pointer;
  transition: background 0.16s ease, transform 0.16s ease, color 0.16s ease;
}

.faq-question:hover {
  background: color-mix(in oklab, var(--faq-subtle) 86%, #fff 14%);
  transform: translateX(1px);
}
.faq-question.is-hover{
  background: color-mix(in oklab, var(--faq-subtle) 86%, #fff 14%);
}

.faq-question:focus-visible {
  outline: 2px solid var(--faq-accent);
  outline-offset: -2px;
  background: color-mix(in oklab, var(--faq-subtle) 70%, #fff 30%);
}

.faq-question__icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: var(--faq-rad-sm);
  background: rgba(37, 99, 235, 0.12);
  font-size: 1.1rem;
  flex-shrink: 0;
}

.faq-question__text {
  font-weight: 800;
  color: var(--faq-text);
  flex: 1;
  text-align: left;
  font-size: 1.02rem;
}

.faq-question__chevron {
  color: var(--faq-text);
  flex-shrink: 0;
  transition: transform 0.2s ease, color 0.2s ease;
}

.faq-question[aria-expanded="true"] .faq-question__chevron {
  transform: rotate(180deg);
  color: var(--faq-accent);
}

.faq-answer {
  padding: 0 16px 0 54px;
  color: var(--faq-muted);
  line-height: 1.6;
  font-size: 1rem;
  display: grid;
  grid-template-rows: 0fr;
  overflow: hidden;
  opacity: 0;
  transition: grid-template-rows .35s ease, opacity .25s ease, padding .25s ease;
}

.faq-answer__body {
  overflow: hidden;
  color: inherit;
  position: relative;
}

.faq-answer strong {
  color: var(--faq-text);
  font-weight: 800;
}

.faq-answer a {
  color: var(--faq-accent);
  font-weight: 800;
  text-decoration: none;
}

.faq-answer a:hover {
  text-decoration: underline;
}

.faq-answer.is-open {
  grid-template-rows: 1fr;
  opacity: 1;
  padding: 0 16px 16px 54px;
}

.faq-item.is-open .faq-answer__body {
  animation: faq-slide .35s ease;
}

@keyframes faq-slide {
  from { transform: translateY(-4px); opacity: .9; }
  to { transform: translateY(0); opacity: 1; }
}

.faq-empty {
  margin: 18px auto 10px;
  max-width: 880px;
  text-align: center;
  padding: 14px 16px;
  border-radius: var(--faq-rad-md);
  border: 1px dashed var(--faq-border);
  background: var(--faq-subtle);
  color: var(--faq-muted);
  font-weight: 800;
  letter-spacing: 0.1px;
}

/* ===== CTA BAS DE PAGE ===== */
.faq-cta {
  text-align: center;
  margin: 32px 0 16px;
}

.faq-cta__btn {
  display: inline-block;
  background: linear-gradient(90deg, var(--faq-accent), var(--faq-accent-purple));
  color: #fff;
  padding: 0.9em 1.4em;
  border-radius: var(--faq-rad-md);
  font-weight: 850;
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(2, 6, 23, 0.18);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  font-size: 1rem;
}

.faq-cta__btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(2, 6, 23, 0.22);
  color: #fff; /* ✅ Garantir texte blanc au hover */
}

.faq-cta__btn:focus-visible {
  outline: 2px solid var(--faq-accent);
  outline-offset: 3px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: var(--bp-md)) {
  .faq-answer {
    padding-left: 14px;
  }

  .faq-question {
    padding: 14px 12px;
    gap: 10px;
  }

  .faq-question__icon {
    width: 24px;
    height: 24px;
    font-size: 1rem;
  }
}

/* ===== ANIMATIONS AMÉLIORÉES ===== */

/* Animation fluide de l'accordéon */
.faq-item {
  overflow: hidden;
}

.faq-question {
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.faq-question::after {
  content: '';
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7' /%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0.5;
}

.faq-question:hover {
  background-color: rgba(0, 0, 0, 0.02);
}

.faq-question:hover::after {
  opacity: 1;
}

.faq-item.is-open .faq-question::after {
  transform: translateY(-50%) rotate(180deg);
}

.faq-answer {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.3s ease,
              padding 0.3s ease;
}

.faq-item.is-open .faq-answer {
  max-height: 1000px;
  opacity: 1;
}

/* Animation du contenu à l'intérieur */
.faq-answer__body > * {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease,
              transform 0.3s ease;
}

.faq-item.is-open .faq-answer__body > * {
  opacity: 1;
  transform: translateY(0);
}

/* Délai progressif pour le contenu enfant */
.faq-item.is-open .faq-answer__body > *:nth-child(1) { transition-delay: 0.1s; }
.faq-item.is-open .faq-answer__body > *:nth-child(2) { transition-delay: 0.15s; }
.faq-item.is-open .faq-answer__body > *:nth-child(3) { transition-delay: 0.2s; }

/* ===== ANIMATION RÉDUITE ===== */
@media (prefers-reduced-motion: reduce) {
  .faq-question,
  .faq-item,
  .faq-answer,
  .faq-answer__body,
  .faq-answer__body > *,
  .faq-cta__btn,
  .faq-question::after {
    transition: none;
    animation: none;
  }
}
