/* Téléphone 3D en CSS — composant réutilisable (voir js/phone.js pour le suivi du pointeur). */
.phone-scene {
  --pw: 200px;
  position: relative; width: var(--pw); aspect-ratio: 9 / 19.2; margin: 0 auto;
  perspective: 1400px; perspective-origin: 50% 40%;
}
.phone {
  position: absolute; inset: 0; transform-style: preserve-3d;
  transform: rotateX(6deg) rotateY(-16deg) rotateZ(-1.5deg);
  will-change: transform;
}
.phone-scene.is-live .phone { transition: none; }

/* Ombre portée au sol */
.phone-shadow {
  position: absolute; left: 8%; right: -6%; top: 10%; bottom: -3%; border-radius: 40px;
  background: rgb(11 11 15 / .22); filter: blur(28px);
  transform: translateZ(-60px) translate(18px, 26px);
}

/* Épaisseur : plaques empilées vers l'arrière */
.phone-edge {
  position: absolute; inset: 0; border-radius: 38px; background: #1C1C22;
}
.phone-edge:nth-child(1) { transform: translateZ(-2.5px); background: #2A2A31; }
.phone-edge:nth-child(2) { transform: translateZ(-5px); background: #24242B; }
.phone-edge:nth-child(3) { transform: translateZ(-7.5px); background: #1E1E24; }
.phone-edge:nth-child(4) { transform: translateZ(-10px); background: #17171C; box-shadow: 0 30px 60px -20px rgb(11 11 15 / .5); }

/* Face avant : châssis */
.phone-body {
  position: absolute; inset: 0; border-radius: 38px; padding: 9px;
  background: linear-gradient(160deg, #3A3A44 0%, #16161B 40%, #0B0B0F 100%);
  box-shadow:
    inset 0 0 0 1px rgb(255 255 255 / .18),
    inset 0 1px 0 rgb(255 255 255 / .35),
    inset -1px -1px 0 rgb(0 0 0 / .6);
  transform: translateZ(0);
}
.phone-screen {
  position: relative; width: 100%; height: 100%; border-radius: 30px; overflow: hidden;
  background: #fff; color: var(--ink, #0B0B0F);
  font-family: "Segoe UI", system-ui, -apple-system, "SF Pro Text", Roboto, sans-serif;
}
.phone-notch {
  position: absolute; left: 50%; top: 10px; z-index: 5; width: 34%; height: 22px; margin-left: -17%;
  border-radius: 999px; background: #0B0B0F;
}
/* Reflet vitré */
.phone-gloss {
  position: absolute; inset: 0; border-radius: 38px; pointer-events: none; z-index: 6;
  background:
    linear-gradient(115deg, rgb(255 255 255 / .22) 0%, rgb(255 255 255 / .06) 28%, rgb(255 255 255 / 0) 45%),
    linear-gradient(300deg, rgb(255 255 255 / .10) 0%, rgb(255 255 255 / 0) 30%);
  transform: translateZ(1px);
}
/* Boutons latéraux */
.phone-btn { position: absolute; width: 3px; border-radius: 2px; background: #2A2A31; transform: translateZ(-5px); }
.phone-btn.vol-up { left: -3px; top: 20%; height: 8%; }
.phone-btn.vol-dn { left: -3px; top: 30%; height: 8%; }
.phone-btn.power { right: -3px; top: 24%; height: 12%; }

/* ---------- Écrans de l'appli ---------- */
.ps {
  position: absolute; inset: 0; padding: 44px 16px 18px; display: flex; flex-direction: column; gap: 10px;
  opacity: 0; animation: ps-cycle 12s ease-in-out infinite;
}
.ps-1 { animation-delay: 0s; }
.ps-2 { animation-delay: -8s; }
.ps-3 { animation-delay: -4s; }
@keyframes ps-cycle {
  0% { opacity: 1; transform: none; }
  28% { opacity: 1; transform: none; }
  33% { opacity: 0; transform: translateY(6px); }
  95% { opacity: 0; transform: translateY(-6px); }
  100% { opacity: 1; transform: none; }
}
.ps-bar { display: flex; align-items: center; justify-content: space-between; font-size: 11px; font-weight: 600; margin-top: 4px; }
.ps-bar .ps-brand { display: flex; align-items: center; gap: 6px; }
.ps-bar .ps-avatar { width: 20px; height: 20px; border-radius: 50%; background: var(--blue, #3A57E8); color: #fff; display: grid; place-items: center; font-size: 10px; }
.ps-bar i { width: 18px; height: 18px; border-radius: 50%; background: var(--grey, #F4F5F7); }
.ps-title { font-size: 17px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; margin-top: 6px; }
.ps-sub { font-size: 11px; color: rgb(11 11 15 / .6); }
.ps-btn { margin-top: auto; padding: 11px; border-radius: 999px; background: var(--blue, #3A57E8); color: #fff; font-size: 12px; font-weight: 600; text-align: center; }
.ps-btn.ghost { background: var(--grey, #F4F5F7); color: var(--ink, #0B0B0F); margin-top: 0; }

/* Écran 1 : RDV */
.ps-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; font-size: 10px; text-align: center; margin-top: 4px; }
.ps-cal span { padding: 5px 0; border-radius: 8px; }
.ps-cal .h { color: rgb(11 11 15 / .45); font-weight: 600; }
.ps-cal .off { color: rgb(11 11 15 / .25); }
.ps-cal .sel { background: var(--blue, #3A57E8); color: #fff; font-weight: 600; }
.ps-slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.ps-slots span { padding: 8px 0; border-radius: 10px; background: var(--grey, #F4F5F7); font-size: 11px; font-weight: 600; text-align: center; }
.ps-slots .sel { background: var(--ink, #0B0B0F); color: #fff; }

/* Écran 2 : fidélité */
.ps-card { padding: 14px; border-radius: 16px; background: var(--ink, #0B0B0F); color: #fff; margin-top: 4px; }
.ps-card small { display: block; font-size: 10px; opacity: .7; margin-bottom: 8px; }
.ps-stamps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; }
.ps-stamps span { aspect-ratio: 1; border-radius: 50%; border: 1.5px solid rgb(255 255 255 / .3); }
.ps-stamps .on { background: var(--blue, #3A57E8); border-color: var(--blue, #3A57E8); }
.ps-line { height: 8px; border-radius: 4px; background: var(--grey, #F4F5F7); }
.ps-line.short { width: 60%; }

/* Écran 3 : rappel */
.ps-notif { padding: 12px; border-radius: 14px; background: var(--grey, #F4F5F7); display: grid; gap: 4px; margin-top: 6px; }
.ps-notif b { font-size: 12px; }
.ps-notif span { font-size: 11px; color: rgb(11 11 15 / .65); }
.ps-notif small { font-size: 10px; color: rgb(11 11 15 / .45); }
.ps-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.ps-row .ps-btn { margin-top: 0; padding: 9px; }

/* Indicateur des écrans */
.ps-dots { position: absolute; left: 0; right: 0; bottom: 7px; display: flex; justify-content: center; gap: 4px; z-index: 4; }
.ps-dots i { width: 4px; height: 4px; border-radius: 50%; background: rgb(11 11 15 / .2); animation: ps-dot 12s ease-in-out infinite; }
.ps-dots i:nth-child(1) { animation-delay: 0s; }
.ps-dots i:nth-child(2) { animation-delay: -8s; }
.ps-dots i:nth-child(3) { animation-delay: -4s; }
@keyframes ps-dot { 0%, 28% { background: var(--blue, #3A57E8); } 33%, 95% { background: rgb(11 11 15 / .2); } 100% { background: var(--blue, #3A57E8); } }

@media (min-width: 768px) { .phone-scene { --pw: 280px; } }
@media (min-width: 1024px) { .phone-scene { --pw: 300px; } }

@media (prefers-reduced-motion: reduce) {
  .ps, .ps-dots i { animation: none; }
  .ps-1 { opacity: 1; }
  .ps-dots i:nth-child(1) { background: var(--blue, #3A57E8); }
}

/* Variante : un seul écran fixe, taille réduite */
.ps-static { opacity: 1; animation: none; }
.phone-scene.phone-sm { --pw: 170px; }
@media (min-width: 768px) { .phone-scene.phone-sm { --pw: 220px; } }
.ps-gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 4px; }
.ps-gallery span { aspect-ratio: 1; border-radius: 10px; background: linear-gradient(160deg, #2A2A31, #0B0B0F); }
.ps-gallery span:nth-child(2n) { background: linear-gradient(160deg, #3A57E8, #1C2A8A); }
.ps-dark { background: #0B0B0F; color: #fff; }
.ps-dark .ps-bar i { background: rgb(255 255 255 / .12); }
.ps-dark .ps-sub { color: rgb(255 255 255 / .6); }
.ps-dark .ps-btn { background: #fff; color: #0B0B0F; }
