/* Démos KLUBee — moteur de présentation guidée (imite src/components/annonce/visite-guidee.tsx). */
@font-face { font-family: "Carlito"; src: url("fonts/Carlito-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Carlito"; src: url("fonts/Carlito-Bold.woff2") format("woff2"); font-weight: 700 900; font-display: swap; }

:root {
  --encre: #18181b;
  --texte: #3f3f46;
  --gris: #71717a;
  --violet: #7c3aed;
  --violet-pale: #ddd6fe;
  --nuit: #1e1b4b;
  --nuit-survol: #4c1d95;
  --vert: rgb(20 83 45);
  --fond: #f6f5fb;
  --bulle: #ffffff;
  --voile: rgba(15, 12, 40, 0.12);
  --page: 960px;
  --bulle-l: 300px;
  --espace: 32px;
  --barre: 52px;
}

* { box-sizing: border-box; }
html, body, #demo { margin: 0; height: 100%; }
body {
  font-family: "Calibri", "Carlito", ui-sans-serif, system-ui, sans-serif;
  background: var(--fond);
  color: var(--encre);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* Barre du haut de la démo (hors présentation) */
.d-barre {
  height: var(--barre);
  display: flex; align-items: center; gap: 12px;
  padding: 0 16px;
  background: #fff;
  border-bottom: 1px solid #ece9f7;
}
.d-barre a { color: var(--nuit); text-decoration: none; font-weight: 700; font-size: 15px; }
.d-barre a:hover { color: var(--violet); }
.d-barre .d-titre { font-size: 16px; font-weight: 700; color: var(--encre); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d-barre .d-titre small { font-weight: 400; color: var(--gris); margin-left: 6px; }
.d-barre .d-pousse { flex: 1; }
.d-logo { display: inline-flex; align-items: center; gap: 8px; }
.d-logo b { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; background: linear-gradient(135deg, #7c3aed, #4f46e5); color: #fff; font-size: 15px; }

/* Écran partagé : la page à gauche, la bulle à droite */
.d-scene {
  position: relative;
  height: calc(100% - var(--barre));
  display: flex;
  gap: var(--espace);
  padding: 16px 16px 0;
}
.d-ecran {
  position: relative;
  flex: 0 1 var(--page);
  min-width: 0;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
  border-radius: 14px 14px 0 0;
  background: #fff;
  box-shadow: 0 1px 2px rgba(30, 27, 75, .06), 0 8px 30px rgba(30, 27, 75, .08);
  overscroll-behavior: contain;
}
.d-toile { position: relative; overflow: hidden; }
.d-toile img { display: block; width: 100%; height: auto; user-select: none; -webkit-user-drag: none; }
.d-toile img.d-cache { display: none; }
/* La page ne se clique pas pendant la visite : on regarde. */
.d-toile::after { content: ""; position: absolute; inset: 0; }

/* La lumière : un trou dans le voile, autour de la cible */
.d-lumiere {
  position: absolute;
  z-index: 2;
  pointer-events: none;
  border-radius: 16px;
  transition: top .3s ease-out, left .3s ease-out, width .3s ease-out, height .3s ease-out;
  box-shadow: 0 0 0 3px var(--vert), 0 0 14px 6px rgba(22, 163, 74, .55), 0 0 34px 16px rgba(134, 239, 172, .35), 0 0 0 9999px var(--voile);
}
.d-lumiere.d-vide { box-shadow: 0 0 0 9999px var(--voile); width: 0 !important; height: 0 !important; }

.d-pied { text-align: center; padding: 22px 0 90px; }
.d-revoir {
  background: none; border: 0; cursor: pointer; font: inherit; font-size: 14px;
  color: var(--gris); text-decoration: underline dotted; text-underline-offset: 4px;
}
.d-revoir:hover { color: var(--violet); }

/* Bouton « Terminer la présentation », en bas, sous la page */
.d-terminer-bas {
  position: absolute; z-index: 5; bottom: 16px;
  left: 16px; width: min(var(--page), calc(100% - 32px - var(--bulle-l) - var(--espace)));
  display: flex; justify-content: center; pointer-events: none;
}
.d-terminer-bas button {
  pointer-events: auto;
  border: 0; cursor: pointer; font: inherit; font-weight: 700; font-size: 16px;
  padding: 10px 24px; border-radius: 999px; background: #fff; color: #27272a;
  box-shadow: 0 0 0 1px var(--violet-pale), 0 12px 30px rgba(30, 27, 75, .18);
}
.d-terminer-bas button:hover { color: var(--violet); box-shadow: 0 0 0 1px #a78bfa, 0 12px 30px rgba(30, 27, 75, .18); }

/* La bulle */
.d-colonne { position: relative; flex: 0 0 var(--bulle-l); height: 100%; }
.d-bulle {
  position: absolute; left: 0; width: var(--bulle-l);
  background: var(--bulle);
  border-radius: 16px;
  box-shadow: 0 0 0 1px var(--violet-pale), 0 25px 50px -12px rgba(30, 27, 75, .3);
  transition: top .3s ease-out;
  font-size: 16px;
}
.d-entete {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
  padding: 10px 14px; border-bottom: 1px solid #ede9fe;
}
.d-surtitre { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-weight: 700; color: var(--violet); line-height: 1.3; }
.d-fictif { background: #fef3c7; color: #92400e; font-weight: 500; border-radius: 999px; padding: 1px 8px; }
.d-compte { display: flex; align-items: center; gap: 6px; white-space: nowrap; color: var(--gris); font-variant-numeric: tabular-nums; }
.d-fermer { border: 0; background: none; cursor: pointer; font-size: 22px; line-height: 1; color: #a1a1aa; border-radius: 999px; padding: 0 6px; }
.d-fermer:hover { background: #f4f4f5; color: #3f3f46; }
.d-corps { padding: 12px 14px 14px; }
.d-corps h2 { margin: 0; font-size: 20px; font-weight: 800; line-height: 1.3; letter-spacing: -.01em; color: var(--encre); }
.d-texte { margin-top: 8px; color: var(--texte); line-height: 1.55; }
.d-texte p { margin: 0 0 8px; }
.d-texte p:last-child { margin-bottom: 0; }
.d-texte ul, .d-texte ol { margin: 0 0 8px; padding-left: 20px; }
.d-texte strong { color: var(--encre); }
.d-texte code, .d-texte kbd { font-family: ui-monospace, monospace; font-size: .85em; background: #f4f4f5; padding: 0 4px; border-radius: 4px; }
.d-points { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 16px; }
.d-points span { height: 6px; width: 6px; border-radius: 999px; background: #e4e4e7; transition: all .2s; }
.d-points span.d-fait { background: #c4b5fd; }
.d-points span.d-ici { width: 16px; background: var(--violet); }
.d-boutons { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.d-boutons button {
  font: inherit; font-weight: 700; font-size: 16px; cursor: pointer; border-radius: 999px; padding: 6px 15px;
}
.d-prec { background: #fff; color: #52525b; border: 0; box-shadow: 0 0 0 1px #e4e4e7; }
.d-prec:hover { color: var(--violet); box-shadow: 0 0 0 1px #c4b5fd; }
.d-suiv { background: var(--nuit); color: #fff; border: 0; box-shadow: 0 1px 2px rgba(0,0,0,.1); }
.d-suiv:hover { background: var(--nuit-survol); }
.d-suiv:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }

/* Fin de la démo */
.d-fin {
  position: absolute; inset: 0; z-index: 10; display: none;
  place-items: center; background: rgba(246, 245, 251, .86); backdrop-filter: blur(3px);
}
.d-fin.d-montre { display: grid; }
.d-fin > div { background: #fff; border-radius: 18px; padding: 28px; max-width: 420px; margin: 16px; text-align: center; box-shadow: 0 0 0 1px var(--violet-pale), 0 25px 50px -12px rgba(30,27,75,.3); }
.d-fin h2 { margin: 0 0 8px; font-size: 22px; }
.d-fin p { color: var(--texte); line-height: 1.5; margin: 0 0 18px; }
.d-fin .d-boutons { justify-content: center; flex-wrap: wrap; }
.d-fin a.d-suiv { text-decoration: none; display: inline-block; font-weight: 700; border-radius: 999px; padding: 6px 15px; }

/* Téléphone et petite tablette : la bulle passe SOUS l'écran */
@media (max-width: 767.98px) {
  body, #demo { overflow: auto; height: auto; }
  .d-scene { flex-direction: column; height: auto; gap: 12px; padding: 12px 16px 24px; }
  .d-ecran { flex: none; width: 100%; height: 48vh; height: 48svh; border-radius: 12px; overflow-x: auto; }
  .d-toile { width: 720px; max-width: none; }
  .d-pied { width: 720px; }
  .d-colonne { flex: none; height: auto; }
  .d-bulle { position: relative; top: 0 !important; width: 100%; }
  .d-terminer-bas { position: static; width: auto; margin-top: 4px; }
  .d-pied { padding-bottom: 24px; }
  .d-barre .d-titre small { display: none; }
  .d-fin { position: fixed; }
}
@media (min-width: 768px) and (max-width: 1100px) {
  :root { --espace: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .d-lumiere, .d-bulle, .d-ecran { transition: none; scroll-behavior: auto; }
}
