/* --------------------------------------------------------------------------
   Démo animée de l'application (héros de la page d'accueil)
   Un téléphone, cinq scènes scénarisées par assets/js/demo.js. Tout est en
   HTML/CSS : net sur tous les écrans, léger, et sans fichier vidéo à charger.
   -------------------------------------------------------------------------- */
.demo { position: relative; display: grid; justify-items: center; gap: 18px; }
.demo-phone {
  position: relative; width: 300px; height: 600px; border-radius: 42px; padding: 12px;
  background: #0b0d1a; box-shadow: 0 30px 80px rgba(0,0,0,.55), inset 0 0 0 2px rgba(255,255,255,.08);
  transform: none; backface-visibility: hidden;
}
/* Sur ordinateur, le téléphone penche légèrement et se redresse au survol. */
@media (min-width: 861px) {
  .demo-phone { transform: rotate(-2deg) translateZ(0); transition: transform .6s ease; }
  .demo:hover .demo-phone { transform: rotate(0deg) translateZ(0); }
}
.demo-notch { position: absolute; top: 20px; left: 50%; width: 96px; height: 24px; transform: translateX(-50%); border-radius: 14px; background: #0b0d1a; z-index: 5; }
.demo-screen { position: relative; width: 100%; height: 100%; border-radius: 32px; overflow: hidden; background: #f7f7f9; color: #12131a; font-size: 12.5px; line-height: 1.3; }
.demo-status { display: flex; justify-content: space-between; padding: 10px 20px 0; font-size: 11px; font-weight: 600; color: #12131a; }
.demo-app { position: absolute; inset: 34px 0 0; display: flex; flex-direction: column; }
.demo-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px 6px; }
.demo-head h3 { margin: 0; font-size: 18px; font-weight: 800; letter-spacing: -.02em; display: inline-flex; align-items: center; gap: 7px; }
.demo-mark { width: 24px; height: 24px; border-radius: 7px; background: linear-gradient(135deg, #4f46e5, #7c3aed); display: grid; place-items: center; color: #fff; box-shadow: 0 3px 8px rgba(79,70,229,.35); }
.demo-mark svg { width: 14px; height: 14px; fill: currentColor; }
.demo-credits { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 999px; background: #eef0ff; color: #312e81; font-size: 10.5px; font-weight: 700; }
.demo-stage { position: relative; flex: 1; overflow: hidden; }
.demo-tabs { display: grid; grid-template-columns: repeat(5, 1fr); padding: 7px 2px 12px; border-top: 1px solid #e5e7ef; background: #fff; font-size: 9.5px; font-weight: 700; color: #8a8f9f; text-align: center; }
.demo-tabs span { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 2px 0; letter-spacing: .01em; }
.demo-tabs svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.demo-tabs span.on { color: #4f46e5; }

/* Scènes */
.demo-scene { position: absolute; inset: 0; padding: 4px 14px 10px; opacity: 0; transform: translateY(14px); transition: opacity .45s ease, transform .45s ease; pointer-events: none; }
.demo-scene.on { opacity: 1; transform: none; }
.d-card { background: #fff; border: 1px solid #e5e7ef; border-radius: 14px; padding: 10px 12px; box-shadow: 0 1px 2px rgba(18,19,26,.05); }
.d-muted { color: #6b6f80; }
.d-row { display: flex; align-items: center; gap: 8px; }
.d-pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: 999px; font-size: 10px; font-weight: 700; white-space: nowrap; }
.d-pill.e1 { background: #dcfce7; color: #15803d; } .d-pill.e2 { background: #fef3c7; color: #b45309; } .d-pill.e3 { background: #fee2e2; color: #b91c1c; }
.d-pill.acc { background: #eef0ff; color: #312e81; } .d-pill.ok { background: #dcfce7; color: #15803d; }
.d-btn { display: flex; align-items: center; justify-content: center; gap: 6px; height: 34px; border-radius: 999px; background: #4f46e5; color: #fff; font-weight: 700; font-size: 12px; box-shadow: 0 6px 16px rgba(79,70,229,.3); }
.d-btn.ghost { background: #fff; color: #12131a; border: 1px solid #cfd2de; box-shadow: none; }

/* Apparitions pilotées par JS : .in */
.d-pop { opacity: 0; transform: translateY(10px) scale(.98); transition: opacity .35s ease, transform .35s ease; }
.d-pop.in { opacity: 1; transform: none; }

/* Scène 1 : capture vocale */
.d-mic { width: 54px; height: 54px; margin: 10px auto 6px; border-radius: 50%; background: #4f46e5; color: #fff; display: grid; place-items: center; position: relative; }
.d-mic svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.d-mic::before, .d-mic::after { content: ""; position: absolute; inset: -8px; border-radius: 50%; border: 2px solid rgba(79,70,229,.45); opacity: 0; }
.d-mic.live::before { animation: demoPulse 1.6s ease-out infinite; }
.d-mic.live::after { animation: demoPulse 1.6s ease-out .8s infinite; }
@keyframes demoPulse { 0% { transform: scale(.8); opacity: .9; } 100% { transform: scale(1.5); opacity: 0; } }
.d-transcript { min-height: 54px; font-size: 13px; font-weight: 500; }
.d-caret { display: inline-block; width: 2px; height: 14px; background: #4f46e5; vertical-align: -2px; margin-left: 2px; animation: demoBlink 1s steps(2) infinite; }
@keyframes demoBlink { to { opacity: 0; } }
.d-task { display: grid; grid-template-columns: 1fr auto; gap: 6px; align-items: center; margin-top: 8px; }
.d-task strong { display: block; font-size: 12.5px; }
.d-task small { color: #6b6f80; }
.d-new { background: #eef0ff; color: #312e81; font-size: 9.5px; font-weight: 700; padding: 1px 6px; border-radius: 999px; }

/* Scène 2 et 3 : planning */
.d-day { margin-top: 8px; overflow: hidden; }
.d-day header { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; border-bottom: 1px solid #e5e7ef; font-weight: 800; }
.d-day header small { font-weight: 600; color: #6b6f80; }
.d-slot { display: grid; grid-template-columns: 52px 1fr; gap: 8px; align-items: center; margin: 6px 10px; padding: 6px 9px; border-radius: 10px; border: 1px solid #e5e7ef; background: #fff; font-size: 11.5px; transition: transform .7s cubic-bezier(.2,.8,.2,1), opacity .5s ease, background .4s; }
.d-slot time { font-size: 10.5px; color: #6b6f80; font-variant-numeric: tabular-nums; }
.d-slot.e1 { background: #f0fdf4; border-color: #bbf7d0; } .d-slot.e2 { background: #fffbeb; border-color: #fde68a; } .d-slot.e3 { background: #fef2f2; border-color: #fecaca; }
.d-slot.busy { background: #eef0f4; border-color: #cfd2de; color: #3f4150; }
.d-slot.busy em { font-style: normal; font-size: 9.5px; color: #6b6f80; margin-left: 4px; }
.d-slot.gone { opacity: 0; transform: translateX(40px); }
.d-note { margin-top: 8px; padding: 8px 10px; border-radius: 10px; background: #eef0ff; color: #312e81; font-size: 11.5px; display: flex; gap: 8px; align-items: flex-start; }
.d-note b { flex: none; width: 20px; height: 20px; border-radius: 6px; background: #4f46e5; color: #fff; display: grid; place-items: center; font-size: 11px; }
.d-toast { position: absolute; left: 14px; right: 14px; bottom: 10px; padding: 9px 12px; border-radius: 12px; background: #0d1024; color: #fff; font-size: 11.5px; font-weight: 600; box-shadow: 0 10px 30px rgba(0,0,0,.3); }

/* Scène 4 : agenda Google */
.d-cal { margin-top: 6px; border-radius: 12px; border: 1px solid #e5e7ef; background: #fff; overflow: hidden; }
.d-cal-head { display: grid; grid-template-columns: 34px repeat(3, 1fr); font-size: 10px; font-weight: 700; color: #6b6f80; border-bottom: 1px solid #e5e7ef; }
.d-cal-head span { padding: 6px 4px; text-align: center; border-left: 1px solid #f0f1f5; }
.d-cal-body { position: relative; display: grid; grid-template-columns: 34px repeat(3, 1fr); height: 300px; }
.d-cal-hours { font-size: 9px; color: #8a8f9f; display: grid; grid-template-rows: repeat(9, 1fr); padding-top: 2px; }
.d-cal-hours span { padding-left: 4px; }
.d-cal-col { position: relative; border-left: 1px solid #f0f1f5; background-image: linear-gradient(#f0f1f5 1px, transparent 1px); background-size: 100% 33.33px; }
.d-ev { position: absolute; left: 3px; right: 3px; border-radius: 6px; padding: 3px 5px; font-size: 9px; font-weight: 700; color: #fff; line-height: 1.15; overflow: hidden; opacity: 0; transform: scale(.9); transition: opacity .35s ease, transform .35s ease; }
.d-ev.in { opacity: 1; transform: none; }
.d-ev.g1 { background: #0b8043; } .d-ev.g2 { background: #f6c026; color: #3a2f00; } .d-ev.g3 { background: #d60000; } .d-ev.gm { background: #7986cb; }
.d-sync { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; color: #15803d; font-weight: 700; }
.d-sync i { width: 7px; height: 7px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.25); }

/* Scène 5 : bilan */
.d-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 6px; }
.d-kpi { text-align: center; padding: 8px 4px; }
.d-kpi strong { display: block; font-size: 17px; }
.d-kpi small { font-size: 9.5px; color: #6b6f80; }
.d-kpi.good { background: #f0fdf4; border-color: #bbf7d0; }
.d-bar { height: 7px; border-radius: 999px; background: #eef0f4; overflow: hidden; margin: 4px 0 8px; }
.d-bar i { display: block; height: 100%; width: 0; border-radius: 999px; background: #4f46e5; transition: width 1.2s cubic-bezier(.2,.8,.2,1); }
.d-bar i.e { background: #22c55e; }
.d-advice { margin-top: 8px; padding: 8px 10px; border-radius: 10px; background: #fffbeb; color: #78350f; font-size: 11px; }
.d-cta { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(13,16,36,.78); color: #fff; text-align: center; padding: 24px; opacity: 0; transition: opacity .5s ease; }
.d-cta.in { opacity: 1; }
.d-cta strong { display: block; font-size: 20px; line-height: 1.15; margin-bottom: 8px; letter-spacing: -.02em; }
.d-cta .d-btn { width: 100%; margin-top: 10px; }

/* Légende sous le téléphone */
.demo-caption { width: 300px; min-height: 58px; text-align: center; color: rgba(255,255,255,.85); font-size: .92rem; line-height: 1.35; }
.demo-caption strong { display: block; color: #fff; font-size: 1rem; margin-bottom: 2px; }
.demo-dots { display: flex; gap: 6px; justify-content: center; }
.demo-dots i { width: 22px; height: 4px; border-radius: 2px; background: rgba(255,255,255,.22); overflow: hidden; position: relative; }
.demo-dots i::after { content: ""; position: absolute; inset: 0; width: 0; background: #fff; }
.demo-dots i.done::after { width: 100%; }
.demo-dots i.run::after { width: 100%; transition: width var(--dur, 6s) linear; }

@media (max-width: 1100px) { .demo-phone { width: 280px; height: 560px; } }
@media (prefers-reduced-motion: reduce) {
  .demo-scene, .d-pop, .d-slot, .d-ev, .d-bar i { transition: none !important; }
  .d-mic::before, .d-mic::after, .d-caret { animation: none !important; }
}

/* Mobile : le téléphone passe sous le titre, les deux boutons sous le téléphone, puis la progression et la légende centrées. */
@media (max-width: 860px) {
  .hero { padding: 24px 0 48px; }
  .hero .container { gap: 0; }
  .hero .container > div:first-child, .demo { display: contents; }
  /* « Gratuit · Sans carte bancaire · Prêt en 2 minutes » sur une seule ligne, quelle que soit la largeur. */
  .hero-eyebrow { order: 1; margin-bottom: 14px; font-size: min(.62rem, 2.75vw); letter-spacing: .12em; justify-content: center; flex-wrap: nowrap; white-space: nowrap; gap: 8px; }
  .hero-eyebrow::before { display: none; }
  .hero h1 { order: 2; font-size: clamp(1.7rem, 7.2vw, 2.1rem); line-height: 1.08; }
  /* Titre français : chaque ligne tient sur une seule ligne d'écran, la taille s'ajuste à la largeur (la plus longue fait environ 16 em, plus une marge). */
  .hero h1:has(.h1-line) { font-size: min(2.1rem, calc((100vw - 40px) / 16)); }
  .hero h1 .h1-line { white-space: nowrap; }
  /* Le téléphone reste à sa taille native et est réduit par transformation : tout l'écran d'ouverture le montre. */
  .demo-phone { order: 3; justify-self: center; margin-top: 14px; transform: scale(.74); transform-origin: top center; margin-bottom: calc(-600px * .26); }
  .hero-actions { order: 4; width: 100%; max-width: 420px; justify-self: center; margin-top: 18px; }
  .demo-dots { order: 5; justify-self: center; margin-top: 16px; }
  .demo-caption { order: 6; justify-self: center; margin-top: 8px; }
  .hero-lead { order: 7; margin-top: 22px; font-size: 1rem; text-align: center; justify-self: center; }
  .hero-note { order: 8; justify-content: center; margin-top: 14px; }
}
@media (max-width: 400px) {
  .hero-eyebrow { gap: 6px; font-size: 2.55vw; letter-spacing: .06em; }
  .hero-actions .btn { padding-left: 16px; padding-right: 16px; font-size: 1rem; white-space: normal; min-width: 0; }
  .demo-phone { transform: scale(.68); margin-bottom: calc(-600px * .32); }
}
