/* ==========================================================================
   Centre dentaire Nacre — démo en direct : l'écran de l'accueil, l'écran de la
   salle et le téléphone du patient. Côte à côte sur ordinateur, un à la fois
   sur téléphone (l'écran de la salle devient un bandeau au-dessus).
   Aucun mode d'emploi : on appelle, ça arrive de l'autre côté.
   ========================================================================== */

:root { --bg: #08262d; --bg-2: #0f4650; --s: 1; --v: 0; --drag: 0px; --midw: 340px; }
@media (min-width: 1320px) { :root { --midw: 400px; } }
html { overflow-x: clip; }
body { min-height: 100vh; background: radial-gradient(110% 80% at 50% 0%, var(--bg-2), var(--bg) 62%) fixed, var(--bg); color: #eaf6f3; }

/* ---------- Bandeau du haut ------------------------------------------------- */
.top { position: relative; z-index: 20; display: flex; align-items: center; gap: 14px; height: 52px; padding: 0 20px; padding-left: max(20px, env(safe-area-inset-left)); padding-right: max(20px, env(safe-area-inset-right)); border-bottom: 1px solid rgba(234, 246, 243, .08); }
.top__brand { display: flex; align-items: center; gap: 9px; color: #fff; font-family: var(--display); font-weight: 800; font-stretch: 80%; font-size: 17px; letter-spacing: -.02em; text-decoration: none; white-space: nowrap; }
.top__brand svg { width: 28px; height: 28px; flex: none; }
.top__brand { flex: none; min-width: 44px; min-height: 44px; }
/* Tablette : l'écran de la salle est déjà en bandeau sur la page, son lien laisse la place au nom du cabinet */
@media (max-width: 899px) { .top__links { gap: 14px; } .top__links a:last-child { display: none; } }
.top__tag { position: relative; }
.top__tag::after { content: ""; position: absolute; inset: -9px -4px; }
.top__tag { padding: 3px 10px; border: 1px solid rgba(234, 246, 243, .18); border-radius: 999px; color: rgba(234, 246, 243, .66); font-size: 12.5px; text-decoration: none; white-space: nowrap; }
.top__tag b { color: #fff; font-weight: 600; }
.top__links { display: flex; gap: 18px; margin-left: auto; }
.top__links a { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; color: var(--mint); font-size: 13.5px; font-weight: 650; text-decoration: none; white-space: nowrap; }
.top__links a:hover { text-decoration: underline; text-underline-offset: 3px; }
.top__links svg { flex: none; width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Scène ---------------------------------------------------------------- */
.duo { position: relative; display: flex; flex-direction: column; justify-content: center; min-height: calc(100svh - 52px); padding: 14px 20px 22px; }
.track { display: grid; grid-template-columns: auto var(--midw) auto; justify-content: center; align-items: start; gap: clamp(18px, 2.6vw, 44px); }

.dev { position: relative; margin: 0; width: calc(390px * var(--s)); height: calc(820px * var(--s) + 34px); }
.dev__frame { position: absolute; top: 0; left: 0; width: 390px; height: 820px; padding: 11px; border-radius: 58px; background: #03141a; box-shadow: 0 0 0 1.5px #1d5560, 0 50px 90px -40px rgba(0, 0, 0, .85); transform: scale(var(--s)); transform-origin: top left; }
.dev__screen { display: flex; flex-direction: column; height: 100%; overflow: hidden; border-radius: 47px; background: var(--sb, var(--pearl)); transition: background-color .3s; }
.dev__screen iframe { flex: 1; display: block; width: 100%; min-height: 0; border: 0; background: var(--pearl); }
.dev__status { flex: none; display: grid; grid-template-columns: 1fr 120px 1fr; align-items: center; height: 46px; padding: 0 26px 0 34px; color: var(--sbc, var(--ink)); transition: color .3s; }
.dev__status time { font-weight: 700; font-size: 15px; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.dev__island { justify-self: center; width: 112px; height: 32px; border-radius: 20px; background: #03141a; }
.dev__icons { justify-self: end; display: flex; align-items: flex-end; gap: 2px; height: 12px; }
.dev__icons i { width: 3px; border-radius: 1px; background: currentColor; }
.dev__icons i:nth-child(1) { height: 5px; } .dev__icons i:nth-child(2) { height: 8px; } .dev__icons i:nth-child(3) { height: 11px; }
.dev__icons b { width: 22px; height: 11px; margin-left: 6px; padding: 1.5px; border: 1.5px solid currentColor; border-radius: 3.5px; background: linear-gradient(90deg, currentColor 70%, transparent 70%) content-box; opacity: .9; }
.dev figcaption { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; align-items: center; gap: 8px; color: rgba(234, 246, 243, .62); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dev__dot { width: 7px; height: 7px; flex: none; border-radius: 50%; background: var(--mint); }
.dev--pat .dev__dot { background: var(--coral); }
.dev__shield { display: none; }

/* Halo bref quand quelque chose arrive */
.dev.is-ping .dev__frame { animation: ping 1.3s var(--ease); }
@keyframes ping {
  0% { box-shadow: 0 0 0 1.5px #1d5560, 0 0 0 0 rgba(226, 87, 76, .6), 0 50px 90px -40px rgba(0, 0, 0, .85); }
  100% { box-shadow: 0 0 0 1.5px #1d5560, 0 0 0 28px rgba(226, 87, 76, 0), 0 50px 90px -40px rgba(0, 0, 0, .85); }
}

/* Colonne du milieu : la promesse, l'écran de la salle, le fil, les compteurs */
.mid { display: flex; flex-direction: column; gap: 18px; height: calc(820px * var(--s)); padding: 6px 0 2px; }
.mid__title { font-family: var(--display); font-weight: 800; font-stretch: 78%; font-size: clamp(30px, 2.7vw, 42px); line-height: .98; letter-spacing: -.03em; color: #fff; text-wrap: balance; }
.mid__title em { display: block; font-style: normal; color: var(--mint); }
.mid__tv { flex: none; height: calc((var(--midw) - 12px) * 9 / 16 + 12px + 30px); }

.mid__drop { position: relative; flex: 1 1 auto; min-height: 16px; margin: -8px 0 -50px; }
.mid__drop::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; border-left: 1.5px dashed rgba(234, 246, 243, .22); }
.mid__drop i { position: absolute; left: calc(50% - 6px); bottom: -6px; width: 12px; height: 12px; border-radius: 50%; background: var(--coral); box-shadow: 0 0 18px 5px rgba(226, 87, 76, .5); opacity: 0; }
.wire { position: relative; flex: none; height: 64px; margin: 0 calc(-1 * clamp(18px, 2.6vw, 44px)); }
.wire__line { position: absolute; left: 0; right: 0; top: 50%; height: 0; border-top: 1.5px dashed rgba(234, 246, 243, .22); }
.wire__line::before, .wire__line::after { content: ""; position: absolute; top: -4.5px; width: 7px; height: 7px; border-radius: 50%; background: rgba(234, 246, 243, .4); }
.wire__line::before { left: -3px; } .wire__line::after { right: -3px; }
.wire__pulse { position: absolute; left: -8px; top: calc(50% - 8px); width: 16px; height: 16px; border-radius: 50%; background: var(--coral); box-shadow: 0 0 0 5px rgba(226, 87, 76, .28), 0 0 26px 7px rgba(226, 87, 76, .55); opacity: 0; pointer-events: none; }
.wire__pulse.is-mint { background: var(--mint); box-shadow: 0 0 0 5px rgba(143, 211, 193, .28), 0 0 26px 7px rgba(143, 211, 193, .5); }
.wire__chip { position: absolute; left: 50%; bottom: calc(50% + 12px); display: inline-flex; align-items: center; gap: 8px; max-width: calc(100% - 40px); padding: 7px 14px 7px 10px; border-radius: 999px; background: #fff; color: var(--ink); font-weight: 750; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: 0 14px 30px -14px rgba(0, 0, 0, .6); opacity: 0; transform: translate(-50%, 8px) scale(.94); transition: opacity .35s, transform .5s var(--ease); }
.wire__chip.is-on { opacity: 1; transform: translate(-50%, 0) scale(1); }
.wire__chip svg { width: 17px; height: 17px; flex: none; fill: none; stroke: var(--lagoon); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.wire__chip.is-alert { background: var(--coral); color: #fff; }
.wire__chip.is-alert svg { stroke: #fff; }

.desk { display: block; flex: none; padding: 14px 16px 16px; border-radius: 18px; background: rgba(234, 246, 243, .06); border: 1px solid rgba(234, 246, 243, .12); color: #fff; text-decoration: none; transition: background-color .25s, border-color .25s; }
.desk:hover { background: rgba(234, 246, 243, .1); border-color: rgba(234, 246, 243, .24); }
.desk__head { display: flex; align-items: center; gap: 7px; color: rgba(234, 246, 243, .6); }
.desk__head svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.desk__nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.desk__nums span { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.desk__nums b { font-family: var(--display); font-weight: 800; font-stretch: 78%; font-size: 34px; line-height: 1; font-variant-numeric: tabular-nums; transition: color .4s; }
.desk__nums small { color: rgba(234, 246, 243, .6); font-size: 11.5px; line-height: 1.25; }
.desk__nums b.is-bump { color: var(--mint); animation: bump .6s var(--ease); }
@keyframes bump { 35% { transform: scale(1.18); } }

/* L'écran de la salle (ordinateur : posé dans la colonne du milieu par duo.js) */
.tvw { position: absolute; z-index: 4; left: var(--tx, 50%); top: var(--ty, 0); width: var(--tw, 340px); }
.tvw__bezel { position: relative; padding: 6px; border-radius: 14px; background: #02090b; box-shadow: 0 0 0 1px rgba(143, 211, 193, .16), 0 30px 60px -30px rgba(0, 0, 0, .9); }
.tvw__bezel iframe { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 8px; background: #061c22; }
.tvw__cap { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 10px; color: rgba(234, 246, 243, .6); }
.tvw__cap .live-dot { background: var(--mint); }
.tvw__cap .live-dot::after { border-color: var(--mint); }
.tvw__snd svg { width: 15px; height: 15px; fill: none; stroke: var(--mint); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tvw.is-ping .tvw__bezel { animation: tvping 1.3s var(--ease); }
@keyframes tvping { 0% { box-shadow: 0 0 0 1px rgba(143, 211, 193, .16), 0 0 0 0 rgba(226, 87, 76, .7); } 100% { box-shadow: 0 0 0 1px rgba(143, 211, 193, .16), 0 0 0 22px rgba(226, 87, 76, 0); } }

/* Doigt fantôme : montre le geste une fois, s'efface dès qu'on touche */
.ghost { position: fixed; left: 0; top: 0; z-index: 100; visibility: hidden; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%; background: rgba(255, 255, 255, .4); box-shadow: 0 0 0 2px rgba(255, 255, 255, .92), 0 8px 22px rgba(0, 0, 0, .35); opacity: 0; pointer-events: none; }
.ghost.is-on { visibility: visible; }
.ghost::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid #fff; opacity: 0; }
.ghost.is-tap::after { animation: ripple .6s var(--ease); }
@keyframes ripple { 0% { opacity: .9; transform: scale(.6); } 100% { opacity: 0; transform: scale(2.1); } }

.switch { display: none; }

/* ---------- Tablette : l'écran de la salle en bandeau, le fil seul entre les deux -------- */
@media (max-width: 1099px) {
  .duo { justify-content: flex-start; }
  .tvw { position: relative; left: auto; top: auto; width: min(620px, 100%); margin: 0 auto 14px; }
  .tvw__bezel { padding: 4px; border-radius: 12px; }
  .tvw__bezel iframe { aspect-ratio: 1600 / 240; border-radius: 8px; }
  .tvw__cap { display: none; }
  .track { grid-template-columns: auto 72px auto; gap: 14px; }
  .mid { justify-content: center; }
  .mid__title, .mid__tv, .mid__drop, .desk { display: none; }
  .wire { margin: 0 -14px; }
  /* Le passage entre les deux téléphones ne fait que 100 px : l'étiquette passe sur deux lignes et reste dans l'interstice */
  .wire__chip { left: 0; right: 0; bottom: calc(50% + 14px); flex-direction: column; gap: 3px; width: fit-content; max-width: 100%; margin: 0 auto; padding: 8px 9px 9px; border-radius: 16px; font-size: 12.5px; line-height: 1.15; text-align: center; white-space: normal; transform: translateY(8px) scale(.94); }
  .wire__chip.is-on { transform: none; }
}

/* ---------- Téléphone : un écran à la fois, on glisse ou on touche ----------------------- */
@media (max-width: 759px) {
  html, body { height: 100%; overflow: hidden; }
  body { min-height: 0; }
  .top { height: 48px; padding: 0 14px; gap: 10px; }
  .top__more { display: none !important; }
  .duo { display: flex; flex-direction: column; height: calc(100svh - 48px); min-height: 0; padding: 10px 0 calc(78px + env(safe-area-inset-bottom, 0px)); overflow: hidden; }
  .tvw { flex: none; width: auto; margin: 0 20px 10px; }
  .tvw__bezel { padding: 3px; border-radius: 10px; }
  .tvw__bezel iframe { border-radius: 7px; }
  .track { flex: 1; min-height: 0; display: flex; justify-content: flex-start; gap: 10px; padding: 0 20px; transform: translateX(calc(var(--v) * (30px - 100vw) + var(--drag))); transition: transform .6s var(--ease); }
  .duo.is-drag .track { transition: none; }
  .mid { display: none; }
  .dev { flex: none; width: calc(100vw - 40px); height: 100%; }
  .dev__frame { position: absolute; inset: 0; width: auto; height: auto; padding: 5px; border-radius: 32px; transform: none; transition: opacity .5s, transform .6s var(--ease), box-shadow .5s; }
  .dev__screen { border-radius: 27px; }
  .dev__status, .dev figcaption { display: none; }
  .dev:not(.is-on) .dev__frame { opacity: .45; transform: scale(.94); }
  .dev:not(.is-on) .dev__shield { display: block; position: absolute; inset: 0; z-index: 3; border: 0; background: transparent; -webkit-tap-highlight-color: transparent; }

  .switch { position: fixed; z-index: 30; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); display: grid; grid-template-columns: 1fr 1fr; width: min(300px, calc(100vw - 48px)); padding: 5px; border-radius: 999px; background: rgba(3, 20, 26, .88); border: 1px solid rgba(234, 246, 243, .14); box-shadow: 0 18px 40px -16px rgba(0, 0, 0, .7); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); transform: translateX(-50%); }
  .switch__thumb { position: absolute; top: 5px; bottom: 5px; left: 5px; width: calc(50% - 5px); border-radius: 999px; background: #fff; transform: translateX(calc(var(--v) * 100%)); transition: transform .5s var(--ease); }
  .switch button { position: relative; display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 46px; border: 0; border-radius: 999px; background: none; color: rgba(234, 246, 243, .75); font-weight: 700; font-size: 15px; -webkit-tap-highlight-color: transparent; transition: color .35s; }
  .switch button[aria-selected="true"] { color: var(--ink); }
  .switch svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .switch__dot { position: absolute; top: 9px; right: calc(50% - 46px); width: 9px; height: 9px; border-radius: 50%; background: var(--coral); box-shadow: 0 0 0 2px rgba(3, 20, 26, .9); }
  .switch__dot::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--coral); animation: dot 1.4s ease-out infinite; }
  @keyframes dot { 0% { opacity: .8; transform: scale(.5); } 100% { opacity: 0; transform: scale(1.6); } }
}
@media (max-width: 420px) { .top__brand span { display: none; } }

@media (prefers-reduced-motion: reduce) {
  .track, .dev__frame, .switch__thumb, .wire__chip { transition: none !important; }
  .dev.is-ping .dev__frame, .tvw.is-ping .tvw__bezel, .desk__nums b.is-bump, .switch__dot::after { animation: none; }
}
