/* explanations.css — walkthrough séquentiel pour la démo Boond.
 *
 * Z-index map (cohérence avec la démo) :
 *   demo banner       100000
 *   demo modal        200000
 *   expl spotlight    250000
 *   expl tooltip      250001
 *   expl FAB button    99000   (sous la modale démo)
 */

:root {
  --boond-expl-primary: #0099e0;
  --boond-expl-primary-dark: #007ab5;
  --boond-expl-text: #212121;
  --boond-expl-muted: #727272;
  --boond-expl-border: #e2e2e2;
  --boond-expl-disabled: #a3a3a3;
}

/* --- Conteneur des FABs en bas à droite --------------------------------- */
/* Les boutons "Parcours guidés" et "Expliquer cette page" sont alignés
 * côte à côte dans un conteneur flex fixé en bas à droite. Le pulse
 * s'applique aux deux, avec un léger décalage pour éviter l'effet
 * stroboscopique de pulses parfaitement synchronisés. */
.boond-fab-stack {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 99000;
  display: flex !important;
  gap: 12px;
  align-items: center;
  visibility: visible !important;
  opacity: 1 !important;
}

/* --- Bouton flottant "Expliquer cette page" ----------------------------- */
.boond-expl-fab {
  position: static;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  font: 500 14px/1 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: #fff;
  background: var(--boond-expl-primary);
  border: 0;
  border-radius: 24px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: background 120ms ease, transform 120ms ease;
  /* Pulse continu pour attirer l'attention sur le bouton. */
  animation: boond-expl-fab-pulse 1.8s ease-in-out infinite;
}

.boond-expl-fab:hover {
  background: var(--boond-expl-primary-dark);
  transform: translateY(-1px);
  /* Au survol, on stoppe le pulse pour que l'utilisateur sente une réponse nette. */
  animation: none;
  box-shadow: 0 0 0 0 rgba(0, 153, 224, 0), 0 6px 16px rgba(0, 0, 0, 0.25);
}

/* Anneau pulsé : on combine animation sur box-shadow (anneau diffusant) et
 * légère oscillation d'échelle pour un effet bien visible mais sobre. */
@keyframes boond-expl-fab-pulse {
  0%   { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2), 0 0 0 0 rgba(0, 153, 224, 0.55); transform: scale(1); }
  50%  { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2), 0 0 0 14px rgba(0, 153, 224, 0); transform: scale(1.04); }
  100% { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2), 0 0 0 0 rgba(0, 153, 224, 0); transform: scale(1); }
}

/* Quand le FAB est lui-même la cible d'une étape, il doit passer au-dessus
 * de l'overlay sombre pour rester visible et conserver son pulse. */
.boond-expl-fab--targeted {
  z-index: 250002 !important;
  animation: boond-expl-fab-pulse 1.4s ease-in-out infinite;
}

.boond-expl-fab:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.boond-expl-fab__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  font-weight: 700;
  font-style: italic;
  font-family: Georgia, serif;
  background: #fff;
  color: var(--boond-expl-primary);
  border-radius: 50%;
  font-size: 13px;
}

/* --- Overlay (SVG plein écran avec spotlight) --------------------------- */
.boond-expl-overlay {
  position: fixed;
  inset: 0;
  z-index: 250000;
  pointer-events: auto;
  /* Bloque les clics sous l'overlay sauf sur la bulle */
}

.boond-expl-overlay__svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* --- Bulle (tooltip) ---------------------------------------------------- */
.boond-expl-tooltip {
  position: fixed;
  z-index: 250001;
  width: 360px;
  max-width: calc(100vw - 32px);
  padding: 16px 20px;
  background: #fff;
  color: var(--boond-expl-text);
  font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  border: 1px solid var(--boond-expl-primary);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  /* Apparition */
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.boond-expl-tooltip[data-visible="true"] {
  opacity: 1;
  transform: translateY(0);
}

.boond-expl-tooltip__journey {
  margin: -4px 0 8px;
  padding: 4px 8px;
  background: rgba(0, 153, 224, 0.10);
  color: var(--boond-expl-primary-dark);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.boond-expl-tooltip__header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--boond-expl-border);
}

.boond-expl-tooltip__counter {
  flex: 0 0 auto;
  padding-top: 2px;
  font-size: 12px;
  color: var(--boond-expl-muted);
  font-variant-numeric: tabular-nums;
}

.boond-expl-tooltip__title {
  flex: 1;
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--boond-expl-text);
  line-height: 1.3;
}

.boond-expl-tooltip__close {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  padding: 0;
  margin: -2px -4px 0 0;
  background: transparent;
  border: 0;
  border-radius: 4px;
  color: var(--boond-expl-muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}

.boond-expl-tooltip__close:hover {
  background: #f0f0f0;
  color: var(--boond-expl-text);
}

.boond-expl-tooltip__body {
  padding: 12px 0 16px;
  white-space: pre-wrap;
}

.boond-expl-tooltip__footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.boond-expl-btn {
  padding: 8px 16px;
  font: 500 13px/1.2 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  border-radius: 4px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}

.boond-expl-btn--primary {
  background: var(--boond-expl-primary);
  border-color: var(--boond-expl-primary);
  color: #fff;
}

.boond-expl-btn--primary:hover {
  background: var(--boond-expl-primary-dark);
  border-color: var(--boond-expl-primary-dark);
}

.boond-expl-btn--outline {
  background: #fff;
  border-color: var(--boond-expl-primary);
  color: var(--boond-expl-primary);
}

.boond-expl-btn--outline:hover {
  background: rgba(0, 153, 224, 0.08);
}

.boond-expl-btn[disabled] {
  cursor: not-allowed;
  opacity: 0.5;
}

.boond-expl-btn[disabled]:hover {
  background: #fff;
  border-color: var(--boond-expl-disabled);
  color: var(--boond-expl-disabled);
}

.boond-expl-btn--outline[disabled] {
  border-color: var(--boond-expl-disabled);
  color: var(--boond-expl-disabled);
}

/* --- Flèche pointant vers la cible -------------------------------------- */
/* La flèche est un carré tourné 45° positionné absolument par le JS via
 * la propriété `--arrow-x` / `--arrow-y` (en pixels par rapport à la bulle).
 */
.boond-expl-tooltip__arrow {
  position: absolute;
  width: 12px;
  height: 12px;
  background: #fff;
  border: 1px solid var(--boond-expl-primary);
  /* On masque les deux côtés "internes" via clip-path en fonction du placement */
  transform: rotate(45deg);
}

/* Selon le placement, on positionne la flèche et on cache les bords internes
 * via une bordure partielle. On utilise data-attributes pour le placement. */
.boond-expl-tooltip[data-placement="top"] .boond-expl-tooltip__arrow {
  bottom: -7px;
  border-top: 0;
  border-left: 0;
}

.boond-expl-tooltip[data-placement="bottom"] .boond-expl-tooltip__arrow {
  top: -7px;
  border-bottom: 0;
  border-right: 0;
}

.boond-expl-tooltip[data-placement="left"] .boond-expl-tooltip__arrow {
  right: -7px;
  border-bottom: 0;
  border-left: 0;
}

.boond-expl-tooltip[data-placement="right"] .boond-expl-tooltip__arrow {
  left: -7px;
  border-top: 0;
  border-right: 0;
}

.boond-expl-tooltip[data-placement="center"] .boond-expl-tooltip__arrow {
  display: none;
}

/* --- Empêcher le scroll du body pendant le walkthrough ------------------ */
body.boond-expl-active {
  overflow: hidden;
}

/* --- Réduire les transitions pour les utilisateurs sensibles ------------ */
@media (prefers-reduced-motion: reduce) {
  .boond-expl-fab,
  .boond-expl-tooltip,
  .boond-expl-btn,
  .boond-expl-tooltip__close {
    transition: none;
  }
  .boond-expl-fab,
  .boond-expl-fab--targeted {
    animation: none;
  }
}

/* ========================================================================== *
 *   Parcours guidés : FAB bas-gauche + popup de bienvenue                    *
 * ========================================================================== */

/* --- Bouton flottant "Parcours guidés" (à côté d'Explication) ----------- */
.boond-journey-fab {
  position: static;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  font: 500 14px/1 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: #fff;
  background: #212121;
  border: 0;
  border-radius: 24px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: background 120ms ease, transform 120ms ease;
  /* Pulse identique en cadence à celui d'Explication, mais en teinte sombre
   * pour rester cohérent avec le fond noir. Décalé d'une demi-période pour
   * que les deux boutons ne pulsent pas exactement en phase. */
  animation: boond-journey-fab-pulse 1.8s ease-in-out infinite;
  animation-delay: -0.9s;
}

@keyframes boond-journey-fab-pulse {
  0%   { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2), 0 0 0 0 rgba(33, 33, 33, 0.55); transform: scale(1); }
  50%  { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2), 0 0 0 14px rgba(33, 33, 33, 0); transform: scale(1.04); }
  100% { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2), 0 0 0 0 rgba(33, 33, 33, 0); transform: scale(1); }
}

.boond-journey-fab:hover {
  background: #000;
  transform: translateY(-1px);
  animation: none;
  box-shadow: 0 0 0 0 rgba(33, 33, 33, 0), 0 6px 16px rgba(0, 0, 0, 0.35);
}

.boond-journey-fab:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.boond-journey-fab__icon {
  font-size: 16px;
  line-height: 1;
}

/* --- Popup "Quel est votre besoin principal ?" -------------------------- */
.boond-journey-overlay {
  position: fixed;
  inset: 0;
  z-index: 250000;
  background: rgba(0, 0, 0, 0.55);
  animation: boond-journey-fade 200ms ease-out;
}

.boond-journey-modal {
  position: fixed;
  z-index: 250001;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 560px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 64px);
  overflow-y: auto;
  padding: 28px 32px 24px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--boond-expl-text);
  animation: boond-journey-pop 220ms cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes boond-journey-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes boond-journey-pop {
  from { opacity: 0; transform: translate(-50%, -48%) scale(0.96); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.boond-journey-modal__close {
  position: absolute;
  top: 12px;
  right: 16px;
  width: 28px;
  height: 28px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 4px;
  color: var(--boond-expl-muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}

.boond-journey-modal__close:hover {
  background: #f0f0f0;
  color: var(--boond-expl-text);
}

.boond-journey-modal__title {
  margin: 0 36px 8px 0;
  font-size: 20px;
  font-weight: 600;
  color: var(--boond-expl-text);
  line-height: 1.3;
}

.boond-journey-modal__subtitle {
  margin: 0 0 20px;
  color: var(--boond-expl-muted);
  font-size: 14px;
}

.boond-journey-modal__cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.boond-journey-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--boond-expl-border);
  border-radius: 8px;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: border-color 140ms ease, background 140ms ease, transform 120ms ease;
}

.boond-journey-card:hover {
  border-color: var(--boond-expl-primary);
  background: rgba(0, 153, 224, 0.04);
}

.boond-journey-card:focus-visible {
  outline: 2px solid var(--boond-expl-primary);
  outline-offset: 2px;
}

.boond-journey-card__icon {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 153, 224, 0.10);
  border-radius: 8px;
  font-size: 18px;
  line-height: 1;
}

.boond-journey-card__content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.boond-journey-card__title {
  font-weight: 600;
  font-size: 14px;
  color: var(--boond-expl-text);
}

.boond-journey-card__desc {
  font-size: 12.5px;
  color: var(--boond-expl-muted);
  line-height: 1.45;
}

.boond-journey-card__arrow {
  flex: 0 0 auto;
  color: var(--boond-expl-primary);
  font-size: 18px;
  line-height: 1;
  transition: transform 120ms ease;
}

.boond-journey-card:hover .boond-journey-card__arrow {
  transform: translateX(2px);
}

.boond-journey-modal__skip {
  width: 100%;
  padding: 10px 16px;
  background: transparent;
  border: 0;
  color: var(--boond-expl-muted);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  border-radius: 4px;
  transition: background 120ms ease, color 120ms ease;
}

.boond-journey-modal__skip:hover {
  background: #f5f5f5;
  color: var(--boond-expl-text);
}

@media (max-width: 640px) {
  .boond-journey-fab__label,
  .boond-expl-fab__label {
    display: none;
  }
  .boond-journey-fab,
  .boond-expl-fab {
    padding: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .boond-journey-overlay,
  .boond-journey-modal {
    animation: none;
  }
}

/* ========================================================================== *
 *   Offre de démo Boond                                                      *
 * ========================================================================== */

.boond-demo-offer-overlay {
  position: fixed;
  inset: 0;
  z-index: 250000;
  background: rgba(0, 0, 0, 0.60);
  animation: boond-journey-fade 220ms ease-out;
}

.boond-demo-offer-modal {
  position: fixed;
  z-index: 250001;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 540px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 64px);
  overflow-y: auto;
  padding: 32px 36px 28px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
  font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--boond-expl-text);
  text-align: center;
  animation: boond-journey-pop 240ms cubic-bezier(0.4, 0, 0.2, 1);
}

.boond-demo-offer__close {
  position: absolute;
  top: 12px;
  right: 16px;
  width: 28px;
  height: 28px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 4px;
  color: var(--boond-expl-muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}

.boond-demo-offer__close:hover {
  background: #f0f0f0;
  color: var(--boond-expl-text);
}

.boond-demo-offer__icon {
  font-size: 38px;
  line-height: 1;
  margin-bottom: 8px;
}

.boond-demo-offer__title {
  margin: 0 0 12px;
  font-size: 22px;
  font-weight: 700;
  color: var(--boond-expl-text);
  line-height: 1.25;
}

.boond-demo-offer__body {
  margin: 0 0 20px;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--boond-expl-text);
}

.boond-demo-offer__body strong {
  color: var(--boond-expl-primary-dark);
  font-weight: 600;
}

.boond-demo-offer__stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px 24px;
  padding: 14px 16px;
  margin: 0 0 24px;
  background: rgba(0, 153, 224, 0.08);
  border-radius: 8px;
  font-size: 13px;
  color: var(--boond-expl-text);
}

.boond-demo-offer__stats strong {
  color: var(--boond-expl-primary-dark);
  font-weight: 700;
  font-size: 15px;
}

.boond-demo-offer__pricing {
  margin: -8px 0 18px;
  text-align: center;
  font-size: 13.5px;
  color: #4b5563;
}

.boond-demo-offer__pricing strong {
  color: var(--boond-expl-primary-dark);
  font-weight: 700;
  font-size: 14.5px;
}

.boond-demo-offer__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
}

.boond-demo-offer__cta {
  display: inline-block;
  padding: 12px 24px;
  background: var(--boond-expl-primary);
  color: #fff !important;
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  border-radius: 6px;
  transition: background 120ms ease, transform 120ms ease;
}

.boond-demo-offer__cta:hover {
  background: var(--boond-expl-primary-dark);
  text-decoration: none;
  transform: translateY(-1px);
}

.boond-demo-offer__skip {
  padding: 8px 16px;
  background: transparent;
  border: 0;
  color: var(--boond-expl-muted);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  border-radius: 4px;
  transition: background 120ms ease, color 120ms ease;
}

.boond-demo-offer__skip:hover {
  background: #f5f5f5;
  color: var(--boond-expl-text);
}

@media (prefers-reduced-motion: reduce) {
  .boond-demo-offer-overlay,
  .boond-demo-offer-modal {
    animation: none;
  }
}
