/* =====================================================================
   Versione 2 — aspetto più moderno e animazioni (si aggiunge a stile.css)
   ===================================================================== */
:root { --facile: cubic-bezier(.2, .8, .2, 1); }

/* Testata che si compatta scorrendo */
.testata { transition: box-shadow .3s, background .3s; }
.testata.scrollata { background: hsl(35 35% 96% / .92); box-shadow: 0 8px 30px -18px hsl(280 25% 25% / .35); }

/* Pulsanti */
.btn-grande { min-height: 56px; padding: 0 28px; font-size: 16.5px; }
.btn svg { transition: transform .25s var(--facile); }
.btn:hover svg { transform: translateX(4px); }
.btn-primario { background: linear-gradient(135deg, hsl(285 26% 38%), hsl(280 25% 28%)); }
.btn-primario:hover { background: linear-gradient(135deg, hsl(285 26% 34%), hsl(280 25% 24%)); box-shadow: 0 14px 30px -12px hsl(285 24% 32% / .8); }
.btn-vetro { background: hsl(0 0% 100% / .55); color: var(--ink); border-color: hsl(0 0% 100% / .8); backdrop-filter: blur(10px); box-shadow: var(--shadow-sm); }
.btn-vetro:hover { background: hsl(0 0% 100% / .85); }

/* ---------- Apertura ---------- */
.apertura { position: relative; isolation: isolate; overflow-x: clip; padding: 56px 0 110px; min-height: calc(100vh - 72px); display: flex; align-items: center; }
.apertura .contenitore { grid-template-columns: 1fr 1.05fr; gap: 48px; }
.apertura .btn-grande { padding: 0 24px; }
.aloni { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.alone { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; animation: deriva 22s ease-in-out infinite alternate; }
.alone.a1 { width: 520px; height: 520px; background: hsl(285 40% 75%); top: -140px; right: 8%; }
.alone.a2 { width: 420px; height: 420px; background: hsl(38 70% 78%); bottom: -120px; right: 32%; animation-duration: 26s; animation-delay: -6s; }
.alone.a3 { width: 360px; height: 360px; background: hsl(280 45% 88%); top: 18%; left: -120px; animation-duration: 30s; animation-delay: -12s; }
.griglia-fondo { position: absolute; inset: 0; background-image: radial-gradient(hsl(280 20% 40% / .14) 1px, transparent 1px); background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(ellipse 60% 55% at 70% 45%, #000 20%, transparent 75%); mask-image: radial-gradient(ellipse 60% 55% at 70% 45%, #000 20%, transparent 75%); }
@keyframes deriva { 0% { transform: translate(0, 0) scale(1); } 50% { transform: translate(40px, 30px) scale(1.08); } 100% { transform: translate(-30px, 50px) scale(.95); } }

.pillola { display: inline-flex; align-items: center; gap: 10px; padding: 8px 16px 8px 12px; border-radius: 999px; background: hsl(0 0% 100% / .6); border: 1px solid hsl(0 0% 100% / .9);
  backdrop-filter: blur(10px); box-shadow: var(--shadow-sm); font-size: 13px; font-weight: 600; letter-spacing: .04em; color: var(--aubergine); }
.pillola-punto { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); animation: pulsa 2.4s infinite; }
@keyframes pulsa { 0% { box-shadow: 0 0 0 0 hsl(38 50% 55% / .55); } 70% { box-shadow: 0 0 0 10px hsl(38 50% 55% / 0); } 100% { box-shadow: 0 0 0 0 hsl(38 50% 55% / 0); } }

.apertura h1 { font-size: clamp(46px, 6.6vw, 92px); margin: 22px 0 24px; letter-spacing: -.035em; }
.titolo-animato .riga { display: block; overflow: hidden; padding-bottom: .1em; }
.titolo-animato .riga > span { display: inline-block; transform: translateY(105%); animation: sali 1s var(--facile) forwards; }
.titolo-animato .riga:nth-child(2) > span { animation-delay: .14s; }
@keyframes sali { to { transform: none; } }
.sottolineato { position: relative; white-space: nowrap; }
.sottolineato svg { position: absolute; left: -2%; bottom: -.02em; width: 104%; height: .24em; overflow: visible; }
.sottolineato path { fill: none; stroke: var(--gold); stroke-width: 7; stroke-linecap: round; stroke-dasharray: 320; stroke-dashoffset: 320; animation: disegna 1.1s var(--facile) 1s forwards; }
@keyframes disegna { to { stroke-dashoffset: 0; } }

.entra { opacity: 0; transform: translateY(18px); animation: compari .9s var(--facile) forwards; }
.pillola.entra { animation-delay: .05s; }
.sottotitolo.entra { animation-delay: .45s; }
.azioni.entra { animation-delay: .6s; }
.punti-rapidi.entra { animation-delay: .75s; }
@keyframes compari { to { opacity: 1; transform: none; } }
.apertura .sottotitolo { font-size: 20px; line-height: 1.65; }

/* Scena 3D con dispositivi e notifiche */
.scena { position: relative; min-width: 0; padding: 40px 0 30px; }
.scena-interno { position: relative; transform: translate(var(--tx, 0px), var(--ty, 0px)); transition: transform .6s var(--facile); }
.portatile-3d { width: 90%; transform: perspective(1600px) rotateY(-13deg) rotateX(5deg) rotateZ(.5deg); transform-origin: left center; position: relative; z-index: 1; box-shadow: 0 50px 80px -40px hsl(280 30% 20% / .45), var(--shadow-lg);
  opacity: 0; animation: arriva-portatile 1.2s var(--facile) .25s forwards; }
@keyframes arriva-portatile { from { opacity: 0; transform: perspective(1600px) rotateY(-25deg) rotateX(12deg) translateY(60px); } to { opacity: 1; transform: perspective(1600px) rotateY(-13deg) rotateX(5deg) rotateZ(.5deg); } }
.telefono-galleggia { position: absolute; right: -2%; bottom: -8%; width: 31%; min-width: 140px; z-index: 3; opacity: 0;
  animation: arriva-telefono 1s var(--facile) .7s forwards, galleggia 6s ease-in-out 1.7s infinite; }
@keyframes arriva-telefono { from { opacity: 0; transform: translateY(80px) rotate(4deg); } to { opacity: 1; transform: none; } }
@keyframes galleggia { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-14px) rotate(-.6deg); } }

.notifica { position: absolute; z-index: 4; display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 16px; background: hsl(0 0% 100% / .82);
  border: 1px solid hsl(0 0% 100% / .95); backdrop-filter: blur(14px); box-shadow: 0 18px 40px -18px hsl(280 30% 20% / .45); font-size: 13px; line-height: 1.35;
  opacity: 0; transform: translateY(16px) scale(.94); animation: spunta .7s var(--facile) forwards, fluttua 7s ease-in-out infinite; }
.notifica strong { display: block; font-size: 13.5px; color: var(--ink); }
.notifica small { display: block; color: var(--muted); font-size: 12px; }
.notifica-icona { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.notifica-icona.viola { background: var(--lavanda); color: var(--aubergine); }
.notifica-icona.verde { background: hsl(150 45% 92%); color: hsl(150 45% 32%); }
.n1 { top: 0; left: -4%; animation-delay: 1.5s, 2.2s; }
.n2 { bottom: 4%; left: 6%; animation-delay: 2.3s, 3s; }
.n3 { top: 16%; right: 30%; flex-direction: column; align-items: flex-start; gap: 8px; padding: 14px 16px; animation-delay: 3.1s, 3.8s; }
.incasso small { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.incasso strong { font-family: var(--display); font-size: 26px; font-weight: 500; color: var(--aubergine); line-height: 1.1; }
.barrette { display: flex; align-items: flex-end; gap: 4px; height: 30px; }
.barrette i { width: 8px; border-radius: 3px; background: linear-gradient(var(--gold), hsl(38 50% 70%)); transform-origin: bottom; transform: scaleY(0); animation: cresci .6s var(--facile) forwards; }
.barrette i:nth-child(1) { height: 35%; animation-delay: 3.5s; }
.barrette i:nth-child(2) { height: 55%; animation-delay: 3.6s; }
.barrette i:nth-child(3) { height: 45%; animation-delay: 3.7s; }
.barrette i:nth-child(4) { height: 70%; animation-delay: 3.8s; }
.barrette i:nth-child(5) { height: 60%; animation-delay: 3.9s; }
.barrette i:nth-child(6) { height: 100%; animation-delay: 4s; background: linear-gradient(var(--aubergine), hsl(285 30% 55%)); }
@keyframes spunta { to { opacity: 1; transform: none; } }
@keyframes fluttua { 0%, 100% { translate: 0 0; } 50% { translate: 0 -8px; } }
@keyframes cresci { to { transform: scaleY(1); } }
.scena .didascalia { position: static; margin-top: 44px; }

.scorri { position: absolute; left: 50%; bottom: 26px; translate: -50% 0; width: 26px; height: 42px; border: 2px solid hsl(280 18% 18% / .25); border-radius: 14px; }
.scorri span { position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: var(--aubergine); animation: rotella 1.8s ease-in-out infinite; }
@keyframes rotella { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }

@media (max-width: 960px) {
  .apertura { min-height: 0; padding: 40px 0 90px; }
  .apertura .contenitore { grid-template-columns: 1fr; }
  .n3 { display: none; }
  .n1 { left: 0; top: -6px; }
  .n2 { left: 2%; bottom: 8%; }
  .scorri { display: none; }
}
@media (max-width: 560px) {
  .notifica { padding: 9px 12px; font-size: 12px; }
  .notifica strong { font-size: 12.5px; }
  .notifica small { font-size: 11px; }
  .notifica-icona { width: 28px; height: 28px; }
  .telefono-galleggia { width: 36%; right: -1%; }
  .alone.a1 { width: 320px; height: 320px; }
}

/* ---------- Nastro che scorre ---------- */
.nastro { background: var(--aubergine-ink); color: var(--cream); padding: 18px 0; overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.nastro-traccia { display: flex; width: max-content; animation: scorri-nastro 40s linear infinite; }
.nastro:hover .nastro-traccia { animation-play-state: paused; }
.nastro ul { display: flex; gap: 44px; padding: 0 22px; margin: 0; list-style: none; font-size: 15px; font-weight: 500; white-space: nowrap; }
.nastro li::first-letter { color: var(--gold); }
@keyframes scorri-nastro { to { transform: translateX(-50%); } }

/* ---------- Comparsa allo scorrimento ---------- */
html.animazioni-pronte .rivela { opacity: 0; transform: translateY(32px); transition: opacity .9s var(--facile), transform .9s var(--facile); }
html.animazioni-pronte .rivela.visibile { opacity: 1; transform: none; }
.griglia .scheda:nth-child(4n+2), .passi .passo:nth-child(2) { transition-delay: .08s; }
.griglia .scheda:nth-child(4n+3), .passi .passo:nth-child(3) { transition-delay: .16s; }
.griglia .scheda:nth-child(4n+4) { transition-delay: .24s; }

/* Schede vive */
.scheda { transition: transform .35s var(--facile), box-shadow .35s var(--facile), border-color .35s, opacity .9s var(--facile); }
html.animazioni-pronte .scheda.visibile:hover, .scheda:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: hsl(285 24% 32% / .25); transition-delay: 0s; }
.scheda .icona { transition: background .3s, color .3s, transform .3s var(--facile); }
.scheda:hover .icona { background: linear-gradient(135deg, hsl(285 26% 40%), hsl(280 25% 28%)); color: var(--cream); transform: rotate(-6deg) scale(1.06); }

/* ---------- Come si parte ---------- */
.passi-sfondo { background: linear-gradient(180deg, var(--cream), var(--cream-warm)); }
.passi { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; position: relative; }
.passi::before { content: ""; position: absolute; top: 34px; left: 16%; right: 16%; height: 2px; background: repeating-linear-gradient(90deg, hsl(38 50% 55% / .6) 0 8px, transparent 8px 16px); }
.passo { position: relative; background: var(--card); border: 1px solid var(--border); border-radius: 22px; padding: 28px; text-align: center; box-shadow: var(--shadow-sm); }
.passo-numero { width: 68px; height: 68px; margin: -62px auto 18px; display: grid; place-items: center; border-radius: 50%; font-family: var(--display); font-size: 30px; color: var(--cream);
  background: linear-gradient(135deg, hsl(285 28% 42%), hsl(280 25% 26%)); box-shadow: 0 12px 24px -10px hsl(285 24% 32% / .7), 0 0 0 6px var(--cream); position: relative; }
.passo h3 { font-size: 23px; margin-bottom: 8px; }
.passo p { color: var(--muted); font-size: 15.5px; }
#come-si-parte .sezione-testa { margin-bottom: 84px; }
@media (max-width: 860px) { .passi { grid-template-columns: 1fr; gap: 64px; } .passi::before { display: none; } }

/* ---------- Prezzo con bordo luminoso ---------- */
.prezzo { position: relative; border: 1px solid transparent; background: linear-gradient(var(--card), var(--card)) padding-box,
  linear-gradient(135deg, hsl(38 60% 65%), hsl(285 30% 60%), hsl(38 60% 65%)) border-box; box-shadow: 0 30px 60px -30px hsl(285 24% 32% / .45); }
.prezzo::before { content: ""; position: absolute; inset: -40px; z-index: -1; border-radius: 60px; background: radial-gradient(closest-side, hsl(38 70% 80% / .55), transparent); filter: blur(20px); }

/* ---------- Domande ---------- */
.domande details { transition: border-color .3s, box-shadow .3s; }
.domande details[open] { border-color: hsl(285 24% 32% / .3); box-shadow: var(--shadow-sm); }
.domande summary::after { transition: transform .3s var(--facile); }
.domande details[open] summary::after { content: "+"; transform: rotate(45deg); }

/* ---------- Contatti ---------- */
.contatti { position: relative; isolation: isolate; overflow: hidden; }
.aloni.scuri .alone { opacity: .22; }
.aloni.scuri .a1 { background: hsl(285 40% 55%); top: -120px; right: -80px; }
.aloni.scuri .a3 { background: hsl(38 60% 55%); top: auto; bottom: -160px; left: -100px; }
.modulo { box-shadow: 0 40px 80px -40px hsl(0 0% 0% / .55); }
.campo input, .campo select, .campo textarea { transition: border-color .2s, box-shadow .2s, background .2s; }
.campo input:focus, .campo select:focus, .campo textarea:focus { outline: none; border-color: var(--aubergine); background: #fff; box-shadow: 0 0 0 4px hsl(285 24% 32% / .12); }

/* ---------- Movimento ridotto ---------- */
@media (prefers-reduced-motion: reduce) {
  .entra, .telefono-galleggia, .notifica, .titolo-animato .riga > span { opacity: 1 !important; transform: none !important; animation: none !important; }
  .portatile-3d { opacity: 1 !important; animation: none !important; transform: perspective(1600px) rotateY(-13deg) rotateX(5deg) !important; }
  .sottolineato path { stroke-dashoffset: 0; animation: none; }
  .barrette i { transform: none; animation: none; }
  .nastro-traccia, .alone, .pillola-punto, .scorri span { animation: none; }
  html.animazioni-pronte .rivela { opacity: 1; transform: none; transition: none; }
}
#prezzo, .passi-sfondo { overflow-x: clip; }

/* Rifiniture: stesso stile, più spazio ai contenuti e alle schermate reali. */
.salta-contenuto { position: fixed; top: 10px; left: 10px; z-index: 100; padding: 12px 20px; background: var(--aubergine); color: white; border-radius: 12px; transform: translateY(-180%); }
.salta-contenuto:focus { transform: none; }
.apertura h1 { font-size: clamp(46px, 6.2vw, 84px); line-height: 1.02; }
.apertura .sottotitolo { max-width: 28em; font-size: 18px; }
.apertura .contenitore { gap: 42px; }
.portatile .schermo, .portatile.largo .schermo { aspect-ratio: 16 / 9; }
.portatile img, .portatile.largo img { width: 100%; max-width: 100%; height: 100%; object-fit: contain; }
.portatile .barra { background: linear-gradient(90deg, var(--lavanda), #f9f6fa); }
.scena { padding-bottom: 56px; }
.scena .didascalia { margin-top: 48px; font-size: 11px; }
.n3 { right: 8%; top: -18%; }
.n1 { left: -3%; top: -3%; }
.n2 { bottom: -8%; left: 3%; }
.telefono-galleggia { bottom: -18%; }
.funzione { gap: 52px; padding-block: 52px; }
.funzione .portatile { box-shadow: 0 20px 50px -22px hsl(280 25% 25% / .24); }
.modulo-intro h3 { font-size: 27px; margin-bottom: 6px; }
.modulo.inviato > :not(.modulo-intro):not(.esito), .modulo.inviato .modulo-intro p { display: none; }
.modulo-intro p, .nota-modulo { font-size: 13px; color: var(--muted); line-height: 1.5; }
.nota-modulo { text-align: center; }
.nota-prezzo { font-size: 13px; color: var(--muted); margin-top: 18px; }
.consenso { font-size: 13px; line-height: 1.55; }
.piede { border-top: 1px solid var(--border); }
.testo { width: min(760px, 100% - 40px); }
.testo p + p { margin-top: 14px; }
.testo h1 { max-width: 14ch; }
.testo .aggiornata { display: inline-block; margin-bottom: 28px; font-size: 13px; color: var(--muted); }
.testo .indice-privacy { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 20px 0; border-block: 1px solid var(--border); font-size: 14px; }
.testo section { margin-top: 36px; }
@media (max-width: 960px) {
  .apertura { padding: 36px 0 56px; }
  .apertura .contenitore { gap: 28px; }
  .apertura h1 { max-width: 12ch; }
  .scena { width: min(610px, 100%); margin-inline: auto; padding-top: 26px; }
  .n1 { top: -1%; left: 0; }
  .n2 { bottom: -12%; }
}
@media (max-width: 560px) {
  .apertura h1 { font-size: clamp(43px, 11vw, 60px); margin-block: 20px; max-width: none; }
  .apertura .sottotitolo { font-size: 16px; line-height: 1.65; }
  .pillola { font-size: 11px; padding: 7px 12px; }
  .azioni { gap: 10px; margin-top: 24px; }
  .azioni .btn { min-height: 50px; font-size: 14px; padding-inline: 18px; }
  .azioni .btn-vetro { min-height: 42px; padding-inline: 0; background: none; border: 0; box-shadow: none; text-decoration: underline; text-underline-offset: 5px; }
  .punti-rapidi { gap: 8px 14px; margin-top: 20px; font-size: 12px; }
  .scena { padding-top: 32px; padding-bottom: 46px; }
  .scena .didascalia { margin-top: 55px; font-size: 10px; }
  .telefono { border: 1px solid #5d5362; padding: 3px; box-shadow: 0 14px 28px -14px hsl(280 25% 20% / .42), inset 0 0 0 1px hsl(0 0% 100% / .1); }
  .telefono img { aspect-ratio: 390 / 844; object-fit: contain; }
  .telefono::before { content: ""; position: absolute; left: -2px; top: 24%; width: 2px; height: 12px; border-radius: 1px; background: #514658; box-shadow: 0 19px 0 #514658; pointer-events: none; }
  .telefono::after { content: ""; position: absolute; left: 50%; top: 7px; transform: translateX(-50%); width: 24%; max-width: 34px; height: 4px; border-radius: 999px; background: #26212c; pointer-events: none; }
  .telefono-galleggia { min-width: 100px; width: 32%; right: 0; padding: 3px; border-radius: clamp(13px, 4vw, 18px); }
  .telefono-galleggia img { border-radius: clamp(9px, calc(4vw - 4px), 14px); }
  .notifica { gap: 8px; padding: 8px 10px; border-radius: 12px; }
  .notifica small { font-size: 9px; }
  .notifica strong { font-size: 10.5px; }
  .notifica-icona { width: 25px; height: 25px; }
  .n2 { bottom: -17%; left: 0; }
  .sezione { padding-block: 64px; }
  .senza-sopra { padding-top: 0; }
  .sezione-testa { margin-bottom: 30px; }
  .sezione-testa p, .funzione p { font-size: 16px; }
  .funzione { gap: 30px; padding-block: 36px; }
  .elenco { font-size: 14px; gap: 12px; }
  .coppia-telefoni { gap: 18px; padding-bottom: 28px; }
  .coppia-telefoni .telefono { position: relative; min-width: 0; width: 45%; padding: 3px; border-radius: clamp(15px, 4.6vw, 20px); }
  .coppia-telefoni .telefono:last-child { transform: translateY(24px); }
  .coppia-telefoni .telefono img { border-radius: clamp(11px, calc(4.6vw - 4px), 16px); }
  .griglia { grid-template-columns: 1fr 1fr; gap: 10px; }
  .scheda { padding: 18px 15px; }
  .scheda h3 { font-size: 20px; }
  .scheda p { font-size: 13px; }
  .scheda .icona { width: 36px; height: 36px; margin-bottom: 12px; }
  .prezzo { padding: 30px 22px; }
  .prezzo h3 { font-size: 29px; }
  .cifra { font-size: 60px; }
  .cifra small { font-size: 14px; }
  .domande summary { font-size: 15px; }
  .domande details p { font-size: 14px; }
  .contatti .contenitore { gap: 30px; }
  .testo { padding-block: 36px 64px; }
}
@media (prefers-reduced-motion: reduce) {
  .scena-interno, .btn, .scheda { transition: none; }
  .notifica { translate: none; }
}
