/* =========================================================================
   IDENTITÉ DE MARQUE — Section "Le fonctionnement"
   · Timeline horizontale 3 étapes avec rail lumineux + checkpoints
   · Banner de réassurance en bas
   · Mobile : stack vertical avec rail à gauche
   ========================================================================= */

.bb-id-flow,
.bb-id-flow *,
.bb-id-flow *::before,
.bb-id-flow *::after {
  box-sizing: border-box;
}

.bb-id-flow h2,
.bb-id-flow h3 {
  display: block;
  white-space: normal;
  position: static;
  max-width: none;
  overflow: visible;
}

.bb-id-flow {
  --bb-ink:         #0B1B2B;
  --bb-ink-soft:    #3A4A5A;
  --bb-ink-mute:    #5A6B7B;
  --bb-line:        #E8EEF6;
  --bb-green:       #22C55E;
  --bb-green-deep:  #1B9B5A;
  --bb-radius:      20px;
  --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;
}

.bb-id-flow__inner {
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
  padding: 110px 0;
  position: relative;
  z-index: 1;
}

/* =========================================================================
   HEADER
   ========================================================================= */
.bb-id-flow__head {
  margin: 0 auto 80px;
  max-width: 880px;
  text-align: center;
}

.bb-id-flow__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);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-blue);
  max-width: max-content;
  overflow: hidden;
  isolation: isolate;
}

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

.bb-id-flow__kicker::before {
  content: "";
  position: relative;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--color-blue);
  box-shadow: 0 0 0 0 rgba(var(--color-blue-rgb), 0.5), 0 0 8px rgba(47, 123, 255, 0.6);
  flex-shrink: 0;
  z-index: 1;
  animation: bb-id-flow-pulse 2.5s ease-out infinite;
}

@keyframes bb-id-flow-shimmer {
  0%, 70%, 100% { transform: translateX(0); opacity: 0; }
  80%           { opacity: 1; }
  90%           { transform: translateX(400%); opacity: 0; }
}

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

.bb-id-flow__title {
  font-family: var(--bb-font);
  font-size: clamp(32px, 3.4vw, 50px);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin: 0 auto 20px;
  color: var(--bb-ink);
  max-width: 24ch;
  text-wrap: balance;
}

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

.bb-id-flow__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;
}

.bb-id-flow.is-in-view .bb-id-flow__title-accent::after {
  transform: scaleX(1);
}

.bb-id-flow__subtitle {
  font-size: 17px;
  line-height: 1.65;
  margin: 0 auto;
  color: var(--bb-ink-soft);
  max-width: 660px;
}

@media (prefers-reduced-motion: no-preference) {
  .bb-id-flow__kicker,
  .bb-id-flow__title,
  .bb-id-flow__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);
  }
  .bb-id-flow.is-in-view .bb-id-flow__kicker   { opacity: 1; transform: none; filter: none; transition-delay: 0.05s; }
  .bb-id-flow.is-in-view .bb-id-flow__title    { opacity: 1; transform: none; filter: none; transition-delay: 0.18s; }
  .bb-id-flow.is-in-view .bb-id-flow__subtitle { opacity: 1; transform: none; filter: none; transition-delay: 0.32s; }
}

/* =========================================================================
   TIMELINE — rail + checkpoints + steps
   ========================================================================= */
.bb-id-flow__timeline {
  position: relative;
  padding-top: 36px;
  margin-bottom: 64px;
}

/* RAIL horizontal lumineux */
.bb-id-flow__rail {
  position: absolute;
  top: 16px;
  left: 16%;
  right: 16%;
  height: 3px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(var(--color-blue-rgb), 0.55) 6%,
    rgba(47, 123, 255, 0.95) 50%,
    rgba(var(--color-blue-rgb), 0.55) 94%,
    transparent 100%);
  box-shadow:
    0 0 12px rgba(47, 123, 255, 0.45),
    0 0 24px rgba(47, 123, 255, 0.20);
  border-radius: 3px;
  z-index: 1;
  overflow: hidden;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 1.3s var(--bb-ease);
}

.bb-id-flow.is-in-view .bb-id-flow__rail {
  transform: scaleX(1);
  transition-delay: 0.5s;
}

.bb-id-flow__railLight {
  position: absolute;
  top: -2px;
  left: -25%;
  width: 30%;
  height: calc(100% + 4px);
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(47, 123, 255, 0.95) 40%,
    rgba(255, 255, 255, 1) 50%,
    rgba(47, 123, 255, 0.95) 60%,
    transparent 100%);
  filter: blur(2px);
  border-radius: 999px;
}

@keyframes bb-id-flow-light {
  0%   { left: -25%; opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { left: 95%;  opacity: 0; }
}

@media (prefers-reduced-motion: no-preference) {
  .bb-id-flow.is-in-view .bb-id-flow__railLight {
    animation: bb-id-flow-light 6s ease-in-out 2.2s infinite;
  }
}

/* CHECKPOINTS positionnés au-dessus du rail */
.bb-id-flow__checkpoints {
  position: absolute;
  top: 9px;
  left: 0;
  right: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  justify-items: center;
  z-index: 2;
  pointer-events: none;
}

.bb-id-flow__checkpoint {
  position: relative;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #FFFFFF;
  border: 2px solid var(--color-blue);
  box-shadow:
    0 0 0 4px #FFFFFF,
    0 8px 18px rgba(var(--color-blue-rgb), 0.30);
}

.bb-id-flow__checkpoint::before {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--color-blue), var(--color-blue-bright));
  transform: scale(0);
  transition: transform 0.6s var(--bb-ease);
}

.bb-id-flow.is-in-view .bb-id-flow__checkpoint:nth-child(1)::before { transform: scale(1); transition-delay: 0.85s; }
.bb-id-flow.is-in-view .bb-id-flow__checkpoint:nth-child(2)::before { transform: scale(1); transition-delay: 1.00s; }
.bb-id-flow.is-in-view .bb-id-flow__checkpoint:nth-child(3)::before { transform: scale(1); transition-delay: 1.15s; }

/* STEPS grid */
.bb-id-flow__steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  padding-top: 56px;
  list-style: none;
  margin: 0;
}

.bb-id-flow__step {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* GROS NUMÉROS */
.bb-id-flow__num {
  font-family: var(--bb-font);
  font-size: 40px;
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--color-blue);
  margin-bottom: 22px;

  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s var(--bb-ease), transform 0.7s var(--bb-ease), color 0.5s ease;
}

.bb-id-flow.is-in-view .bb-id-flow__step:nth-child(1) .bb-id-flow__num { opacity: 1; transform: translateY(0); transition-delay: 0.95s; }
.bb-id-flow.is-in-view .bb-id-flow__step:nth-child(2) .bb-id-flow__num { opacity: 1; transform: translateY(0); transition-delay: 1.10s; }
.bb-id-flow.is-in-view .bb-id-flow__step:nth-child(3) .bb-id-flow__num { opacity: 1; transform: translateY(0); transition-delay: 1.25s; }

.bb-id-flow__step:hover .bb-id-flow__num {
  color: var(--color-blue-bright);
}

/* CARTES */
.bb-id-flow__card {
  width: 100%;
  padding: 32px 24px 28px;
  border-radius: var(--bb-radius);
  background: linear-gradient(180deg, #FFFFFF 0%, #F8FAFE 100%);
  border: 1px solid rgba(var(--color-blue-rgb), 0.10);
  box-shadow: 0 8px 24px rgba(11, 27, 43, 0.05);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.9s var(--bb-ease),
    transform 0.55s var(--bb-ease),
    box-shadow 0.5s ease,
    border-color 0.5s ease;
}

.bb-id-flow.is-in-view .bb-id-flow__step:nth-child(1) .bb-id-flow__card { opacity: 1; transform: translateY(0); transition-delay: 1.10s; }
.bb-id-flow.is-in-view .bb-id-flow__step:nth-child(2) .bb-id-flow__card { opacity: 1; transform: translateY(0); transition-delay: 1.25s; }
.bb-id-flow.is-in-view .bb-id-flow__step:nth-child(3) .bb-id-flow__card { opacity: 1; transform: translateY(0); transition-delay: 1.40s; }

/* Shine sweep au hover */
.bb-id-flow__card::after {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 50%;
  height: 200%;
  background: linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.7) 50%, transparent 100%);
  transform: translateX(-100%) rotate(15deg);
  transition: transform 1.2s var(--bb-ease);
  pointer-events: none;
  z-index: 2;
  opacity: 0.7;
}

.bb-id-flow__card:hover {
  transform: translateY(-6px);
  border-color: rgba(var(--color-blue-rgb), 0.22);
  box-shadow:
    0 28px 60px rgba(var(--color-blue-rgb), 0.15),
    0 10px 24px rgba(11, 27, 43, 0.08);
}

.bb-id-flow__card:hover::after { transform: translateX(400%) rotate(15deg); }

.bb-id-flow__cardIcon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--color-blue) 0%, var(--color-blue-bright) 100%);
  color: #FFFFFF;
  margin: 0 auto 20px;
  box-shadow:
    0 10px 22px rgba(var(--color-blue-rgb), 0.30),
    inset 0 1px 0 rgba(255, 255, 255, 0.40);
  transition: transform 0.5s var(--bb-ease);
  position: relative;
  z-index: 1;
}

.bb-id-flow__card:hover .bb-id-flow__cardIcon {
  transform: rotate(-6deg) scale(1.08);
}

.bb-id-flow__cardIcon svg {
  width: 22px;
  height: 22px;
}

.bb-id-flow__cardTitle {
  position: relative;
  font-family: var(--bb-font);
  font-size: 19px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--bb-ink);
  margin: 0 0 10px;
  z-index: 1;
}

.bb-id-flow__cardText {
  position: relative;
  font-family: var(--bb-font);
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--bb-ink-soft);
  margin: 0;
  z-index: 1;
}

/* =========================================================================
   BANNER DE RÉASSURANCE
   ========================================================================= */
.bb-id-flow__reassure {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 28px;
  border-radius: 999px;
  background: linear-gradient(180deg, #FFFFFF 0%, rgba(var(--color-blue-rgb), 0.04) 100%);
  border: 1px solid rgba(var(--color-blue-rgb), 0.12);
  box-shadow:
    0 14px 40px rgba(11, 27, 43, 0.06),
    0 4px 12px rgba(11, 27, 43, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
  max-width: 780px;
  margin: 0 auto;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.9s var(--bb-ease), transform 0.9s var(--bb-ease);
}

.bb-id-flow.is-in-view .bb-id-flow__reassure {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 1.65s;
}

.bb-id-flow__reassureIcon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--bb-green-deep), var(--bb-green));
  color: #FFFFFF;
  flex-shrink: 0;
  box-shadow:
    0 6px 16px rgba(34, 197, 94, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.30);
}

.bb-id-flow__reassureIcon svg {
  width: 18px;
  height: 18px;
}

.bb-id-flow__reassureText {
  font-family: var(--bb-font);
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--bb-ink-soft);
  margin: 0;
}

.bb-id-flow__reassureText strong {
  color: var(--bb-ink);
  font-weight: 700;
}

/* =========================================================================
   RESPONSIVE
   ========================================================================= */
@media (max-width: 1100px) {
  .bb-id-flow__inner { padding: 90px 0; }
  .bb-id-flow__num { font-size: 36px; }
}

@media (max-width: 760px) {
  .bb-id-flow__inner { padding: 72px 0; }
  .bb-id-flow__head  { margin-bottom: 56px; }
  .bb-id-flow__title { font-size: 30px; letter-spacing: -0.02em; }

  .bb-id-flow__title-accent {
    white-space: normal;
    background-image: linear-gradient(to top, rgba(47, 123, 255, 0.22) 8px, transparent 8px);
    background-repeat: no-repeat;
    background-size: 100% 100%;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
    padding: 0 2px;
  }
  .bb-id-flow__title-accent::after { display: none; }

  /* Cache le rail horizontal + checkpoints sur mobile */
  .bb-id-flow__timeline       { padding-top: 0; margin-bottom: 40px; }
  .bb-id-flow__rail,
  .bb-id-flow__checkpoints    { display: none; }

  /* Stack vertical avec rail vertical à gauche */
  .bb-id-flow__steps {
    grid-template-columns: 1fr;
    gap: 28px;
    padding-top: 0;
    padding-left: 56px;
    position: relative;
  }

  /* Rail vertical à gauche */
  .bb-id-flow__steps::before {
    content: "";
    position: absolute;
    left: 24px;
    top: 24px;
    bottom: 24px;
    width: 3px;
    border-radius: 3px;
    background: linear-gradient(180deg,
      transparent 0%,
      rgba(var(--color-blue-rgb), 0.4) 6%,
      rgba(47, 123, 255, 0.85) 50%,
      rgba(var(--color-blue-rgb), 0.4) 94%,
      transparent 100%);
    box-shadow: 0 0 12px rgba(47, 123, 255, 0.4);
    transform: scaleY(0);
    transform-origin: top center;
    transition: transform 1.3s var(--bb-ease);
  }

  .bb-id-flow.is-in-view .bb-id-flow__steps::before {
    transform: scaleY(1);
    transition-delay: 0.5s;
  }

  /* Checkpoint sur chaque step (à gauche) */
  .bb-id-flow__step {
    align-items: flex-start;
    text-align: left;
    position: relative;
  }

  .bb-id-flow__step::before {
    content: "";
    position: absolute;
    left: -42px;
    top: 6px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #FFFFFF;
    border: 2px solid var(--color-blue);
    box-shadow: 0 0 0 3px #FFFFFF, 0 6px 14px rgba(var(--color-blue-rgb), 0.30);
    z-index: 2;
  }

  .bb-id-flow__step::after {
    content: "";
    position: absolute;
    left: -38px;
    top: 10px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-blue), var(--color-blue-bright));
    z-index: 3;
    transform: scale(0);
    transition: transform 0.6s var(--bb-ease);
  }

  .bb-id-flow.is-in-view .bb-id-flow__step:nth-child(1)::after { transform: scale(1); transition-delay: 0.85s; }
  .bb-id-flow.is-in-view .bb-id-flow__step:nth-child(2)::after { transform: scale(1); transition-delay: 1.00s; }
  .bb-id-flow.is-in-view .bb-id-flow__step:nth-child(3)::after { transform: scale(1); transition-delay: 1.15s; }

  .bb-id-flow__num {
    font-size: 26px;
    margin-bottom: 12px;
  }

  .bb-id-flow__card {
    padding: 22px 20px 20px;
  }

  .bb-id-flow__cardIcon {
    margin: 0 0 14px;
    width: 42px;
    height: 42px;
    border-radius: 12px;
  }

  .bb-id-flow__cardIcon svg { width: 20px; height: 20px; }
  .bb-id-flow__cardTitle    { font-size: 18px; }
  .bb-id-flow__cardText     { font-size: 14px; }

  /* Reassure : passe en pill plus compacte sur mobile */
  .bb-id-flow__reassure {
    border-radius: 20px;
    padding: 16px 20px;
    gap: 12px;
  }
  .bb-id-flow__reassureText { font-size: 13.5px; }
  .bb-id-flow__reassureIcon { width: 34px; height: 34px; }
  .bb-id-flow__reassureIcon svg { width: 16px; height: 16px; }

  .bb-id-flow__card:hover { transform: none; }
}

@media (max-width: 380px) {
  .bb-id-flow__inner { padding: 56px 0; }
  .bb-id-flow__title { font-size: 26px; line-height: 1.12; }
}

/* =========================================================================
   REDUCED MOTION
   ========================================================================= */
@media (prefers-reduced-motion: reduce) {
  .bb-id-flow *,
  .bb-id-flow *::before,
  .bb-id-flow *::after {
    animation: none !important;
    transition-duration: 0.1s !important;
  }
  .bb-id-flow__kicker,
  .bb-id-flow__title,
  .bb-id-flow__subtitle,
  .bb-id-flow__num,
  .bb-id-flow__card,
  .bb-id-flow__reassure {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }
  .bb-id-flow__rail,
  .bb-id-flow__checkpoint::before,
  .bb-id-flow__title-accent::after {
    transform: scaleX(1) !important;
  }
}

/* Defensive WordPress */
.bb-id-flow__cardTitle::before,
.bb-id-flow__cardTitle::after,
.bb-id-flow__cardText::before,
.bb-id-flow__cardText::after,
.bb-id-flow__num::before,
.bb-id-flow__num::after {
  content: none;
  display: none;
}
