/* Presentazioni animate (Conti, Eventi): un telefono disegnato in CSS che mostra il flusso a scene.
   Le scene le cambia js/demo.js; con «riduci movimento» si vede l'ultima scena, ferma. */

/* ── apertura della pagina ── */
.intro { display: grid; gap: 28px; padding-top: 20px; }
.intro .kicker { color: var(--blue-text); }
.intro h1 { font-size: 40px; letter-spacing: -.04em; line-height: 1.02; margin-top: 8px; }
.intro .lead { font-size: 17.5px; color: var(--soft); margin: 14px 0 20px; max-width: 520px; }
.intro .acts { display: flex; flex-wrap: wrap; gap: 10px; }
.intro .facts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.intro .facts span { background: var(--neutral); color: var(--soft); border-radius: 999px; padding: 5px 12px; font-size: 13.5px; font-weight: 700; }
@media (min-width: 820px) {
  .intro { grid-template-columns: 1.05fr .95fr; align-items: center; gap: 56px; padding-top: 48px; }
  .intro h1 { font-size: 64px; }
  .intro .lead { font-size: 19px; }
}

/* ── il telefono ── */
.stage { display: grid; justify-items: center; gap: 14px; }
.phone {
  position: relative; width: 300px; max-width: 100%; height: 500px;
  border-radius: 44px; background: var(--page);
  box-shadow: 0 0 0 9px #1B1B1E, 0 0 0 10px #3A3A40, 0 30px 60px -20px rgba(27, 27, 30, .45);
  overflow: hidden; margin: 10px auto 0;
}
.phone::before { /* isola dinamica */
  content: ""; position: absolute; top: 10px; left: 50%; transform: translateX(-50%);
  width: 92px; height: 26px; border-radius: 14px; background: #1B1B1E; z-index: 3;
}
.screen { position: absolute; inset: 0; padding: 50px 16px 16px; display: flex; flex-direction: column; gap: 10px; }
.screen .sh { display: flex; align-items: center; justify-content: space-between; font-weight: 800; font-size: 18px; letter-spacing: -.02em; }
.screen .sh small { font-size: 12px; color: var(--muted); font-weight: 700; letter-spacing: 0; }

/* ogni pezzo compare quando la sua scena (o una successiva) è attiva */
.phone [data-from] { opacity: 0; transform: translateY(14px) scale(.98); transition: opacity .45s ease, transform .45s cubic-bezier(.2, .8, .2, 1); }
.phone [data-from].in { opacity: 1; transform: none; }
.phone [data-only] { display: none; }
.phone [data-only].in { display: block; }
.phone .screen[data-only].in { display: flex; animation: screen-in .35s ease both; }
@keyframes screen-in { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }

/* didascalia sotto il telefono + puntini */
.caption { text-align: center; min-height: 52px; max-width: 320px; }
.caption b { display: block; font-size: 16px; }
.caption span { font-size: 14px; color: var(--soft); }
.dots { display: flex; gap: 6px; justify-content: center; }
.dots button { width: 8px; height: 8px; border-radius: 4px; border: 0; padding: 0; background: var(--neutral-2); transition: width .3s, background .3s; }
.dots button[aria-current="true"] { width: 22px; background: var(--blue); }
.dots button:focus-visible { outline-offset: 3px; }

/* elementi ricorrenti dentro il telefono */
.m-card { background: var(--lilac); border-radius: 18px; padding: 12px 14px; }
.m-card.white { background: var(--page); box-shadow: inset 0 0 0 1px var(--border); }
.m-card.mint { background: var(--mint); }
.m-card.sky { background: var(--sky); }
.m-card.warm { background: var(--warm); }
.m-row { display: flex; align-items: center; gap: 10px; }
.m-row + .m-row { margin-top: 8px; }
.m-t { font-weight: 800; font-size: 15px; line-height: 1.2; }
.m-s { font-size: 12.5px; color: var(--soft); font-weight: 600; }
.m-a { margin-left: auto; font-weight: 800; white-space: nowrap; }
.m-big { font-size: 30px; font-weight: 800; letter-spacing: -.03em; line-height: 1.05; }
.phone .face { width: 34px; height: 34px; font-size: 14px; }
.phone .face.xs { width: 26px; height: 26px; font-size: 11.5px; }
.phone .petal.sm { width: 34px; height: 34px; }
.m-faces { display: flex; gap: 10px; }
.m-faces > div { display: grid; justify-items: center; gap: 3px; font-size: 12px; font-weight: 700; }
.m-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--page); border-radius: 999px; padding: 4px 10px 4px 4px; font-size: 12.5px; font-weight: 700; }
.m-pill { display: inline-block; border-radius: 999px; padding: 2px 9px; font-size: 11.5px; font-weight: 800; }
.m-pill.yes { background: var(--mint); color: var(--green); }
.m-pill.no { background: var(--rose); color: var(--red); }
.m-pill.wait { background: var(--neutral); color: var(--soft); }
.m-bar { height: 8px; border-radius: 4px; background: var(--chip); overflow: hidden; flex: 1; }
.m-bar i { display: block; height: 100%; width: 0; background: var(--blue); border-radius: 4px; transition: width 1s cubic-bezier(.2, .8, .2, 1) .2s; }
.m-btn { display: block; text-align: center; background: var(--blue); color: #fff; border-radius: 999px; padding: 10px; font-weight: 800; font-size: 14px; }
.m-wa { align-self: flex-end; max-width: 86%; background: #DCF8C6; color: #1B1B1E; border-radius: 14px 14px 4px 14px; padding: 9px 11px; font-size: 12.5px; line-height: 1.35; white-space: pre-line; box-shadow: 0 1px 1px rgba(0, 0, 0, .08); }
.m-tap { position: absolute; width: 34px; height: 34px; border-radius: 50%; background: rgba(37, 99, 235, .25); box-shadow: 0 0 0 2px rgba(37, 99, 235, .5); pointer-events: none; opacity: 0; z-index: 4; }
.m-tap.in { animation: tap 1.1s ease .5s both; }
@keyframes tap { 0% { opacity: 0; transform: scale(.4); } 30% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.4); } }

/* video facoltativo (config.js → videos) */
.video-sheet video { width: 100%; max-height: 70vh; border-radius: 16px; background: #000; display: block; }

/* ── come funziona: passi numerati ── */
.steps { display: grid; gap: 12px; counter-reset: step; margin-top: 8px; }
.step { display: flex; gap: 14px; align-items: flex-start; }
.step::before {
  counter-increment: step; content: counter(step);
  flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: var(--blue); color: #fff; font-weight: 800; font-size: 15px;
}
.step h3 { font-size: 17px; margin-top: 5px; }
.step p { color: var(--soft); font-size: 15px; margin-top: 4px; }
@media (min-width: 820px) { .steps { grid-template-columns: repeat(3, 1fr); gap: 24px; } .step { flex-direction: column; } }

.section { margin-top: 56px; }
@media (min-width: 820px) { .section { margin-top: 88px; } }

/* griglia di funzioni */
.fgrid { display: grid; gap: 12px; }
.fcard { display: flex; gap: 14px; align-items: flex-start; }
.fcard h3 { font-size: 17px; }
.fcard p { color: var(--soft); font-size: 14.5px; margin-top: 4px; }
.fcard .pill { margin-top: 8px; }
@media (min-width: 640px) { .fgrid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 980px) { .fgrid { grid-template-columns: repeat(3, 1fr); } }

/* «riduci movimento»: le scene cambiano lo stesso, ma solo in dissolvenza, senza spostamenti */
@media (prefers-reduced-motion: reduce) {
  .phone [data-from] { transform: none; transition: opacity .4s ease; }
  .phone .screen[data-only].in { animation: screen-fade .4s ease both; }
  .m-bar i { transition: none; }
  .m-tap { display: none; }
}
@keyframes screen-fade { from { opacity: 0; } to { opacity: 1; } }

/* ── schermate vere dell'app (config.js → screens) ── */
.phone.real-mode { width: 280px; height: auto; aspect-ratio: 1179 / 2556; background: #000; cursor: pointer; }
.phone.real-mode::before { display: none; }               /* l'isola c'è già nella registrazione */
.phone .real { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.phone img.real[data-only] { display: block; opacity: 0; transition: opacity .5s ease; }
.phone img.real[data-only].in { opacity: 1; }
