/* Brique Lv2c « visite guidée » — thème du popover driver.js + bouton d'aide flottant.
   Source canonique : vps-setup/briques/visite-guidee/ (reporter toute modification ici).
   Parti pris : sobre et aéré — aplats foncés de la marque (pas de dégradés), fond blanc,
   pastille picto, overlay léger qui ne masque pas l'écran.
   Personnalisation par app, dans son CSS global :
     :root {
       --lv2c-visite-accent:  #003F7A;          couleur de marque
       --lv2c-visite-kicker:  "Visite guidée";  surtitre du popover
     } */

.driver-popover.lv2c-visite,
.lv2c-aide {
  --_accent: var(--lv2c-visite-accent, #003F7A);
}

/* Anti-fuite : le popover driver.js est fait de balises nues (<header>, <footer>,
   <button>) sur lesquelles les styles globaux de l'app hôte prennent le dessus
   (ex. header { background: … } peint le titre en aplat — constaté sur siretage).
   On repart des styles navigateur, puis les règles ci-dessous redéclarent tout. */
.driver-popover.lv2c-visite .driver-popover-title,
.driver-popover.lv2c-visite .driver-popover-description,
.driver-popover.lv2c-visite .driver-popover-footer,
.driver-popover.lv2c-visite .driver-popover-footer button,
.driver-popover.lv2c-visite .driver-popover-close-btn {
  all: revert;
  box-sizing: border-box;
  font-family: inherit;
}

/* ————— Popover ————— */
.driver-popover.lv2c-visite {
  background: #ffffff;
  border-radius: 16px;
  padding: 28px 28px 20px;
  min-width: 320px;
  max-width: 410px;
  box-shadow: 0 18px 50px rgba(2, 20, 43, 0.28), 0 2px 10px rgba(2, 20, 43, 0.10);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  animation: lv2c-visite-pop 0.3s cubic-bezier(0.21, 1.02, 0.47, 1.1) both;
}
@keyframes lv2c-visite-pop {
  from { opacity: 0; transform: scale(0.96) translateY(6px); }
  to { opacity: 1; transform: none; }
}
/* Pastille picto (injectée par visite.js) au-dessus du titre */
.lv2c-visite-icone {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #edf2f8;
  color: var(--_accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}
.lv2c-visite-icone svg { width: 22px; height: 22px; }
/* Surtitre (kicker) au-dessus du titre */
.driver-popover.lv2c-visite .driver-popover-title::before {
  content: var(--lv2c-visite-kicker, "Visite guidée");
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #475569;
  margin-bottom: 8px;
}
.driver-popover.lv2c-visite .driver-popover-title {
  display: block;
  background: none;
  padding: 0;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: #16283b;
  margin: 0 0 10px;
}
.driver-popover.lv2c-visite .driver-popover-description {
  background: none;
  margin: 0;
  padding: 0;
  font-size: 14px;
  line-height: 1.65;
  color: #46586c;
}

/* ————— Pied : points d'étape + boutons ————— */
.driver-popover.lv2c-visite .driver-popover-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: none;
  border: none;
  padding: 0;
  margin: 22px 0 0;
}
.lv2c-visite-dots { display: flex; align-items: center; gap: 6px; }
.lv2c-visite-dot {
  width: 7px; height: 7px; border-radius: 999px;
  background: #d5dee8;
  transition: width 0.25s ease, background 0.25s ease, opacity 0.25s ease;
}
.lv2c-visite-dot.done { background: var(--_accent); opacity: 0.3; }
.lv2c-visite-dot.active {
  width: 20px;
  background: var(--_accent);
}
.driver-popover.lv2c-visite .driver-popover-footer button {
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  border-radius: 999px;
  padding: 10px 20px;
  border: none;
  text-shadow: none;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.driver-popover.lv2c-visite .driver-popover-footer button.driver-popover-next-btn {
  background: var(--_accent);
  color: #fff;
}
.driver-popover.lv2c-visite .driver-popover-footer button.driver-popover-next-btn:hover {
  filter: brightness(1.15);
}
.driver-popover.lv2c-visite .driver-popover-footer button.driver-popover-prev-btn {
  background: transparent;
  color: var(--_accent);
}
.driver-popover.lv2c-visite .driver-popover-footer button.driver-popover-prev-btn:hover { background: #eef3f9; }
.driver-popover.lv2c-visite .driver-popover-close-btn {
  position: absolute;
  top: 10px; right: 10px;
  width: 28px; height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  background: transparent;
  border-radius: 999px;
  color: #475569;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  z-index: 1;
  transition: color 0.15s ease, background 0.15s ease;
}
.driver-popover.lv2c-visite .driver-popover-close-btn:hover,
.driver-popover.lv2c-visite .driver-popover-close-btn:focus-visible {
  color: var(--_accent);
  background: #eef3f9;
}
/* driver.js focus le popover à chaque étape : pas d'anneau de focus navigateur
   (réactivé par le `all: revert`), un état visuel discret le remplace. */
.driver-popover.lv2c-visite .driver-popover-footer button:focus:not(:focus-visible),
.driver-popover.lv2c-visite .driver-popover-close-btn:focus:not(:focus-visible) {
  outline: none;
}
/* Au clavier, le contour reste franc (RGAA 10.7) : un halo pâle ne se voyait pas. */
.driver-popover.lv2c-visite .driver-popover-footer button:focus-visible,
.driver-popover.lv2c-visite .driver-popover-close-btn:focus-visible {
  outline: 3px solid #004899;
  outline-offset: 2px;
}

/* ————— Bouton d'aide flottant ————— */
/* Même blindage anti-fuite que le popover : c'est un <button> nu, les styles
   globaux de l'app hôte (button { background… }) ne doivent pas le repeindre. */
.lv2c-aide {
  all: revert;
  box-sizing: border-box;
  margin: 0;
  line-height: 1;
  position: fixed;
  right: 22px; bottom: 22px;
  z-index: 960;
  display: inline-flex;
  align-items: center;
  height: 52px;
  padding: 0 14px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  background: var(--_accent);
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(2, 20, 43, 0.30), 0 2px 8px rgba(2, 20, 43, 0.15);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}
.lv2c-aide:hover,
.lv2c-aide:focus-visible {
  transform: translateY(-2px);
  filter: brightness(1.12);
  box-shadow: 0 12px 30px rgba(2, 20, 43, 0.35), 0 3px 10px rgba(2, 20, 43, 0.18);
}
.lv2c-aide svg { width: 24px; height: 24px; flex: none; }
/* Libellé replié, révélé au survol / focus clavier */
.lv2c-aide-label {
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  white-space: nowrap;
  transition: max-width 0.28s ease, opacity 0.2s ease, margin-left 0.28s ease;
}
.lv2c-aide:hover .lv2c-aide-label,
.lv2c-aide:focus-visible .lv2c-aide-label {
  max-width: 170px;
  opacity: 1;
  margin-left: 9px;
}
/* Halo d'invitation (optionnel, prop `pulse`) tant que la visite n'a pas été vue */
.lv2c-aide-pulse::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  animation: lv2c-aide-pulse 2.4s ease-out infinite;
}
@keyframes lv2c-aide-pulse {
  0% { box-shadow: 0 0 0 0 rgba(60, 100, 150, 0.5); }
  70% { box-shadow: 0 0 0 16px rgba(60, 100, 150, 0); }
  100% { box-shadow: 0 0 0 0 rgba(60, 100, 150, 0); }
}
@media (max-width: 640px) {
  .lv2c-aide { right: 14px; bottom: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .driver-popover.lv2c-visite { animation: none; }
  .lv2c-aide-pulse::before { animation: none; }
}

/* ————— Menu du bouton d'aide (point d'entrée d'aide de l'app) ————— */
.lv2c-aide-menu {
  position: fixed;
  right: 24px;
  bottom: 84px;
  z-index: 961;
  min-width: 236px;
  background: #ffffff;
  border-radius: 14px;
  padding: 6px;
  box-shadow: 0 16px 40px rgba(2, 20, 43, 0.22), 0 2px 8px rgba(2, 20, 43, 0.10);
  animation: lv2c-visite-pop 0.18s ease-out both;
}
.lv2c-aide-menu[hidden] { display: none; }
.lv2c-aide-menu-item {
  all: revert;
  box-sizing: border-box;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #16283b;
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.lv2c-aide-menu-item:hover,
.lv2c-aide-menu-item:focus-visible { background: #edf2f8; color: var(--_accent, #003F7A); }
.lv2c-aide-menu-picto { font-size: 16px; line-height: 1; }
