/* Bloc des avantages de l'accueil (src/lib/avantages.ts). */
.esl-avantages {
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --encre: #0f1430;
  --duree: 4s;
  max-width: 1280px;
  margin: 0 auto;
  padding: clamp(56px, 8vw, 104px) 20px 24px;
  font-family: "Montserrat", sans-serif;
  color: var(--encre);
}

.esl-avantages__tete {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 380px);
  align-items: end;
  gap: 20px 48px;
  margin-bottom: 36px;
}

.esl-avantages__titre {
  margin: 0;
  color: #000;
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.esl-avantages__titre span {
  color: #e8482f;
}

.esl-avantages__intro {
  margin: 0;
  color: #54595f;
  font-size: 1rem;
  line-height: 1.55;
}

.esl-avantages__legende {
  margin: 12px 0 0;
  color: #6b7076;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
}

.esl-av {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 48px;
  align-items: stretch;
}

/* Étapes */
.esl-av__etapes {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.esl-av-etape {
  position: relative;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 16px;
  padding: 18px 18px 22px;
  border-radius: 20px;
  transition: background-color 300ms ease;
}

.esl-av-etape__num {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px #d5d8e1;
  color: #8a8f9c;
  font-weight: 700;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  transition: background-color 300ms ease, color 300ms ease, box-shadow 300ms ease;
}

.esl-av-etape__titre {
  margin: 0;
  padding-top: 10px;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.015em;
}

.esl-avantages .esl-av-etape__bouton {
  padding: 0;
  border: 0;
  background: none;
  color: #9aa0ad;
  font: inherit;
  letter-spacing: inherit;
  text-align: left;
  cursor: pointer;
  transition: color 300ms ease;
}

/* Toute l'étape est cliquable, via le bouton du titre. */
.esl-av-etape__bouton::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 20px;
}

.esl-av-etape__bouton:focus-visible {
  outline: none;
}

.esl-av-etape:has(.esl-av-etape__bouton:focus-visible) {
  outline: 3px solid var(--c);
  outline-offset: 2px;
}

.esl-av-etape__texte {
  display: grid;
  grid-template-rows: 0fr;
  margin: 6px 0 0;
  color: #54595f;
  font-size: 0.92rem;
  line-height: 1.55;
  opacity: 0;
  transition: grid-template-rows 500ms var(--ease-in-out), opacity 300ms ease;
}

.esl-av-etape__texte span {
  overflow: hidden;
}

.esl-av-etape__progres {
  position: absolute;
  left: 78px;
  right: 18px;
  bottom: 9px;
  height: 3px;
  border-radius: 999px;
  background: #e3e5ec;
  overflow: hidden;
  opacity: 0;
  transition: opacity 300ms ease;
}

.esl-av-etape__progres::after {
  content: "";
  display: block;
  height: 100%;
  background: var(--c);
  transform: scaleX(0);
  transform-origin: left;
}

.esl-av-etape.est-active {
  background: #f4f5f8;
}

.esl-av-etape.est-active .esl-av-etape__num {
  background: var(--c);
  color: var(--encre);
  box-shadow: none;
}

.esl-avantages .esl-av-etape.est-active .esl-av-etape__bouton {
  color: var(--encre);
}

.esl-av-etape.est-active .esl-av-etape__texte {
  grid-template-rows: 1fr;
  opacity: 1;
}

.esl-av-etape.est-active .esl-av-etape__progres {
  opacity: 1;
}

.esl-av-etape.est-active .esl-av-etape__progres::after {
  animation: esl-av-remplir var(--duree) linear forwards paused;
}

/* Avance seulement à l'écran, et s'arrête sous la souris ou au clavier. */
.esl-avantages.est-visible .esl-av:not(:hover, :focus-within) .esl-av-etape.est-active .esl-av-etape__progres::after {
  animation-play-state: running;
}

@keyframes esl-av-remplir {
  to {
    transform: scaleX(1);
  }
}

.esl-av__rge {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  margin-top: 18px;
  padding: 18px;
  border-radius: 20px;
  background: #fbbb1c;
}

.esl-av__rge i {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--encre);
  color: #fbbb1c;
  font-style: normal;
  font-weight: 800;
  font-size: 0.9rem;
}

.esl-av__rge p {
  margin: 0;
  color: var(--encre);
  font-size: 0.86rem;
  line-height: 1.5;
}

/* Photo et fiche */
.esl-av__visuel {
  position: relative;
  min-height: 560px;
  border-radius: 28px;
  overflow: hidden;
  isolation: isolate;
  background: #252f61;
}

.esl-av-vue {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 700ms ease;
}

.esl-av-vue::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(10, 14, 34, 0.55), rgba(10, 14, 34, 0) 45%);
}

/* Spécificité renforcée : Elementor impose `.elementor img { height: auto }`. */
.esl-avantages .esl-av-vue img {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  transform: scale(1.06);
  transition: transform var(--duree) linear;
}

.esl-av-vue.est-active {
  opacity: 1;
}

.esl-avantages .esl-av-vue.est-active img {
  transform: scale(1);
}

.esl-av__compteur {
  position: absolute;
  top: 20px;
  right: 22px;
  z-index: 2;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(10, 14, 34, 0.5);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  backdrop-filter: blur(8px);
}

.esl-fiche {
  position: absolute;
  left: 22px;
  bottom: 22px;
  z-index: 1;
  width: min(320px, calc(100% - 44px));
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--encre);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  box-shadow: 0 12px 30px -14px rgba(10, 14, 34, 0.5);
  font-size: 0.76rem;
  opacity: 0;
  transform: translateY(10px) scale(0.97);
  transition: opacity 150ms ease, transform 150ms ease;
}

.esl-av-vue.est-active .esl-fiche {
  opacity: 1;
  transform: none;
  transition: opacity 600ms var(--ease-out) 250ms, transform 600ms var(--ease-out) 250ms;
}

.esl-fiche__tete {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 8px;
  font-weight: 700;
  font-size: 0.78rem;
}

.esl-fiche__tete small {
  color: #6b7076;
  font-size: 0.66rem;
  font-weight: 600;
}

.esl-fiche__pastille,
.esl-fiche__direct {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  font-size: 0.66rem;
  font-weight: 700;
}

.esl-fiche__pastille {
  padding: 3px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--c) 18%, white);
}

.esl-fiche__pastille::before,
.esl-fiche__direct::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--c);
}

.esl-fiche__direct {
  color: #1a7f4f;
}

.esl-fiche__direct::before {
  width: 7px;
  height: 7px;
  background: #15c575;
  animation: esl-av-pouls 2s ease-out infinite;
}

@keyframes esl-av-pouls {
  0% {
    box-shadow: 0 0 0 0 rgba(21, 197, 117, 0.6);
  }
  70%,
  100% {
    box-shadow: 0 0 0 7px rgba(21, 197, 117, 0);
  }
}

.esl-fiche__barres,
.esl-fiche__points {
  display: grid;
  gap: 7px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.esl-fiche__barre {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  color: #33384a;
}

.esl-fiche__barre b {
  height: 6px;
  border-radius: 999px;
  background: #e3e5ec;
  overflow: hidden;
}

.esl-fiche__barre b::after {
  content: "";
  display: block;
  width: var(--v);
  height: 100%;
  border-radius: inherit;
  background: var(--c);
  transform: scaleX(0);
  transform-origin: left;
}

.esl-fiche__points li {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #33384a;
}

.esl-fiche__coche {
  display: grid;
  place-items: center;
  flex: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--c);
  color: var(--encre);
}

.esl-fiche__coche svg {
  width: 10px;
  height: 10px;
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.esl-fiche__coche.est-attente {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px #b9bdc9;
}

.esl-fiche__echelle {
  position: relative;
  height: 8px;
  margin-top: 12px;
  border-radius: 999px;
  background: #e3e5ec;
}

.esl-fiche__echelle::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, color-mix(in srgb, var(--c) 45%, white) 0 20%, var(--c) 20% 100%);
  transform: scaleX(0);
  transform-origin: left;
}

.esl-av-vue.est-active .esl-fiche__barre b::after,
.esl-av-vue.est-active .esl-fiche__echelle::after {
  transform: scaleX(1);
  transition: transform 1000ms var(--ease-out) 500ms;
}

.esl-fiche__reperes {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  color: #6b7076;
  font-size: 0.64rem;
  font-variant-numeric: tabular-nums;
}

.esl-fiche__creneau {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 2px 10px;
  margin-top: 10px;
}

.esl-fiche__jour {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 40px;
  height: 44px;
  border-radius: 10px;
  background: var(--encre);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 600;
  line-height: 1.1;
  text-align: center;
  text-transform: uppercase;
}

.esl-fiche__jour b {
  font-size: 1rem;
}

.esl-fiche__creneau small {
  color: #6b7076;
  font-size: 0.68rem;
}

@media (max-width: 1023px) {
  .esl-av {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .esl-av__visuel {
    order: -1;
    min-height: 420px;
  }
}

@media (max-width: 767px) {
  .esl-avantages__tete {
    grid-template-columns: 1fr;
  }

  .esl-av__visuel {
    min-height: 380px;
    border-radius: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .esl-av-etape__progres {
    display: none;
  }

  .esl-avantages *,
  .esl-avantages *::before,
  .esl-avantages *::after {
    animation: none !important;
    transition-duration: 0ms !important;
    transition-delay: 0ms !important;
  }
}
