/* =====================================================================
   Démo jouable « Scanne le VPSP » + animations au défilement.
   ===================================================================== */

/* Les éléments décalés avant leur apparition ne doivent pas élargir la page. */
html,
body {
  overflow-x: clip;
}

/* ---------- Démo ---------- */
.demo {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 40px;
  align-items: center;
}
.demo-phone {
  position: relative;
  width: 300px;
  aspect-ratio: 300 / 610;
  border-radius: 44px;
  padding: 11px;
  background: linear-gradient(160deg, #1d2a44, #050b18);
  box-shadow:
    var(--shadow),
    inset 0 0 0 1.5px rgba(255, 255, 255, 0.08);
  transform: rotate(-2deg);
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.demo:hover .demo-phone {
  transform: rotate(0deg);
}
.demo-notch {
  position: absolute;
  top: 18px;
  left: 50%;
  width: 84px;
  height: 22px;
  border-radius: 12px;
  background: #050b18;
  transform: translateX(-50%);
  z-index: 3;
}
.demo-screen {
  position: relative;
  height: 100%;
  overflow: hidden;
  border-radius: 34px;
  background: var(--mist);
  font-size: 13px;
  color: var(--ink);
}
.d-top {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 40px 14px 10px;
  background: var(--navy);
  color: #fff;
}
.d-top svg {
  width: 22px;
  height: 22px;
  flex: none;
}
.d-top b {
  font-family: var(--font-display);
  font-weight: 900;
  font-style: italic;
  font-size: 12px;
  letter-spacing: -0.01em;
}
.d-chip {
  margin-left: auto;
  padding: 3px 8px;
  border-radius: 99px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  font-size: 9.5px;
  white-space: nowrap;
}

/* Écrans */
.d-s {
  position: absolute;
  inset: 78px 0 0;
  display: flex;
  flex-direction: column;
  padding: 14px;
  opacity: 0;
  visibility: hidden;
  transform: translateX(28px);
  transition:
    opacity 0.35s,
    transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1),
    visibility 0s 0.35s;
}
.d-s.is-on {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition:
    opacity 0.35s,
    transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.d-eyebrow {
  margin: 4px 0 10px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--orange);
}

/* 0 — scan */
.d-viewfinder {
  position: relative;
  margin: 6px auto 0;
  width: 190px;
  height: 190px;
  border-radius: 22px;
  background: radial-gradient(circle at 50% 40%, #2a3958, #0b1426);
  display: grid;
  place-items: center;
  overflow: hidden;
}
/* Coins du viseur */
.d-viewfinder::before {
  --o: var(--orange);
  content: '';
  position: absolute;
  inset: 14px;
  background:
    linear-gradient(var(--o), var(--o)) left top / 30px 3px,
    linear-gradient(var(--o), var(--o)) left top / 3px 30px,
    linear-gradient(var(--o), var(--o)) right top / 30px 3px,
    linear-gradient(var(--o), var(--o)) right top / 3px 30px,
    linear-gradient(var(--o), var(--o)) left bottom / 30px 3px,
    linear-gradient(var(--o), var(--o)) left bottom / 3px 30px,
    linear-gradient(var(--o), var(--o)) right bottom / 30px 3px,
    linear-gradient(var(--o), var(--o)) right bottom / 3px 30px;
  background-repeat: no-repeat;
}
.d-qr {
  width: 108px;
  height: 108px;
  padding: 8px;
  border-radius: 10px;
  background: #fff;
}
.d-qr svg {
  width: 100%;
  height: 100%;
  display: block;
}
.d-laser {
  position: absolute;
  left: 18px;
  right: 18px;
  top: 30px;
  height: 2px;
  background: var(--orange);
  box-shadow: 0 0 14px 3px rgba(254, 112, 3, 0.7);
  animation: d-laser 1.8s ease-in-out infinite alternate;
}
@keyframes d-laser {
  to {
    top: 158px;
  }
}
.demo.is-scanning .d-viewfinder {
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.9);
  transition: box-shadow 0.2s;
}
.d-help {
  margin: 12px 0 0;
  text-align: center;
  color: var(--ink-2);
  font-size: 12px;
}

/* Boutons */
.d-btn,
.d-cta {
  margin-top: auto;
  width: 100%;
  border: 0;
  border-radius: 14px;
  padding: 13px 12px;
  background: var(--orange);
  color: #fff;
  font: 800 13.5px var(--font-display);
  cursor: pointer;
  box-shadow: 0 12px 22px -12px rgba(254, 112, 3, 0.9);
  transition:
    transform 0.15s,
    background 0.15s,
    opacity 0.2s;
}
.d-btn:hover,
.d-cta:hover:not([disabled]) {
  transform: translateY(-1px);
}
.d-btn.ghost {
  background: #fff;
  color: var(--navy);
  border: 1.5px solid var(--line);
  box-shadow: none;
}
.d-cta[disabled] {
  background: #f9c39a;
  box-shadow: none;
  cursor: default;
}
.d-cta.is-ready {
  background: #10b981;
  box-shadow: 0 12px 22px -12px rgba(16, 185, 129, 0.9);
}

/* 1 — véhicule */
.d-hero {
  border-radius: 16px;
  padding: 14px;
  background: linear-gradient(135deg, var(--navy), var(--navy-2));
  color: #fff;
  text-align: center;
}
.d-hero small {
  display: block;
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--orange);
  font-weight: 800;
}
.d-hero strong {
  display: block;
  margin: 4px 0 6px;
  font: 900 22px var(--font-display);
}
.d-plate {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  font:
    600 10.5px ui-monospace,
    monospace;
}
.d-hero em {
  display: block;
  margin-top: 6px;
  font-style: normal;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.7);
}
.d-q {
  margin: 14px 0 8px;
  text-align: center;
  font: 800 14px var(--font-display);
  color: var(--navy);
}
.d-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-bottom: 8px;
  padding: 10px;
  border-radius: 13px;
  border: 1.5px solid var(--line);
  background: #fff;
  text-align: left;
  font: 700 12.5px var(--font-body);
  color: var(--ink);
  cursor: pointer;
}
.d-opt small {
  display: block;
  font-weight: 500;
  font-size: 10.5px;
  color: var(--ink-2);
}
.d-opt i {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 9px;
  background: var(--orange-soft);
  color: var(--orange);
  font-style: normal;
  font-weight: 900;
}
.d-opt[disabled] {
  opacity: 0.45;
  cursor: default;
}

/* 2 — checklist */
.d-band {
  margin: -14px -14px 0;
  padding: 10px 14px 12px;
  background: var(--navy);
  color: #fff;
}
.d-band small {
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--orange);
  font-weight: 800;
}
.d-band strong {
  display: block;
  margin-top: 2px;
  font: 900 15px var(--font-display);
}
.d-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0 8px;
}
.d-count {
  font: 700 12px var(--font-display);
  color: var(--ink-2);
  white-space: nowrap;
}
.d-count b {
  font-size: 17px;
  font-style: italic;
  font-weight: 900;
  color: var(--orange);
}
.d-progress .bar {
  flex: 1;
  height: 7px;
  border-radius: 9px;
  background: #e2e7f0;
  overflow: hidden;
}
.d-progress .bar i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--orange), #ffa35a);
  transition: width 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.d-list {
  flex: 1;
  overflow: hidden;
}
.d-group {
  margin-bottom: 8px;
  border-radius: 13px;
  background: #fff;
  border: 1px solid var(--line);
  overflow: hidden;
}
.d-group h4 {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 8px 10px 6px;
  font: 800 11.5px var(--font-display);
  color: var(--navy);
}
.d-group h4 em {
  font-style: italic;
  color: var(--orange);
}
.d-all {
  margin-left: auto;
  padding: 3px 8px;
  border-radius: 8px;
  border: 1.5px dashed #6ee7b7;
  background: #ecfdf5;
  color: #047857;
  font: 700 10px var(--font-body);
  cursor: pointer;
}
.d-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  text-align: left;
  font: 500 11.5px var(--font-body);
  color: var(--ink);
  cursor: pointer;
  transition: background 0.2s;
}
.d-item .c {
  width: 18px;
  height: 18px;
  flex: none;
  border-radius: 50%;
  border: 2px solid #c8d0dd;
  display: grid;
  place-items: center;
  font-size: 11px;
  color: #fff;
  transition:
    background 0.2s,
    border-color 0.2s,
    transform 0.2s;
}
.d-item .flag {
  margin-left: auto;
  flex: none;
  white-space: nowrap;
  font-size: 10px;
  font-weight: 700;
  color: var(--ink-2);
  padding: 2px 6px;
  border-radius: 6px;
}
.d-item .flag:hover {
  background: #fef2f2;
  color: var(--bad);
}
.d-item.is-ok {
  background: #f0fdf7;
}
.d-item.is-ok .c {
  background: #10b981;
  border-color: #10b981;
  transform: scale(1.08);
}
.d-item.is-ok .c::before {
  content: '✓';
}
.d-item.is-bad {
  background: #fef2f2;
}
.d-item.is-bad .c {
  background: var(--bad);
  border-color: var(--bad);
}
.d-item.is-bad .c::before {
  content: '!';
  font-weight: 900;
}
.d-item.is-bad .flag {
  color: var(--bad);
}

/* 3 — terminé */
.d-done {
  align-items: center;
  justify-content: center;
  text-align: center;
}
.d-big {
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: #10b981;
  color: #fff;
  font-size: 50px;
  font-weight: 900;
  box-shadow: 0 0 0 12px rgba(16, 185, 129, 0.15);
  transform: scale(0.4);
  transition: transform 0.5s cubic-bezier(0.3, 1.6, 0.5, 1);
}
.d-s.is-on .d-big {
  transform: scale(1);
}
.demo.has-defect .d-big {
  background: var(--orange);
  box-shadow: 0 0 0 12px rgba(254, 112, 3, 0.15);
}
.d-title {
  display: block;
  margin-top: 20px;
  font: 900 19px/1.15 var(--font-display);
  color: var(--navy);
}
.d-meta {
  margin: 8px 0 0;
  color: var(--ink-2);
  font-size: 12px;
}
.d-warn {
  margin: 12px 0 0;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--orange-soft);
  color: #9a3d00;
  font-size: 11.5px;
  font-weight: 600;
}
.d-done .d-btn {
  margin-top: 22px;
}

/* Indice « touchez ici » */
.is-hint {
  position: relative;
  animation: d-hint 1.4s ease-in-out infinite;
}
@keyframes d-hint {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(254, 112, 3, 0.55);
  }
  50% {
    box-shadow: 0 0 0 7px rgba(254, 112, 3, 0);
  }
}

/* Étapes à droite */
.demo-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.demo-steps li {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid transparent;
  color: var(--ink-2);
  transition:
    background 0.3s,
    border-color 0.3s,
    color 0.3s,
    transform 0.3s;
}
.demo-steps li .k {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 12px;
  background: var(--mist);
  color: var(--ink-2);
  font: 900 italic 18px var(--font-display);
  transition:
    background 0.3s,
    color 0.3s;
}
.demo-steps li b {
  display: block;
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 16px;
}
.demo-steps li.is-on {
  background: #fff;
  border-color: var(--line);
  box-shadow: 0 18px 36px -26px rgba(1, 22, 58, 0.45);
  color: var(--ink);
  transform: translateX(6px);
}
.demo-steps li.is-on .k {
  background: var(--orange);
  color: #fff;
}
.demo-steps li.is-done .k {
  background: var(--navy);
  color: #fff;
}
.demo-tip {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 16px 0 0;
  padding-left: 16px;
  font-weight: 600;
  color: var(--orange);
}
.demo-tip::before {
  content: '';
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--orange);
  animation: d-hint 1.4s infinite;
}
.clock.is-ready span {
  color: #10b981;
}
.clock-note {
  display: inline-block;
  margin-top: 10px;
  padding: 5px 12px;
  border-radius: 99px;
  background: #ecfdf5;
  color: #047857;
  font-weight: 700;
  font-size: 14px;
}
.clock-note[hidden] {
  display: none;
}

@media (max-width: 1100px) {
  .demo {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
  }
  .demo-steps,
  .demo-tip {
    width: 100%;
    max-width: 420px;
  }
}

/* ---------- Apparitions au défilement ---------- */
.js-reveal [data-reveal] {
  opacity: 0;
  transform: translate(-18px, 26px);
  transition:
    opacity 0.7s ease,
    transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
  transition-delay: var(--d, 0s);
}
.js-reveal [data-reveal='right'] {
  transform: translate(36px, 30px) rotate(1.2deg);
}
.js-reveal [data-reveal='left'] {
  transform: translate(-36px, 30px) rotate(-1.2deg);
}
.js-reveal [data-reveal].is-in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .demo-phone,
  .d-s,
  .d-big,
  .d-progress .bar i {
    transition: none !important;
  }
  .d-laser,
  .is-hint,
  .demo-tip::before {
    animation: none !important;
  }
  .js-reveal [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}
