/* ==========================================================================
   SCENE 3D DI SCROLL — "Portale" e "Tunnel"
   Ispirate ai template uberdesigner "portale" e "alpha-project", ricostruite
   in CSS 3D con i colori Wenexia e sincronizzate con il fluido WebGL.
   Le trasformazioni per-frame le scrive scenes.js; qui solo struttura e stile.
   ========================================================================== */
.sc-portal { position: relative; height: 400vh; }
.sc-tunnel { position: relative; height: 1122vh; }   /* 720vh × 1.42 + 100vh: la mano ha il doppio dello scroll (scenes.js HAND_STRETCH) */
.sc-stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }

/* Titoli comuni alle scene */
.sc-h { font-size: 2.4rem; font-weight: 500; line-height: 1.04; letter-spacing: -0.03em; color: var(--heading); margin: 1.1rem 0 0; }
.sc-lead { margin: 1rem 0 0; font-size: 1rem; line-height: 1.5; color: var(--body-muted); max-width: 30rem; }
.sc-hint { margin: 1.5rem 0 0; font-size: .8rem; color: var(--body-muted); letter-spacing: .02em; animation: sc-nudge 2.4s ease-in-out infinite; }
@keyframes sc-nudge { 0%, 100% { transform: translateY(0); opacity: .6; } 50% { transform: translateY(.35rem); opacity: 1; } }
@media (min-width: 640px) { .sc-h { font-size: 3.6rem; } .sc-lead { font-size: 1.1rem; } }
@media (min-width: 1024px) { .sc-h { font-size: 4.6rem; } }

/* ---------- PORTALE ---------- */
.sc-portal-view { position: absolute; inset: 0; display: grid; place-items: center; perspective: 1400px; perspective-origin: 50% 46%; pointer-events: none; }
.sc-portal-world { transform-style: preserve-3d; }
.sc-card { --ch: min(56vh, 30rem); position: relative; height: var(--ch); width: calc(var(--ch) * 652 / 1024); border-radius: calc(var(--ch) * .05);
  transform-style: preserve-3d; will-change: transform; transform: translate3d(20vw, 0, 0) rotateY(-34deg) rotateX(16deg) rotateZ(-7deg); }
.sc-card-light, .sc-card-fill, .sc-card-rim { position: absolute; inset: 0; border-radius: inherit; }
.sc-card-light { overflow: hidden; border: 1px solid rgba(255,255,255,.38);
  background: linear-gradient(150deg, rgba(255,255,255,.22) 0%, rgba(255,255,255,.06) 42%, rgba(155,88,148,.16) 100%);
  backdrop-filter: blur(16px) saturate(140%); -webkit-backdrop-filter: blur(16px) saturate(140%);
  box-shadow: 0 50px 140px -40px rgba(0,180,217,.65), 0 30px 90px -40px rgba(155,88,148,.7), inset 0 1px 0 rgba(255,255,255,.4); }
.sc-card-light::before { content: ""; position: absolute; inset: -40%; background: linear-gradient(115deg, transparent 40%, rgba(255,255,255,.28) 50%, transparent 60%);
  animation: sc-sheen 5.5s cubic-bezier(.45,0,.2,1) infinite; pointer-events: none; }
@keyframes sc-sheen { 0% { transform: translateX(-60%); } 55%, 100% { transform: translateX(60%); } }
.sc-card-face { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; padding: calc(var(--ch) * .065); color: #fff; }
.sc-card-top { display: flex; align-items: center; justify-content: space-between; }
.sc-card-logo { height: calc(var(--ch) * .05); width: auto; }
.sc-card-tag { font-size: calc(var(--ch) * .022); font-weight: 600; letter-spacing: .32em; padding: .35em .55em .35em .8em; border-radius: 9999px; border: 1px solid rgba(255,255,255,.45); color: #fff; }
.sc-card-qr { align-self: center; width: 62%; aspect-ratio: 1; padding: 7%; border-radius: calc(var(--ch) * .03); background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.25);
  box-shadow: 0 0 40px rgba(63,214,242,.35), inset 0 0 30px rgba(255,255,255,.08); }
.sc-card-qr > div, .sc-card-qr svg { width: 100%; height: 100%; display: block; }
.sc-card-qr svg { filter: invert(1); mix-blend-mode: screen; }
.sc-card-qr svg rect[fill="#ffffff"], .sc-card-qr svg rect[fill="white"] { fill: transparent; }
.sc-card-bottom { display: flex; flex-direction: column; gap: calc(var(--ch) * .012); }
.sc-card-name { font-size: calc(var(--ch) * .03); letter-spacing: .18em; color: rgba(255,255,255,.75); }
.sc-card-code { font-size: calc(var(--ch) * .05); font-weight: 500; letter-spacing: .06em; font-variant-numeric: tabular-nums; }
.sc-card-rim { border: calc(var(--ch) * .016) solid #fff; opacity: 0;
  box-shadow: 0 0 36px 8px rgba(255,255,255,.85), 0 0 90px 20px rgba(63,214,242,.55), inset 0 0 28px 6px rgba(255,255,255,.7); }
.sc-card-fill { opacity: 0; background: radial-gradient(circle at 50% 46%, #ffffff 0%, #effcff 32%, #a9ecfa 62%, #c9a0e0 100%); }

.sc-portal-copy { position: absolute; left: 1.25rem; right: 1.25rem; bottom: 2.5rem; z-index: 3; will-change: transform, opacity; }
@media (min-width: 640px) { .sc-portal-copy { left: 2.5rem; right: auto; max-width: 40rem; bottom: 3.5rem; } }

.sc-ready { position: absolute; inset: 0; z-index: 4; opacity: 0; visibility: hidden; }
.sc-ready-grid { position: absolute; inset: 0; display: grid; grid-template-columns: 1fr; align-content: center; gap: 2rem; padding: 5.5rem 1.25rem 2.5rem; }
@media (min-width: 900px) { .sc-ready-grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); align-items: center; align-content: center; gap: 4rem; padding: 6rem 4rem 4rem; max-width: 92rem; margin: 0 auto; } }
.sc-ready-copy { position: relative; z-index: 2; max-width: 40rem; text-shadow: 0 2px 24px rgba(4,5,12,.85); }
.sc-ready-title { margin: 1.4rem 0 0; font-size: 2.6rem; font-weight: 500; line-height: 1.02; letter-spacing: -.04em; color: var(--heading); }
.sc-rl { display: block; padding-bottom: .08em; }
.sc-ready-title .grad-text { background-image: linear-gradient(120deg, #3fd6f2, #8c9cf0 45%, #d08acb); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none; }
@media (min-width: 640px) { .sc-ready-title { font-size: 4rem; } }
@media (min-width: 1200px) { .sc-ready-title { font-size: 5.2rem; } }
.sc-ready-text { margin: 1.5rem 0 0; font-size: 1rem; line-height: 1.55; color: var(--body-muted); max-width: 32rem; }
@media (min-width: 640px) { .sc-ready-text { font-size: 1.15rem; } }
.sc-ready-actions { display: flex; align-items: center; gap: 1.5rem; margin-top: 2rem; flex-wrap: wrap; }
.sc-ready-more { font-size: .9rem; color: var(--body-muted); }

.sc-ready-visual { position: relative; display: grid; place-items: center; perspective: 1200px; }
.sc-ready-glow { position: absolute; width: 120%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, rgba(0,180,217,.28), rgba(155,88,148,.18) 40%, transparent 68%); filter: blur(20px); pointer-events: none; }
.sc-ready-float { position: relative; width: min(100%, 30rem); }
.sc-ready-tilt { transform-style: preserve-3d; }
.sc-flow { position: relative; padding: 1.6rem; border-radius: 1.75rem; color: #fff; animation: sc-float 3.4s ease-in-out infinite alternate;
  background: linear-gradient(155deg, rgba(255,255,255,.17), rgba(255,255,255,.04) 55%, rgba(155,88,148,.12));
  border: 1px solid rgba(255,255,255,.22); backdrop-filter: blur(22px) saturate(150%); -webkit-backdrop-filter: blur(22px) saturate(150%);
  box-shadow: 0 60px 120px -50px rgba(0,180,217,.75), 0 40px 100px -60px rgba(155,88,148,.9), inset 0 1px 0 rgba(255,255,255,.35); }
@keyframes sc-float { from { transform: translateY(.6%) rotate(-.6deg); } to { transform: translateY(-.6%) rotate(.6deg); } }
.sc-flow-top { display: flex; align-items: center; justify-content: space-between; }
.sc-flow-top img { height: 1.35rem; width: auto; }
.sc-flow-top .sc-card-tag { font-size: .6rem; }
.sc-flow-head { display: flex; align-items: center; gap: .9rem; margin: 1.4rem 0 1.2rem; padding: .9rem 1rem; border-radius: 1.1rem; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); }
.sc-flow-head strong { display: block; font-weight: 500; font-size: 1rem; }
.sc-flow-head small { display: block; color: var(--body-muted); font-size: .8rem; margin-top: .15rem; }
.sc-flow-av { width: 2.5rem; height: 2.5rem; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: .8rem; font-weight: 600; background: linear-gradient(135deg, #00B4D9, #9B5894); }
.sc-flow-live { margin-left: auto; display: inline-flex; align-items: center; gap: .4rem; font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: #3ee0a1; }
.sc-flow-live i { width: .45rem; height: .45rem; border-radius: 50%; background: #3ee0a1; box-shadow: 0 0 10px #3ee0a1; animation: pulse 1.6s infinite; }
.sc-flow-steps { list-style: none; margin: 0; padding: 0 0 0 .2rem; position: relative; display: flex; flex-direction: column; gap: 1.05rem; }
.sc-flow-steps::before, .sc-flow-steps::after { content: ""; position: absolute; left: 1.05rem; top: 1rem; width: 2px; border-radius: 2px; }
.sc-flow-steps::before { bottom: 1rem; background: rgba(255,255,255,.1); }
.sc-flow-steps::after { height: 0; background: linear-gradient(#3fd6f2, #c27fbb); box-shadow: 0 0 12px rgba(63,214,242,.8); transition: height .3s ease; }
.sc-flow-steps li { position: relative; display: flex; align-items: center; gap: .95rem; opacity: .35; transition: opacity .3s ease; }
.sc-flow-steps li strong { display: block; font-weight: 500; font-size: .98rem; }
.sc-flow-steps li small { display: block; color: var(--body-muted); font-size: .8rem; margin-top: .1rem; }
.sc-flow-steps li em { margin-left: auto; font-style: normal; font-size: .75rem; color: var(--body-muted); font-variant-numeric: tabular-nums; }
.sc-flow-dot { position: relative; z-index: 1; width: 1.75rem; height: 1.75rem; flex: none; border-radius: 50%; display: grid; place-items: center; background: #0b0d18; border: 1.5px solid rgba(255,255,255,.25); transition: background .3s ease, border-color .3s ease, box-shadow .3s ease; }
.sc-flow-dot svg { width: .95rem; height: .95rem; fill: none; stroke: #04050c; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 24; stroke-dashoffset: 24; transition: stroke-dashoffset .3s ease; }
.sc-flow-foot { margin-top: 1.4rem; padding-top: 1.1rem; border-top: 1px solid rgba(255,255,255,.1); }
.sc-flow-foot-row { display: flex; justify-content: space-between; gap: 1rem; font-size: .85rem; color: var(--body-muted); }
.sc-flow-foot-row strong { color: #fff; font-weight: 500; }
.sc-flow-bar { margin-top: .7rem; height: .4rem; border-radius: 9999px; background: rgba(255,255,255,.08); overflow: hidden; }
.sc-flow-bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #00B4D9, #8c9cf0, #c27fbb); box-shadow: 0 0 14px rgba(0,180,217,.7); transition: width .3s ease; }

/* Stato iniziale della seconda schermata (all'indietro si chiude veloce) */
.sc-r, .sc-ready-title .sc-rl { opacity: 0; transform: translate3d(0, 1.5rem, 0); filter: blur(10px); transition: opacity .3s ease, transform .3s ease, filter .3s ease; }
.sc-ready-float { opacity: 0; transform: translate3d(var(--fx, 0px), var(--fy, 0px), 0) scale(.86); filter: blur(14px) brightness(2.2); transition: opacity .25s ease, transform .35s ease, filter .35s ease; }

/* Rivelazione: classe .is-ready aggiunta da scenes.js */
.sc-portal.is-settled .sc-r, .sc-portal.is-settled .sc-ready-title .sc-rl { opacity: 1; transform: none; filter: none;
  transition: opacity .8s cubic-bezier(.22,1,.36,1), transform .9s cubic-bezier(.22,1,.36,1), filter .8s cubic-bezier(.22,1,.36,1); transition-delay: calc(var(--d, 0) * .12s + .1s); }
.sc-portal.is-ready .sc-ready-float { opacity: 1; transform: translate3d(var(--fx, 0px), var(--fy, 0px), 0) scale(1.08); filter: none; transition: opacity .45s ease, transform .9s cubic-bezier(.16,1,.3,1), filter .9s cubic-bezier(.16,1,.3,1); }
.sc-portal.is-ready.is-settled .sc-ready-float { transform: none; transition: opacity .45s ease, transform 1.1s cubic-bezier(.65,0,.35,1), filter .6s ease; }
.sc-portal.is-settled .sc-flow-steps li { opacity: 1; transition: opacity .5s ease calc(.9s + var(--s) * .55s); }
.sc-portal.is-settled .sc-flow-dot { background: #3fd6f2; border-color: #3fd6f2; box-shadow: 0 0 16px rgba(63,214,242,.8); transition-delay: calc(.9s + var(--s) * .55s); }
.sc-portal.is-settled li.last .sc-flow-dot { background: #c27fbb; border-color: #c27fbb; box-shadow: 0 0 16px rgba(194,127,187,.85); }
.sc-portal.is-settled .sc-flow-dot svg { stroke-dashoffset: 0; transition: stroke-dashoffset .45s ease calc(1.05s + var(--s) * .55s); }
.sc-portal.is-settled .sc-flow-steps::after { height: calc(100% - 2rem); transition: height 1.4s cubic-bezier(.65,0,.35,1) .95s; }
.sc-portal.is-settled .sc-flow-bar i { width: 100%; transition: width 1.6s cubic-bezier(.65,0,.35,1) 2.2s; }

@media (max-width: 899px) {
  .sc-ready-grid { align-content: start; padding-top: 6rem; gap: 1.6rem; }
  .sc-ready-actions { margin-top: 1.4rem; }
  .sc-flow { padding: 1.2rem; }
  .sc-flow-head { margin: 1rem 0 .9rem; }
}
@media (max-width: 899px) and (max-height: 760px) { .sc-ready-text { display: none; } }
@media (prefers-reduced-motion: reduce) { .sc-flow, .sc-flow-live i { animation: none !important; } }

/* ---------- TUNNEL ---------- */
.sc-tunnel-view { position: absolute; inset: 0; perspective: 900px; perspective-origin: 50% 50%; overflow: hidden; }
.sc-tunnel-world { position: absolute; left: 50%; top: 50%; width: 0; height: 0; transform-style: preserve-3d; will-change: transform; }
.sc-tunnel-world > * { position: absolute; left: 0; top: 0; will-change: opacity; backface-visibility: hidden; }
.sc-ring { width: 118vmin; height: 92vmin; }
.sc-ring i { position: absolute; inset: 0; border-radius: 50%; border: 1px solid rgba(255,255,255,.10); }
.sc-ring i::before, .sc-ring i::after { content: ""; position: absolute; inset: -1px; border-radius: 50%;
  background: conic-gradient(from var(--rot), transparent 0deg, rgba(63,214,242,.95) 50deg, transparent 110deg, transparent 180deg, rgba(194,127,187,.95) 235deg, transparent 300deg);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px)); mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px));
  animation: spin 18s linear infinite; }
.sc-ring i::after { inset: -10px; opacity: .35; -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 22px), #000 calc(100% - 10px), transparent 100%); mask: radial-gradient(farthest-side, transparent calc(100% - 22px), #000 calc(100% - 10px), transparent 100%); }
.sc-ring.v i::before, .sc-ring.v i::after { animation-direction: reverse; animation-duration: 24s;
  background: conic-gradient(from var(--rot), transparent 0deg, rgba(194,127,187,.95) 60deg, transparent 130deg, transparent 190deg, rgba(95,134,214,.95) 250deg, transparent 320deg); }

.sc-step { width: min(84vw, 24rem); padding: 1.75rem; border-radius: 1.6rem; color: var(--heading);
  background: linear-gradient(160deg, rgba(255,255,255,.16), rgba(255,255,255,.04)); border: 1px solid var(--glass-border);
  backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%);
  box-shadow: 0 40px 100px -40px rgba(0,180,217,.6), inset 0 1px 0 rgba(255,255,255,.3); }
.sc-step-n { position: absolute; right: 1.5rem; top: 1.1rem; font-size: 3.4rem; font-weight: 600; letter-spacing: -.05em; color: transparent; -webkit-text-stroke: 1px rgba(255,255,255,.25); }
.sc-step-ico { width: 3rem; height: 3rem; border-radius: 1rem; display: grid; place-items: center; background: rgba(255,255,255,.1); border: 1px solid var(--glass-border); margin-bottom: 1.4rem; }
.sc-step-ico .ico { width: 1.4rem; height: 1.4rem; color: #3fd6f2; }
.sc-step h3 { font-size: 1.5rem; margin: 0 0 .5rem; }
.sc-step p { margin: 0; color: var(--body-muted); font-size: .98rem; line-height: 1.5; }

.sc-emblem { width: 62vmin; height: 62vmin; }
.sc-emblem-text { position: absolute; inset: 0; width: 100%; height: 100%; animation: spin 26s linear infinite; overflow: visible; }
.sc-emblem-text text { font: 600 8.6px var(--font); letter-spacing: .32em; fill: rgba(255,255,255,.85); }
.sc-emblem-core { position: absolute; inset: 18%; border-radius: 50%; display: grid; place-items: center; color: #fff;
  background: radial-gradient(circle at 35% 30%, #c07ab8, #9B5894 45%, #4a2547 100%);
  box-shadow: 0 0 0 1px rgba(255,255,255,.14), 0 0 120px 10px rgba(155,88,148,.75), 0 0 220px 40px rgba(0,180,217,.25), inset 0 -24px 48px rgba(0,0,0,.35), inset 0 12px 32px rgba(255,255,255,.2); }
.sc-emblem-core svg { width: 44%; height: auto; filter: drop-shadow(0 6px 20px rgba(0,0,0,.4)); }
.sc-emblem-core .core-dot { position: absolute; width: 12%; aspect-ratio: 1; border-radius: 50%; left: 18%; top: 28%; background: var(--cyan); box-shadow: 0 0 30px var(--cyan), 0 0 60px var(--cyan); }

.sc-tunnel-shade { position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background: linear-gradient(180deg, rgba(4,5,12,.55), transparent 22%, transparent 60%, rgba(4,5,12,.75)); }
.sc-copy { position: absolute; left: 1.25rem; right: 1.25rem; bottom: 2.5rem; z-index: 3; will-change: transform, opacity; }
.sc-copy[data-block="final"] { opacity: 0; visibility: hidden; }
@media (min-width: 640px) { .sc-copy { left: 2.5rem; right: auto; max-width: 44rem; bottom: 3.5rem; } }
.sc-w { display: inline-block; opacity: var(--reveal, 0); transform: translate3d(0, calc((1 - var(--reveal, 0)) * 1.6rem), 0); filter: blur(calc((1 - var(--reveal, 0)) * 7px));
  transition: opacity .58s linear, transform .58s linear, filter .58s linear; }
.sc-w.grad-text { background-image: linear-gradient(120deg, #3fd6f2, #8c9cf0 45%, #d08acb); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sc-copy .sc-lead { opacity: var(--detail, 0); transform: translate3d(0, calc((1 - var(--detail, 0)) * 1rem), 0); }
.sc-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: rgba(255,255,255,.06); z-index: 3; }
.sc-progress i { display: block; height: 100%; background: linear-gradient(90deg, #00B4D9, #9B5894); transform-origin: left; transform: scaleX(0); box-shadow: 0 0 12px rgba(0,180,217,.7); }

/* Movimento ridotto: niente animazioni decorative; le scene seguono comunque lo scroll dell'utente */
@media (prefers-reduced-motion: reduce) {
  .sc-hint, .sc-card-light::before, .sc-mini, .sc-ring i::before, .sc-ring i::after, .sc-emblem-text { animation: none !important; }
}

/* Nessuna banda scura con bordo netto tra le scene: la leggibilità del testo è affidata all'ombra del testo */
.sc-tunnel-shade { display: none; }
.sc-copy, .sc-portal-copy, .sc-ready-text { text-shadow: 0 2px 24px rgba(4,5,12,.85), 0 0 2px rgba(4,5,12,.6); }

.sc-ready-visual { width: 100%; justify-items: center; }
.sc-ready-float { width: 30rem; max-width: 100%; }
@media (min-width: 640px) and (max-width: 899px) { .sc-ready-grid { grid-template-columns: 1.1fr .9fr; align-items: center; align-content: center; gap: 2rem; padding: 6rem 2.5rem 3rem; } .sc-ready-title { font-size: 3rem; } }

/* Spegnimento a tempo della carta di luce quando si apre la seconda schermata */
.sc-card { transition: opacity .2s ease, visibility 0s linear 0s; }
.sc-portal.is-ready .sc-card { transition: opacity .85s cubic-bezier(.4,0,.2,1), visibility 0s linear .85s; }

/* Mano a particelle che tocca il QR (fine spirale) */
.sc-hand { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; display: block; }
.sc-tunnel-world { transition: none; }

/* ---------- FLOW WAVE (fine home) ---------- */
.sc-wave { position: relative; height: 520vh; }
.sc-wave .sc-stage { background: #030614; }
.sc-wave-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
/* raccordo morbido con la sezione sopra: niente bordo netto all'ingresso */
.sc-wave-fade { position: absolute; left: 0; right: 0; top: 0; height: 22vh; z-index: 1; pointer-events: none; background: linear-gradient(#04050c, rgba(4,5,12,0)); opacity: calc(1 - var(--wave-p, 0) * 6); }
.sc-wave-copy { position: absolute; left: 1.25rem; right: 1.25rem; bottom: 2.5rem; z-index: 3; opacity: 0; visibility: hidden; will-change: opacity, transform; text-shadow: 0 2px 24px rgba(3,6,20,.85); }
.sc-wave-copy.center { left: 50%; right: auto; bottom: auto; top: 50%; width: min(92vw, 52rem); margin: 0; text-align: center; translate: -50% -50%; }
.sc-wave-copy.center .sc-lead { margin-left: auto; margin-right: auto; }
.sc-wave-copy .sc-lead { opacity: var(--detail, 0); }
.sc-wave-cta { margin-top: 1.75rem; opacity: var(--detail, 0); pointer-events: auto; }
@media (min-width: 640px) { .sc-wave-copy:not(.center) { left: 2.5rem; right: auto; max-width: 44rem; bottom: 3.5rem; } }
/* senza WebGL o con movimento ridotto: testo finale sempre visibile */
.sc-wave:not(.is-live) .sc-wave-copy.center { opacity: 1; visibility: visible; --detail: 1; }
.sc-wave:not(.is-live) .sc-wave-copy.center .sc-w { --reveal: 1; }
.sc-wave-copy.center::before { content: ""; position: absolute; inset: -18% -12%; z-index: -1; border-radius: 50%; background: radial-gradient(closest-side, rgba(3,6,20,.82), rgba(3,6,20,.55) 55%, rgba(3,6,20,0)); pointer-events: none; }

/* Flow Wave tutt'uno con lo sfondo: nessun fondo pieno, bordi sfumati */
.sc-wave .sc-stage { background: transparent; }
.sc-wave-fade { display: none; }
.sc-wave-canvas { -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 22%, #000 82%, transparent 100%); mask-image: linear-gradient(to bottom, transparent 0%, #000 22%, #000 82%, transparent 100%); }

/* Onde più discrete: leggermente opache e sfocate */
.sc-wave-canvas { opacity: .7; filter: blur(1.1px) saturate(.85); }

/* ---------- MAPPA OLOGRAFICA (backoffice · Point e sedi) ---------- */
.view-switch { display: inline-flex; gap: 4px; padding: 4px; border-radius: 9999px; background: var(--glass-fill); border: 1px solid var(--glass-border); margin-bottom: 18px; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.view-switch a { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 9999px; color: var(--body-muted); font-weight: 500; font-size: 14px; transition: background .25s ease, color .25s ease; }
.view-switch a .ico { width: 16px; height: 16px; }
.view-switch a:hover { color: #fff; }
.view-switch a.is-on { background: #fff; color: #2f2f33; }
.map-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: stretch; }
@media (max-width: 1100px) { .map-layout { grid-template-columns: 1fr; } }
.italy-map { position: relative; height: clamp(520px, 74vh, 860px); border-radius: 26px; overflow: hidden; border: 1px solid var(--glass-border);
  background: radial-gradient(120% 90% at 50% 60%, rgba(0,180,217,.08), rgba(5,7,20,.72) 60%), rgba(5,7,20,.6);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 40px 120px -60px rgba(0,180,217,.6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.italy-map::after { content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: repeating-linear-gradient(0deg, rgba(255,255,255,.018) 0 1px, transparent 1px 4px); mix-blend-mode: screen; }
.italy-map canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
.italy-map canvas:active { cursor: grabbing; }
.map-hud { position: absolute; left: 22px; top: 20px; z-index: 2; pointer-events: none; }
.map-stats { display: flex; gap: 16px; font-size: 13px; color: var(--body-muted); margin-top: 6px; }
.map-stats strong { color: #fff; font-size: 20px; font-weight: 500; margin-right: 4px; }
.map-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; font-size: 12px; color: var(--body-muted); }
.map-legend span { display: inline-flex; align-items: center; gap: 6px; }
.map-legend span::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); box-shadow: 0 0 10px var(--c); }
.map-controls { position: absolute; right: 18px; top: 18px; z-index: 2; display: flex; gap: 8px; }
.map-tour.is-on { background: #fff; color: #2f2f33; border-color: transparent; }
.map-tour.is-on .ico { color: #2f2f33; }
.map-hint { position: absolute; right: 22px; bottom: 16px; margin: 0; font-size: 12px; color: rgba(185,190,207,.7); z-index: 2; pointer-events: none; }
.map-empty { position: absolute; inset: 0; display: grid; place-items: center; z-index: 2; }
.map-card { position: absolute; left: 20px; bottom: 20px; z-index: 3; width: min(340px, calc(100% - 40px)); padding: 18px; border-radius: 20px;
  background: rgba(10,12,28,.72); border: 1px solid rgba(255,255,255,.16); backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: 0 30px 80px -30px rgba(0,180,217,.6); opacity: 0; transform: translate3d(0, 16px, 0) scale(.97); filter: blur(6px); pointer-events: none;
  transition: opacity .35s ease, transform .5s cubic-bezier(.22,1,.36,1), filter .4s ease; }
.map-card.is-on { opacity: 1; transform: none; filter: none; pointer-events: auto; }
.map-card h3 { margin: 10px 0 2px; font-size: 1.25rem; }
.map-card-status { --c: #3fd6f2; display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: var(--c); padding: 4px 10px; border-radius: 9999px; background: color-mix(in srgb, var(--c) 14%, transparent); border: 1px solid color-mix(in srgb, var(--c) 35%, transparent); }
.map-card-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c); box-shadow: 0 0 10px var(--c); }
.map-card-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 14px 0; }
.map-card-kpis div { padding: 10px 8px; border-radius: 12px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08); text-align: center; }
.map-card-kpis strong { display: block; font-size: 17px; font-weight: 500; color: #fff; }
.map-card-kpis span { font-size: 11px; color: var(--body-muted); }
.map-list { display: flex; flex-direction: column; border-radius: 22px; border: 1px solid var(--glass-border); background: var(--glass-fill); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); overflow: hidden; max-height: clamp(520px, 74vh, 860px); }
.map-list-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--glass-border); }
.map-list-items { overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 4px; }
.map-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; color: var(--text); transition: background .25s ease, transform .3s cubic-bezier(.22,1,.36,1); }
.map-item:hover { background: rgba(255,255,255,.06); color: #fff; transform: translateX(2px); }
.map-item.is-active { background: rgba(63,214,242,.12); box-shadow: inset 0 0 0 1px rgba(63,214,242,.35); }
.map-item i { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--c); box-shadow: 0 0 10px var(--c); }
.map-item span { flex: 1; min-width: 0; }
.map-item strong { display: block; font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.map-item small { display: block; font-size: 12px; color: var(--body-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.map-item em { font-style: normal; font-size: 12px; color: var(--body-muted); font-variant-numeric: tabular-nums; }
@media (max-width: 640px) { .map-card-kpis { grid-template-columns: repeat(2, 1fr); } .map-stats strong { font-size: 17px; } }

/* ---------- Point e sedi: barra compatta "Nuovo Point" ---------- */
.np-bar { position: relative; z-index: 6; display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.np-title h1 { margin: 0; font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.3rem); }
.np-title .eyebrow { margin-bottom: 8px; }
.np-title .map-stats { margin-top: 10px; }
.np-menu { position: relative; }
.np-toggle .np-chev { width: 16px; height: 16px; transition: transform .35s cubic-bezier(.22,1,.36,1); }
.np-menu.is-open .np-toggle .np-chev { transform: rotate(180deg); }
.np-count { font-style: normal; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 9999px; background: #2f2f33; color: #fff; font-size: 11px; display: inline-grid; place-items: center; }
.np-panel { position: absolute; right: 0; top: calc(100% + 10px); width: min(400px, calc(100vw - 32px)); padding: 16px; border-radius: 22px; display: flex; flex-direction: column; gap: 16px;
  background: rgba(10,12,26,.86); border: 1px solid rgba(255,255,255,.16); backdrop-filter: blur(22px) saturate(150%); -webkit-backdrop-filter: blur(22px) saturate(150%);
  box-shadow: 0 40px 100px -30px rgba(0,0,0,.9), 0 30px 80px -50px rgba(0,180,217,.6);
  opacity: 0; transform: translate3d(0,-8px,0) scale(.97); transform-origin: top right; filter: blur(4px); pointer-events: none; visibility: hidden;
  transition: opacity .25s ease, transform .4s cubic-bezier(.22,1,.36,1), filter .3s ease, visibility 0s linear .4s; }
.np-menu.is-open .np-panel { opacity: 1; transform: none; filter: none; pointer-events: auto; visibility: visible; transition: opacity .25s ease, transform .45s cubic-bezier(.22,1,.36,1), filter .3s ease, visibility 0s; }
.np-sec { display: flex; flex-direction: column; gap: 8px; }
.np-label { font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--body-muted); }
.np-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.np-chips .chip { font-size: 12.5px; padding: 5px 10px; }
.np-filters input, .np-filters select { min-height: 42px; font-size: 14px; }
.np-panel .view-switch { margin: 0; align-self: flex-start; }

/* ---------- Point e sedi: mappa come sfondo della pagina ---------- */
.map-page .content { min-height: calc(100vh - 80px); position: relative; }
.map-page .app-foot { position: relative; z-index: 2; }
/* il contenuto lascia passare il puntatore alla mappa, tranne i controlli */
.map-page .main-wrap, .map-page .content { pointer-events: none; }
.map-page .topbar, .map-page .np-bar, .map-page .map-ui > *, .map-page .map-drawer, .map-page .app-foot, .map-page .toasts { pointer-events: auto; }
.map-page .map-ui .map-legend, .map-page .map-ui .map-hint { pointer-events: none; }
.map-page .fluid-scrim { opacity: .55; }
.map-stage { position: fixed; inset: 0; z-index: -1; }
.map-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; pointer-events: auto; }
.map-stage canvas:active { cursor: grabbing; }
.map-ui .map-legend { position: fixed; left: calc(var(--sidebar-w) + 36px); bottom: 26px; z-index: 5; margin: 0; }
.map-ui .map-controls { position: fixed; right: 92px; bottom: 22px; top: auto; z-index: 5; }
.map-ui .map-hint { position: fixed; left: 50%; bottom: 26px; transform: translateX(-30%); right: auto; z-index: 5; }
.map-ui .map-card { position: fixed; left: calc(var(--sidebar-w) + 36px); bottom: 70px; z-index: 6; }
.map-ui .map-empty { position: fixed; inset: 0; left: var(--sidebar-w); display: grid; place-items: center; z-index: 4; }
@media (max-width: 960px) {
  .map-ui .map-legend, .map-ui .map-card { left: 16px; }
  .map-ui .map-hint { display: none; }
  .map-ui .map-controls { right: 70px; bottom: 96px; }
  .map-ui .map-legend { bottom: 100px; }
  .map-ui .map-card { bottom: 150px; }
  .map-ui .map-empty { left: 0; }
}

/* ---------- Pannello "Sedi": ripiegato sul bordo destro ---------- */
.map-drawer { position: fixed; right: 0; top: 96px; bottom: 22px; z-index: 7; display: flex; align-items: flex-start; pointer-events: none; }
.map-drawer > * { pointer-events: auto; }
.map-drawer-tab { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 14px 10px; margin-top: 20px; border-radius: 16px 0 0 16px; border: 1px solid var(--glass-border); border-right: 0;
  background: rgba(10,12,26,.72); color: #fff; cursor: pointer; backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); font: 500 13px var(--font);
  transition: background .25s ease; }
.map-drawer-tab:hover { background: rgba(20,24,44,.85); }
.map-drawer-tab svg { width: 18px; height: 18px; transition: transform .45s cubic-bezier(.22,1,.36,1); }
.map-drawer-tab span { writing-mode: vertical-rl; transform: rotate(180deg); letter-spacing: .08em; }
.map-drawer-tab em { font-style: normal; font-size: 11px; min-width: 22px; height: 22px; display: grid; place-items: center; border-radius: 9999px; background: #fff; color: #2f2f33; }
.map-drawer-panel { width: 0; height: 100%; overflow: hidden; display: flex; flex-direction: column; border-radius: 22px 0 0 22px; border: 1px solid transparent; border-right: 0;
  background: rgba(10,12,26,.78); backdrop-filter: blur(20px) saturate(140%); -webkit-backdrop-filter: blur(20px) saturate(140%);
  transition: width .55s cubic-bezier(.22,1,.36,1), border-color .3s ease; }
.map-drawer.is-open .map-drawer-panel { width: min(320px, 82vw); border-color: var(--glass-border); }
.map-drawer.is-open .map-drawer-tab svg { transform: rotate(180deg); }
.map-drawer .map-list-head, .map-drawer .map-list-items { min-width: min(320px, 82vw); }
.map-drawer .map-list-items { flex: 1; }

/* Point e sedi: riga in basso ordinata (legenda + suggerimento sopra, footer sotto) e tendina sedi più in basso */
.map-page .app-foot { position: fixed; left: calc(var(--sidebar-w) + 36px); right: 80px; bottom: 12px; margin: 0; padding: 0; z-index: 5; font-size: 11.5px; opacity: .75; text-align: left; border: 0; background: none; }
.map-ui .map-legend { bottom: 46px; }
.map-ui .map-hint { left: auto; right: 80px; bottom: 46px; transform: none; }
.map-drawer-tab { margin-top: 30vh; }
@media (max-width: 960px) {
  .map-page .app-foot { left: 16px; right: 70px; }
  .map-ui .map-legend { bottom: 46px; }
  .map-drawer-tab { margin-top: 22vh; }
}
/* cursore della mappa (gli eventi sono gestiti a livello di finestra) */
.map-page .shell, .map-page .content { cursor: grab; }
html.map-over-point .map-page .shell { cursor: pointer; }
html.map-grabbing, html.map-grabbing * { cursor: grabbing !important; user-select: none; }
.map-page .sidebar, .map-page .topbar, .map-page .np-menu, .map-page .map-drawer > * { cursor: auto; }
/* Point e sedi: la pagina non scorre, la rotellina serve solo allo zoom della mappa */
html:has(body.map-page), body.map-page { overflow: hidden; height: 100%; overscroll-behavior: none; }
.map-page .content { min-height: 0; }

/* Point e sedi: vista e filtri come bottoncini a sinistra, "Nuovo Point" bottone semplice */
.np-side { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; margin-top: 18px; max-width: 360px; }
.np-side .view-switch { margin: 0; }
.view-switch-sm { padding: 3px; }
.view-switch-sm a { padding: 5px 12px; font-size: 12.5px; gap: 6px; }
.view-switch-sm a .ico { width: 14px; height: 14px; }
.np-side .np-chips .chip { font-size: 12px; padding: 4px 10px; background: var(--glass-fill); border: 1px solid var(--glass-border); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.np-side .np-chips .chip.is-on { background: #fff; color: #2f2f33; border-color: #fff; }
.np-side .np-chips .chip.is-on strong { color: #2f2f33; }
.np-side .np-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.np-search { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 9999px; background: var(--glass-fill); border: 1px solid var(--glass-border); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); color: var(--body-muted); }
.np-search .ico { width: 14px; height: 14px; flex: none; }
.np-side .np-search input { width: 130px; min-height: 0; height: 28px; padding: 0; border: 0; background: none; box-shadow: none; font-size: 12.5px; color: #fff; outline: none; }
.np-side .np-filters select { min-height: 0; height: 30px; width: auto; padding: 0 30px 0 12px; border-radius: 9999px; font-size: 12.5px; background-color: var(--glass-fill); border: 1px solid var(--glass-border); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); background-position: right 10px center; }
.np-side .np-reset { font-size: 12px; padding: 4px 10px; display: inline-flex; align-items: center; gap: 4px; }
.np-side .np-reset .ico { width: 12px; height: 12px; }
.np-new { flex: none; }

/* filtri a sinistra: colonna ordinata, larghezze uguali, etichette di sezione */
.np-side { display: grid; grid-template-columns: 1fr; gap: 8px; width: 290px; max-width: 100%; margin-top: 22px; align-items: stretch; }
.np-side .np-label { font-size: 10.5px; margin-top: 6px; }
.np-side .np-label:first-child { margin-top: 0; }
.np-side .view-switch { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
.np-side .view-switch a { justify-content: center; padding: 6px 10px; }
.np-side .np-chips { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.np-side .np-chips .chip { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 0; padding: 6px 12px; font-size: 12.5px; white-space: nowrap; }
.np-side .np-chips .chip:first-child { grid-column: 1 / -1; }
.np-side .np-filters { display: grid; grid-template-columns: 1fr; gap: 6px; }
.np-side .np-search { height: 34px; width: 100%; }
.np-side .np-search input { width: 100%; flex: 1; }
.np-side .np-filters select { width: 100%; height: 34px; }
.np-side .np-reset { justify-content: center; }
.np-side .np-filters select { font-weight: 400; color: var(--body-muted); }

/* filtri a sinistra: bottoncini compatti e niente sovrapposizioni con la legenda */
.np-side { width: 236px; gap: 6px; margin-top: 18px; }
.np-side .np-label { font-size: 10px; letter-spacing: .14em; margin-top: 4px; }
.np-side .view-switch { padding: 2px; }
.np-side .view-switch a { padding: 4px 8px; font-size: 12px; gap: 5px; }
.np-side .view-switch a .ico { width: 13px; height: 13px; }
.np-side .np-chips { gap: 4px; }
.np-side .np-chips .chip { padding: 3px 10px; min-height: 0; font-size: 11.5px; line-height: 1.5; }
.np-side .np-search { height: 28px; padding: 0 10px; }
.np-side .np-search input { height: 26px; font-size: 12px; }
.np-side .np-filters { grid-template-columns: 1fr 1fr; gap: 4px; }
.np-side .np-filters select { height: 28px; font-size: 12px; padding: 0 24px 0 10px; background-position: right 8px center; }
.np-side .np-reset { grid-column: 1 / -1; font-size: 11.5px; padding: 3px 10px; }
.map-page .np-bar { margin-bottom: 0; }
/* schermi bassi: legenda e suggerimento non si sovrappongono alla colonna */
@media (max-height: 820px) {
  .map-page .np-title .map-stats { margin-top: 6px; }
  .map-page .np-side { margin-top: 12px; }
  .map-page .map-ui .map-legend { left: auto; right: 80px; bottom: 46px; }
  .map-page .map-ui .map-hint { bottom: 70px; }
}
.np-side .np-filters { grid-template-columns: 1fr; }

/* filtri a sinistra: pillole corte (larghe quanto il testo), non barre a tutta larghezza */
.np-side { width: auto; max-width: 300px; justify-items: start; }
.np-side .np-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.np-side .np-chips .chip { display: inline-flex; justify-content: flex-start; gap: 6px; width: auto; }
.np-side .np-chips .chip:first-child { grid-column: auto; }
.np-side .np-filters { display: flex; flex-wrap: wrap; gap: 5px; }
.np-side .np-search { width: 170px; }
.np-side .np-filters select { width: auto; }
/* stati su due colonne: Tutti · Invitato / Attivo · Sospeso / In revisione */
.np-side .np-chips { display: grid; grid-template-columns: repeat(2, max-content); justify-items: start; gap: 5px; }
/* stati: pillole attaccate, a capo dopo Invitato e dopo Sospeso */
.np-side .np-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.np-side .np-break { flex-basis: 100%; height: 0; }

/* ===================== Lead desk: interfaccia semplice e animata ===================== */
.ld-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 10px; }
.ld-tabs { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 4px; border-radius: 9999px; background: rgba(12,14,26,.72); border: 1px solid var(--glass-border); }
.ld-tabs a { display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; border-radius: 9999px; font-size: 13px; font-weight: 500; color: var(--body-muted); transition: background .3s cubic-bezier(.22,1,.36,1), color .2s; }
.ld-tabs a:hover { color: #fff; background: rgba(255,255,255,.05); }
.ld-tabs a.is-on { background: #fff; color: #2f2f33; }
.ld-tabs em { font-style: normal; font-size: 11px; font-weight: 700; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 9999px; display: inline-grid; place-items: center; background: rgba(255,255,255,.1); color: inherit; }
.ld-tabs a.is-on em { background: #2f2f33; color: #fff; }
.ld-tabs em.warn { background: #f7c35c; color: #2f2f33; }
.ld-search { display: flex; align-items: center; gap: 8px; height: 42px; width: min(300px, 100%); padding: 0 16px; border-radius: 9999px; background: rgba(12,14,26,.72); border: 1px solid var(--glass-border); color: var(--body-muted); transition: border-color .25s, box-shadow .25s, width .45s cubic-bezier(.22,1,.36,1); }
.ld-search:focus-within { width: min(380px, 100%); border-color: rgba(0,180,217,.5); box-shadow: 0 0 0 4px rgba(0,180,217,.12); }
.ld-search .ico { width: 16px; height: 16px; flex: none; }
.ld-search input { flex: 1; min-width: 0; height: 40px; padding: 0; border: 0; background: none; box-shadow: none; color: #fff; font-size: 14px; outline: none; }

.ld-more { margin-bottom: 18px; }
.ld-more > summary { list-style: none; display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 9999px; cursor: pointer; font-size: 13px; font-weight: 500; color: var(--body-muted); transition: color .2s, background .2s; }
.ld-more > summary::-webkit-details-marker { display: none; }
.ld-more > summary:hover { color: #fff; background: rgba(255,255,255,.05); }
.ld-more > summary .ico { width: 15px; height: 15px; }
.ld-more > summary em { font-style: normal; font-size: 11px; font-weight: 700; min-width: 18px; height: 18px; border-radius: 9999px; display: inline-grid; place-items: center; background: #fff; color: #2f2f33; }
.ld-chev { width: 14px; height: 14px; transition: transform .35s cubic-bezier(.22,1,.36,1); }
.ld-more[open] .ld-chev { transform: rotate(180deg); }
.ld-filters { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 0 2px; animation: ldDrop .45s cubic-bezier(.22,1,.36,1) both; }
.ld-filters select { width: auto; min-height: 0; height: 34px; padding: 0 30px 0 14px; border-radius: 9999px; font-size: 13px; background-color: rgba(12,14,26,.72); border: 1px solid var(--glass-border); background-position: right 10px center; }
.ld-reset { display: inline-flex; align-items: center; gap: 5px; height: 34px; padding: 0 14px; border-radius: 9999px; font-size: 13px; color: var(--body-muted); }
.ld-reset:hover { color: #fff; }
.ld-reset .ico { width: 13px; height: 13px; }
@keyframes ldDrop { from { opacity: 0; transform: translateY(-6px); } }

/* righe-card */
.ld-list { display: flex; flex-direction: column; gap: 8px; }
.ld-row { position: relative; display: grid; grid-template-columns: 44px minmax(170px, 1.2fr) minmax(200px, 1.6fr) minmax(150px, 1fr) 150px 22px; align-items: center; gap: 18px;
  padding: 14px 18px; border-radius: 20px; background: rgba(12,14,26,.72); border: 1px solid var(--glass-border); color: inherit; overflow: hidden;
  animation: ldIn .7s cubic-bezier(.22,1,.36,1) both; animation-delay: calc(var(--i, 0) * 45ms);
  transition: transform .45s cubic-bezier(.22,1,.36,1), border-color .3s, background .3s, box-shadow .45s cubic-bezier(.22,1,.36,1); }
.ld-row::before { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, rgba(0,180,217,.10), rgba(155,88,148,.08) 45%, transparent 70%); opacity: 0; transition: opacity .4s; pointer-events: none; }
.ld-row:hover { transform: translateY(-2px); border-color: rgba(255,255,255,.18); box-shadow: 0 18px 40px -22px rgba(0,180,217,.45); }
.ld-row:hover::before { opacity: 1; }
.ld-row.is-flag { box-shadow: inset 3px 0 0 #f7c35c; }
.ld-row.is-flag:hover { box-shadow: inset 3px 0 0 #f7c35c, 0 18px 40px -22px rgba(0,180,217,.45); }
@keyframes ldIn { from { opacity: 0; transform: translateY(14px) scale(.985); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }
.ld-av { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font: 700 14px var(--display, inherit); color: #fff;
  background: linear-gradient(135deg, rgba(0,180,217,.85), rgba(155,88,148,.85)); box-shadow: 0 8px 22px -10px rgba(0,180,217,.7); transition: transform .45s cubic-bezier(.22,1,.36,1); }
.ld-row:hover .ld-av { transform: scale(1.06) rotate(-3deg); }
.ld-who, .ld-what, .ld-meta { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ld-who strong { font-size: 15px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ld-who small, .ld-what small, .ld-meta small { font-size: 12.5px; color: var(--body-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ld-who .mono { color: #3fd6f2; }
.ld-what > span { font-size: 14px; color: #e8eaf2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ld-ch { font-style: normal; color: #c27fbb; }
.ld-ch.is-qr { color: #3fd6f2; }
.ld-state { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.ld-flag { font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 9999px; }
.ld-flag.warn { color: #f7c35c; background: rgba(247,195,92,.12); }
.ld-flag.bad { color: #ff6f8e; background: rgba(255,111,142,.12); }
.ld-meta { align-items: flex-end; text-align: right; }
.ld-owner { font-size: 13px; color: #e8eaf2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.ld-owner.is-none { color: var(--body-muted); font-style: italic; }
.ld-go { color: var(--body-muted); opacity: 0; transform: translateX(-6px); transition: opacity .3s, transform .45s cubic-bezier(.22,1,.36,1), color .2s; }
.ld-go .ico { width: 18px; height: 18px; }
.ld-row:hover .ld-go { opacity: 1; transform: none; color: #fff; }

@media (max-width: 1180px) {
  .ld-row { grid-template-columns: 44px minmax(0, 1fr) minmax(0, 1fr) auto; }
  .ld-state { grid-column: 2 / 4; }
  .ld-meta { grid-row: 1; grid-column: 4; }
  .ld-go { display: none; }
}
@media (max-width: 640px) {
  .ld-row { grid-template-columns: 40px minmax(0, 1fr) auto; gap: 10px 12px; padding: 12px 14px; }
  .ld-what, .ld-state { grid-column: 2 / -1; }
  .ld-meta { grid-column: 3; grid-row: 1; }
  .ld-av { width: 40px; height: 40px; }
  .ld-search, .ld-search:focus-within { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .ld-row, .ld-filters { animation: none; } }
.ld-filters select { flex: none; min-width: 0; width: auto !important; max-width: 220px; }
.ld-filters select, .np-side .np-filters select { field-sizing: content; }

/* Home: invito finale semplice al posto dell'onda di particelle */
.home-cta { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; text-align: center; padding: clamp(6rem, 18vh, 11rem) 1.25rem clamp(5rem, 14vh, 8rem); }
.home-cta .eyebrow { justify-content: center; }
.home-cta .sc-h { max-width: 52rem; }
.home-cta .sc-lead { margin-left: auto; margin-right: auto; }
.home-cta-btn { margin-top: 2rem; }

/* ===== Portale → seconda schermata: apparizione cinematografica della card =====
   1) la luce bianca sfuma (1.1s)  2) la card nasce dalla luce al centro (≈1.3s)  3) pausa 1s  4) scivola nella sua colonna e compaiono i testi */
.sc-portal.is-ready .sc-card { visibility: hidden; transition: opacity 1.1s cubic-bezier(.4,0,.2,1), visibility 0s linear 1.1s; }
.sc-ready-float { opacity: 0; transform: translate3d(var(--fx, 0px), var(--fy, 0px), 0) scale(.62); filter: blur(22px) brightness(2.8) saturate(.4);
  transition: opacity .3s ease, transform .35s ease, filter .35s ease; }
.sc-portal.is-ready .sc-ready-float { opacity: 1; transform: translate3d(var(--fx, 0px), var(--fy, 0px), 0) scale(1.06); filter: blur(0) brightness(1) saturate(1);
  transition: opacity 1s cubic-bezier(.22,1,.36,1) .2s, transform 1.4s cubic-bezier(.16,1,.3,1) .1s, filter 1.3s cubic-bezier(.22,1,.36,1) .2s; }
.sc-portal.is-ready.is-settled .sc-ready-float { transform: none; transition: opacity .4s ease, transform 1.2s cubic-bezier(.65,0,.35,1), filter .6s ease; }
/* alone di luce che si espande dietro la card mentre emerge */
.sc-ready-glow { opacity: 0; transform: translate3d(var(--fx, 0px), var(--fy, 0px), 0) scale(.3); transition: opacity .3s ease, transform .3s ease; }
.sc-portal.is-ready .sc-ready-glow { opacity: 1; transform: translate3d(var(--fx, 0px), var(--fy, 0px), 0) scale(1.15); transition: opacity 1.2s ease .15s, transform 1.6s cubic-bezier(.16,1,.3,1) .1s; }
.sc-portal.is-ready.is-settled .sc-ready-glow { transform: none; transition: transform 1.2s cubic-bezier(.65,0,.35,1), opacity .6s ease; }
/* riflesso che attraversa la card appena nata */
.sc-flow::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0;
  background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,.35) 50%, transparent 65%); background-size: 260% 100%; background-position: 120% 0; }
.sc-portal.is-ready .sc-flow::after { animation: scFlowSheen 1.4s cubic-bezier(.22,1,.36,1) .7s both; }
@keyframes scFlowSheen { 0% { opacity: 0; background-position: 120% 0; } 25% { opacity: 1; } 100% { opacity: 0; background-position: -40% 0; } }
@media (prefers-reduced-motion: reduce) { .sc-ready-float, .sc-ready-glow { transition: opacity .3s ease !important; } .sc-portal.is-ready .sc-flow::after { animation: none; } }
/* sequenza finale compatta: tutto termina entro ~2.7s, poi 1s di sosta (scenes.js ANIM_MS + PAUSE_MS) */
.sc-portal.is-settled .sc-flow-bar i { transition: width 1s cubic-bezier(.65,0,.35,1) 1.6s; }
/* tutto morbido: curve d'uscita lunghe e dolci (stile Lenis) per lo scivolamento nella colonna e le rivelazioni */
.sc-portal.is-ready.is-settled .sc-ready-float { transition: opacity .5s ease, transform 1.5s cubic-bezier(.19,1,.22,1), filter .8s cubic-bezier(.19,1,.22,1); }
.sc-portal.is-ready.is-settled .sc-ready-glow { transition: transform 1.5s cubic-bezier(.19,1,.22,1), opacity .8s ease; }
.sc-portal.is-settled .sc-r, .sc-portal.is-settled .sc-ready-title .sc-rl { transition: opacity 1s cubic-bezier(.19,1,.22,1), transform 1.2s cubic-bezier(.19,1,.22,1), filter 1s cubic-bezier(.19,1,.22,1); transition-delay: calc(var(--d, 0) * .12s + .25s); }
.sc-portal.is-settled .sc-flow-steps li { transition: opacity .7s cubic-bezier(.19,1,.22,1) calc(.8s + var(--s) * .45s); }
.sc-portal.is-settled .sc-flow-dot { transition: background .5s ease, border-color .5s ease, box-shadow .5s ease; transition-delay: calc(.8s + var(--s) * .45s); }
.sc-portal.is-settled .sc-flow-dot svg { transition: stroke-dashoffset .5s cubic-bezier(.19,1,.22,1) calc(.95s + var(--s) * .45s); }
.sc-portal.is-settled .sc-flow-steps::after { transition: height 1.3s cubic-bezier(.19,1,.22,1) .85s; }
.sc-portal.is-settled .sc-flow-bar i { transition: width 1.1s cubic-bezier(.19,1,.22,1) 1.55s; }
.sc-ready-float, .sc-ready-glow { will-change: transform, opacity, filter; }

/* Tunnel: wormhole Three.js di punti al posto degli anelli CSS (tunnel3d.js) */
.sc-wormhole { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; z-index: 0; opacity: 0; visibility: hidden; pointer-events: none; }
.sc-tunnel .sc-tunnel-view { z-index: 1; }
.sc-tunnel .sc-ring { display: none !important; }
/* wormhole più opaco/morbido (non troppo) */
.sc-wormhole { filter: saturate(.88) blur(.35px); }
/* testo "Quattro passi. Zero burocrazia." più leggibile sopra il wormhole */
.sc-tunnel .sc-copy { text-shadow: 0 2px 18px rgba(4,5,12,.95), 0 0 42px rgba(4,5,12,.85); }
.sc-tunnel .sc-copy::before { content: ""; position: absolute; z-index: -1; pointer-events: none;
  left: -18vw; right: -14vw; top: -14vh; bottom: -10vh; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(4,5,14,.82), rgba(4,5,14,.55) 55%, rgba(4,5,14,0)); }
.sc-tunnel .sc-copy .sc-lead { color: #d3d7e4; }
.sc-tunnel .sc-copy .grad-text { filter: brightness(1.25) saturate(1.1); }
/* "Quattro passi. Zero burocrazia.": in alto al centro, testo centrato, fisso durante il volo nel wormhole */
.sc-tunnel .sc-copy[data-block="intro"] { top: clamp(84px, 11vh, 120px); bottom: auto; left: 0; right: 0; margin: 0 auto; max-width: min(56rem, calc(100vw - 2.5rem)); text-align: center; transform: none; }
.sc-tunnel .sc-copy[data-block="intro"] .sc-lead { margin-left: auto; margin-right: auto; max-width: 36rem; }
.sc-tunnel .sc-copy[data-block="intro"]::before { left: -10vw; right: -10vw; top: -8vh; bottom: -8vh; }
/* punto di fuga del tunnel più in basso (66%): le card non toccano il titolo centrato in alto */
.sc-tunnel .sc-tunnel-view { perspective-origin: 50% 66%; }
.sc-tunnel .sc-tunnel-world { top: 66%; }
/* Point e sedi: "Tutte le regioni" sotto la ricerca */
.np-side .np-filters { flex-direction: column; align-items: flex-start; }
