/* ============================================================
   GLOBAL ESSOR — FAQ PREMIUM (2 colonnes)
   · Items animés en accordéon (toggle + → ×)
   · Numérotation 01-06 + bordure dégradée à l'ouverture
   · CTA avec shine sweep
   · Animations rejouables au scroll
   · Scope strict : #faq.bb-faq
   ============================================================ */

/* ============================================================
   RESET + TOKENS (alignés sur la home)
   ============================================================ */
#faq.bb-faq,
#faq.bb-faq *,
#faq.bb-faq *::before,
#faq.bb-faq *::after {
  box-sizing: border-box;
}

#faq.bb-faq h2 {
  display: block;
  white-space: normal;
  position: static;
  max-width: none;
  overflow: visible;
}

#faq.bb-faq {
  --bb-ink:         #0B1B2B;
  --bb-ink-soft:    #3A4A5A;
  --bb-ink-mute:    #5A6B7B;
  --bb-line:        #E8EEF6;
  --bb-bg:          #FFFFFF;
  --bb-radius:      18px;
  --bb-ease:        cubic-bezier(0.16, 1, 0.3, 1);
  --bb-font: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  position: relative;
  font-family: var(--bb-font);
  background: #FFFFFF;
  overflow: hidden;
  isolation: isolate;
}

#faq.bb-faq .bb-faq__inner {
  position: relative;
  z-index: 1;
  width: min(1200px, calc(100% - 40px));
  margin: 0 auto;
  padding: 110px 0;
}

/* ============================================================
   HEADER
   ============================================================ */
#faq.bb-faq .bb-faq__head {
  max-width: 720px;
  margin: 0 auto 56px;
  text-align: center;
}

#faq.bb-faq .bb-faq__kicker {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px 7px 16px;
  margin: 0 0 22px;
  border-radius: 999px;
  background: rgba(var(--color-blue-rgb), 0.08);
  border: 1px solid rgba(var(--color-blue-rgb), 0.16);
  color: var(--color-blue);
  font-family: var(--bb-font);
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  line-height: 1;
  overflow: hidden;
  isolation: isolate;
}

#faq.bb-faq .bb-faq__kicker::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--color-blue);
  box-shadow: 0 0 0 0 rgba(var(--color-blue-rgb), 0.55), 0 0 8px rgba(47, 123, 255, 0.65);
  animation: bb-faq-pulse 2.6s ease-out infinite;
  flex-shrink: 0;
}

#faq.bb-faq .bb-faq__kicker::after {
  content: "";
  position: absolute;
  top: 0;
  left: -60%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(47, 123, 255, 0.24) 50%, transparent);
  animation: bb-faq-shimmer 8s ease-in-out infinite;
  pointer-events: none;
  z-index: -1;
}

@keyframes bb-faq-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(var(--color-blue-rgb), 0.6), 0 0 8px rgba(47, 123, 255, 0.65); }
  70%  { box-shadow: 0 0 0 8px rgba(var(--color-blue-rgb), 0), 0 0 8px rgba(47, 123, 255, 0.65); }
  100% { box-shadow: 0 0 0 0 rgba(var(--color-blue-rgb), 0), 0 0 8px rgba(47, 123, 255, 0.65); }
}

@keyframes bb-faq-shimmer {
  0%, 72%, 100% { transform: translateX(0); opacity: 0; }
  82%           { opacity: 1; }
  92%           { transform: translateX(370%); opacity: 0; }
}

#faq.bb-faq .bb-faq__title {
  max-width: 18ch;
  margin: 0 auto 16px;
  color: var(--bb-ink);
  font-family: var(--bb-font);
  font-size: clamp(32px, 3.4vw, 48px);
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

#faq.bb-faq .bb-faq__title-accent {
  position: relative;
  display: inline-block;
  color: var(--color-blue);
  white-space: nowrap;
}

#faq.bb-faq .bb-faq__title-accent::after {
  content: "" !important;
  position: absolute !important;
  bottom: 4px !important;
  left: -4px !important;
  right: -4px !important;
  height: 16px !important;
  background: rgba(47, 123, 255, 0.35) !important;
  background-image: none !important;
  border-radius: 4px !important;
  z-index: 0 !important;
  display: block !important;
  pointer-events: none;
  /* Animation : la barre se déploie de gauche à droite au scroll */
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 1.1s cubic-bezier(0.22, 1, 0.36, 1) 0.2s;
}

#faq.bb-faq.is-in-view .bb-faq__title-accent::after {
  transform: scaleX(1);
}

#faq.bb-faq .bb-faq__subtitle {
  max-width: 580px;
  margin: 0 auto;
  color: var(--bb-ink-soft);
  font-family: var(--bb-font);
  font-size: 16.5px;
  font-weight: 400;
  line-height: 1.7;
}

/* Header reveal */
@media (prefers-reduced-motion: no-preference) {
  #faq.bb-faq .bb-faq__kicker,
  #faq.bb-faq .bb-faq__title,
  #faq.bb-faq .bb-faq__subtitle {
    opacity: 0;
    transform: translateY(28px);
    filter: blur(6px);
    transition:
      opacity 0.9s var(--bb-ease),
      transform 1s var(--bb-ease),
      filter 0.9s var(--bb-ease);
  }
  #faq.bb-faq.is-in-view .bb-faq__kicker   { opacity: 1; transform: none; filter: none; transition-delay: 0.05s; }
  #faq.bb-faq.is-in-view .bb-faq__title    { opacity: 1; transform: none; filter: none; transition-delay: 0.18s; }
  #faq.bb-faq.is-in-view .bb-faq__subtitle { opacity: 1; transform: none; filter: none; transition-delay: 0.32s; }
}

/* ============================================================
   LIST — 2 COLONNES
   ============================================================ */
#faq.bb-faq .bb-faq__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

/* ============================================================
   ITEM — details/summary
   ============================================================ */
#faq.bb-faq .bb-faq__item {
  position: relative;
  border-radius: var(--bb-radius);
  background: linear-gradient(180deg, #FFFFFF 0%, #FAFBFD 100%);
  border: 1px solid rgba(11, 27, 43, 0.08);
  box-shadow: 0 8px 24px rgba(11, 27, 43, 0.05);
  overflow: hidden;
  isolation: isolate;
  transition:
    border-color 0.4s ease,
    box-shadow 0.5s ease,
    background 0.4s ease,
    opacity 0.85s var(--bb-ease),
    transform 0.85s var(--bb-ease);

  opacity: 0;
  transform: translateY(20px);
}

/* Gradient border qui apparaît à l'ouverture */
#faq.bb-faq .bb-faq__item::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(var(--color-blue-rgb), 0.55), rgba(47, 123, 255, 0.3) 40%, transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  z-index: 1;
}

#faq.bb-faq .bb-faq__item:hover {
  border-color: rgba(var(--color-blue-rgb), 0.18);
  box-shadow: 0 12px 30px rgba(11, 27, 43, 0.07);
}

#faq.bb-faq .bb-faq__item.is-open {
  border-color: rgba(var(--color-blue-rgb), 0.30);
  box-shadow:
    0 20px 50px rgba(11, 27, 43, 0.10),
    0 6px 16px rgba(var(--color-blue-rgb), 0.08);
  background: linear-gradient(180deg, #FFFFFF 0%, #F8FAFE 100%);
}

#faq.bb-faq .bb-faq__item.is-open::before {
  opacity: 1;
}

/* Cascade reveal — par paires (rangées de 2) */
#faq.bb-faq.is-in-view .bb-faq__item { opacity: 1; transform: translateY(0); }
#faq.bb-faq.is-in-view .bb-faq__item:nth-child(1) { transition-delay: 0.46s; }
#faq.bb-faq.is-in-view .bb-faq__item:nth-child(2) { transition-delay: 0.52s; }
#faq.bb-faq.is-in-view .bb-faq__item:nth-child(3) { transition-delay: 0.60s; }
#faq.bb-faq.is-in-view .bb-faq__item:nth-child(4) { transition-delay: 0.66s; }
#faq.bb-faq.is-in-view .bb-faq__item:nth-child(5) { transition-delay: 0.74s; }
#faq.bb-faq.is-in-view .bb-faq__item:nth-child(6) { transition-delay: 0.80s; }

/* ============================================================
   QUESTION (summary)
   ============================================================ */
#faq.bb-faq .bb-faq__q {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px 22px 22px 24px;
  cursor: pointer;
  list-style: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

#faq.bb-faq .bb-faq__q::-webkit-details-marker { display: none; }
#faq.bb-faq .bb-faq__q::marker                  { display: none; content: ""; }

#faq.bb-faq .bb-faq__num {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  color: var(--color-blue);
  font-family: var(--bb-font);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: -0.005em;
  line-height: 1;
  opacity: 0.5;
  transition: opacity 0.4s ease, transform 0.4s var(--bb-ease);
}

#faq.bb-faq .bb-faq__item:hover .bb-faq__num,
#faq.bb-faq .bb-faq__item.is-open .bb-faq__num {
  opacity: 1;
}

#faq.bb-faq .bb-faq__item.is-open .bb-faq__num {
  transform: scale(1.08);
}

#faq.bb-faq .bb-faq__q-text {
  flex: 1 1 auto;
  color: var(--bb-ink);
  font-family: var(--bb-font);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: -0.01em;
  text-wrap: balance;
  transition: color 0.3s ease;
}

#faq.bb-faq .bb-faq__item:hover .bb-faq__q-text {
  color: var(--color-blue-deep);
}

/* ============================================================
   TOGGLE — + qui se transforme en × à l'ouverture
   ============================================================ */
#faq.bb-faq .bb-faq__toggle {
  position: relative;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: rgba(var(--color-blue-rgb), 0.08);
  border: 1px solid rgba(var(--color-blue-rgb), 0.18);
  transition:
    background 0.45s var(--bb-ease),
    border-color 0.45s ease,
    transform 0.5s var(--bb-ease),
    box-shadow 0.45s ease;
}

#faq.bb-faq .bb-faq__toggle::before,
#faq.bb-faq .bb-faq__toggle::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 13px;
  height: 1.8px;
  background: var(--color-blue);
  border-radius: 999px;
  transition:
    transform 0.5s var(--bb-ease),
    background 0.45s ease;
}

#faq.bb-faq .bb-faq__toggle::before {
  transform: translate(-50%, -50%) rotate(0deg);
}

#faq.bb-faq .bb-faq__toggle::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

#faq.bb-faq .bb-faq__item:hover .bb-faq__toggle {
  background: rgba(var(--color-blue-rgb), 0.14);
  border-color: rgba(var(--color-blue-rgb), 0.30);
}

/* État ouvert : + devient × + bouton bleu dégradé */
#faq.bb-faq .bb-faq__item.is-open .bb-faq__toggle {
  background: linear-gradient(135deg, var(--color-blue-bright) 0%, var(--color-blue) 100%);
  border-color: transparent;
  box-shadow:
    0 8px 18px rgba(var(--color-blue-rgb), 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
  transform: rotate(180deg);
}

#faq.bb-faq .bb-faq__item.is-open .bb-faq__toggle::before {
  background: #FFFFFF;
  transform: translate(-50%, -50%) rotate(45deg);
}

#faq.bb-faq .bb-faq__item.is-open .bb-faq__toggle::after {
  background: #FFFFFF;
  transform: translate(-50%, -50%) rotate(135deg);
}

/* ============================================================
   ANSWER — grid-template-rows animation trick
   ============================================================ */
#faq.bb-faq .bb-faq__a {
  display: grid;
  grid-template-rows: 0fr;
  transition:
    grid-template-rows 0.5s var(--bb-ease),
    opacity 0.4s ease;
  opacity: 0;
}

#faq.bb-faq .bb-faq__item.is-open .bb-faq__a {
  grid-template-rows: 1fr;
  opacity: 1;
}

#faq.bb-faq .bb-faq__a-inner {
  min-height: 0;
  overflow: hidden;
}

#faq.bb-faq .bb-faq__a-inner p {
  margin: 0;
  padding: 0 24px 24px 72px;
  color: var(--bb-ink-soft);
  font-family: var(--bb-font);
  font-size: 14.5px;
  font-weight: 400;
  line-height: 1.75;
}

/* Trait subtil au-dessus de la réponse */
#faq.bb-faq .bb-faq__a-inner p::before {
  content: "";
  display: block;
  width: 40px;
  height: 2px;
  margin: 0 0 16px;
  background: linear-gradient(90deg, var(--color-blue), var(--color-blue-bright));
  border-radius: 2px;
  opacity: 0;
  transform: scaleX(0);
  transform-origin: left center;
  transition: opacity 0.4s ease 0.15s, transform 0.5s var(--bb-ease) 0.15s;
}

#faq.bb-faq .bb-faq__item.is-open .bb-faq__a-inner p::before {
  opacity: 1;
  transform: scaleX(1);
}

/* ============================================================
   CTA
   ============================================================ */
#faq.bb-faq .bb-faq__cta {
  margin-top: 48px;
  padding: 32px;
  border-radius: 22px;
  background:
    radial-gradient(500px circle at 10% 10%, rgba(47, 123, 255, 0.08), transparent 50%),
    #FFFFFF;
  border: 1px solid rgba(var(--color-blue-rgb), 0.12);
  box-shadow: 0 16px 42px rgba(11, 27, 43, 0.06);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  text-align: center;

  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.85s var(--bb-ease), transform 0.85s var(--bb-ease);
}

#faq.bb-faq.is-in-view .bb-faq__cta {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 1.0s;
}

#faq.bb-faq .bb-faq__cta-text {
  margin: 0;
  color: var(--bb-ink);
  font-family: var(--bb-font);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.4;
}

#faq.bb-faq .bb-faq__btn {
  all: unset;
  box-sizing: border-box;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 14px;
  background: linear-gradient(180deg, var(--color-blue-bright) 0%, var(--color-blue) 100%);
  color: #FFFFFF;
  font-family: var(--bb-font);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: -0.005em;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  box-shadow:
    0 18px 36px rgba(var(--color-blue-rgb), 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
  transition:
    transform 0.25s var(--bb-ease),
    box-shadow 0.25s var(--bb-ease),
    filter 0.25s ease;
}

#faq.bb-faq .bb-faq__btn::after {
  content: "";
  position: absolute;
  top: -50%;
  left: -60%;
  width: 30%;
  height: 200%;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.45) 50%, transparent);
  transform: translateX(-100%) rotate(15deg);
  transition: transform 0.8s var(--bb-ease);
  pointer-events: none;
  z-index: 1;
}

#faq.bb-faq .bb-faq__btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
  transition: transform 0.3s var(--bb-ease);
}

#faq.bb-faq .bb-faq__btn span {
  position: relative;
  z-index: 2;
}

#faq.bb-faq .bb-faq__btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.05) saturate(1.08);
  box-shadow:
    0 26px 50px rgba(var(--color-blue-rgb), 0.30),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

#faq.bb-faq .bb-faq__btn:hover::after { transform: translateX(500%) rotate(15deg); }
#faq.bb-faq .bb-faq__btn:hover svg     { transform: translateX(3px); }

/* ============================================================
   RESPONSIVE — bascule en 1 colonne sur tablette
   ============================================================ */
@media (max-width: 900px) {
  #faq.bb-faq .bb-faq__list {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

@media (max-width: 700px) {
  #faq.bb-faq .bb-faq__inner   { padding: 72px 0; }
  #faq.bb-faq .bb-faq__head    { margin-bottom: 40px; }
  #faq.bb-faq .bb-faq__title   { font-size: 30px; }
  #faq.bb-faq .bb-faq__title-accent { white-space: normal; }

  #faq.bb-faq .bb-faq__q {
    padding: 18px 18px 18px 18px;
    gap: 12px;
  }
  #faq.bb-faq .bb-faq__num { min-width: 24px; font-size: 12px; }
  #faq.bb-faq .bb-faq__q-text { font-size: 15px; }
  #faq.bb-faq .bb-faq__toggle { width: 32px; height: 32px; }

  #faq.bb-faq .bb-faq__a-inner p {
    padding: 0 20px 20px 54px;
    font-size: 14px;
  }

  #faq.bb-faq .bb-faq__cta {
    padding: 24px 20px;
    margin-top: 36px;
  }
  #faq.bb-faq .bb-faq__btn { width: 100%; }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  #faq.bb-faq *,
  #faq.bb-faq *::before,
  #faq.bb-faq *::after {
    animation: none !important;
    transition-duration: 0.1s !important;
  }
  #faq.bb-faq .bb-faq__kicker,
  #faq.bb-faq .bb-faq__title,
  #faq.bb-faq .bb-faq__subtitle,
  #faq.bb-faq .bb-faq__item,
  #faq.bb-faq .bb-faq__cta {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }
  #faq.bb-faq .bb-faq__title-accent::after { transform: scaleX(1) !important; }
}

/* WordPress defensive */
#faq.bb-faq h2::before,
#faq.bb-faq h2::after,
#faq.bb-faq summary::before,
#faq.bb-faq summary::after,
#faq.bb-faq summary::-webkit-details-marker {
  background: none;
  content: none;
  display: none;
}
