:root {
  --bg: #0d0d0e;
  --surface: #1c1b1b;
  --surface-2: #262525;
  --border: #353434;
  --text: #f5f5f7;
  --muted: #a1a1a6;
  --gold: #f0c35a;
  --gold-dark: #c99a2e;
  --ok: #4caf7a;
  --danger: #e2584d;
  --radius: 0.875rem;
  --page: 70rem;
  --nav-h: 3.75rem;
  font-family: Inter, system-ui, -apple-system, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scrollbar-gutter: stable; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
@media (min-width: 1600px) and (min-height: 760px) {
  html { font-size: clamp(1rem, calc(0.4rem + min(0.6vw, 1.05vh)), 1.625rem); }
}
html.is-watching { scroll-behavior: auto !important; }
html.is-locked, html.is-locked body { overflow: hidden; overscroll-behavior: none; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--gold); }

h1, h2 { letter-spacing: -0.03em; }

/* Barra in alto */
.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 20;
  height: var(--nav-h);
  background: rgba(13, 13, 14, 0.72);
  backdrop-filter: saturate(180%) blur(1.125rem);
  -webkit-backdrop-filter: saturate(180%) blur(1.125rem);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.nav-inner {
  max-width: var(--page);
  height: 100%;
  margin: 0 auto;
  padding: 0 max(1.25rem, env(safe-area-inset-right)) 0 max(1.25rem, env(safe-area-inset-left));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
@media (max-width: 380px) {
  .nav-inner { padding: 0 0.875rem; }
  .brand { gap: 0.5rem; }
  .brand img { width: 1.75rem; height: 1.5rem; }
  .brand-title { font-size: .8rem; letter-spacing: .18em; }
  .brand-sub { font-size: .58rem; letter-spacing: .3em; }
  .nav .btn-sm { padding: 0.4375rem 0.75rem; font-size: .8rem; }
}
.brand { display: flex; align-items: center; gap: 0.625rem; color: inherit; text-decoration: none; }
.brand img { width: 2.125rem; height: 1.875rem; object-fit: contain; }
.brand-title { display: block; font-size: .95rem; letter-spacing: .25em; font-weight: 700; text-transform: uppercase; }
.brand-sub { display: block; color: var(--gold); font-size: .65rem; letter-spacing: .35em; text-transform: uppercase; }

/* Bottoni */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  border: 1px solid transparent; border-radius: 999px; padding: 0.75rem 1.375rem;
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: filter .15s, opacity .15s, transform .15s;
}
.btn:hover { filter: brightness(1.1); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--gold); color: #1c1b1b; }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn-link { background: transparent; color: var(--gold); padding-left: 0.5rem; padding-right: 0.5rem; }
.btn-link::after { content: "›"; font-size: 1.3em; line-height: 0; margin-left: 0.125rem; }
.btn-sm { padding: 0.4375rem 0.875rem; font-size: .85rem; }
.btn-lg { padding: 0.9375rem 1.75rem; font-size: 1.05rem; }

/* Sezione animata con la tessera */
.story { position: relative; height: 420vh; }
.story-stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  perspective: 112.5rem;
}
.stage-glow {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 56.25rem;
  height: 56.25rem;
  margin: -28.125rem 0 0 -28.125rem;
  background: radial-gradient(closest-side, rgba(240, 195, 90, 0.22), rgba(240, 195, 90, 0.06) 55%, transparent);
  pointer-events: none;
  will-change: transform, opacity;
}

.hero-copy {
  position: absolute;
  top: calc(50% + var(--nav-h) / 2);
  left: max(1.25rem, env(safe-area-inset-left), calc(50% - var(--page) / 2 + 1.25rem));
  width: min(32.5rem, 44vw);
  transform: translateY(-50%);
  will-change: transform, opacity;
}
.eyebrow {
  display: inline-block;
  margin-bottom: 1.125rem;
  padding: 0.375rem 0.75rem;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--gold);
  background: rgba(240, 195, 90, 0.1);
  border: 1px solid rgba(240, 195, 90, 0.25);
  border-radius: 999px;
}
.hero-copy h1 { font-size: clamp(1.6rem, min(5vw, 8.5vh), 4rem); line-height: 1.04; margin: 0 0 1.125rem; font-weight: 800; }
.hero-copy h1 span, .benefits h2 span, .final-cta h2 span { white-space: nowrap; }
.hero-copy h1 span, .benefits h2 span, .final-cta h2 span {
  background: linear-gradient(120deg, #ffe3a1, #f0c35a 45%, #c99a2e);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-copy p { color: var(--muted); font-size: clamp(.95rem, min(1.6vw, 3vh), 1.2rem); line-height: 1.55; margin: 0 0 1.75rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.625rem; align-items: center; }

/* Tessera 3D */
.card-scene {
  --card-w: min(27.5rem, 36vw, 70vh);
  position: absolute;
  left: 50%;
  top: calc(50% + var(--nav-h) / 2);
  width: var(--card-w);
  aspect-ratio: 1.586;
  margin-left: calc(var(--card-w) / -2);
  margin-top: calc(var(--card-w) / -3.172);
  transform-style: preserve-3d;
  will-change: transform;
}
.card-3d {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  will-change: transform;
}
.card-shadow {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: -14%;
  height: 22%;
  background: radial-gradient(closest-side, rgba(0, 0, 0, 0.75), transparent);
  filter: blur(0.75rem);
  will-change: transform, opacity;
}
.card-face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 7% 6.5%;
  border-radius: calc(var(--card-w) * 0.045);
  overflow: hidden;
  color: #F5F5F7;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(212, 164, 58, 0.38), transparent 55%),
    radial-gradient(80% 70% at 0% 100%, rgba(212, 164, 58, 0.12), transparent 60%),
    linear-gradient(150deg, #2c2b2f 0%, #161618 100%);
  box-shadow:
    inset 0 0 0 1px rgba(240, 201, 106, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 1.875rem 3.75rem -1.25rem rgba(0, 0, 0, 0.6);
}
.card-back { transform: rotateY(180deg); }

.card-sheen {
  position: absolute;
  inset: -50%;
  background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, 0.22) 50%, transparent 60%);
  transform: translateX(var(--sheen, -60%));
  pointer-events: none;
  mix-blend-mode: screen;
}

.tessera-top, .tessera-bottom, .back-top { display: flex; justify-content: space-between; }
.tessera-top { align-items: flex-start; }
.tessera-bottom { align-items: flex-end; gap: calc(var(--card-w) * 0.03); }
.tessera-logo { display: block; width: calc(var(--card-w) * 0.127); height: calc(var(--card-w) * 0.114); object-fit: contain; }
.tessera-label {
  font-size: max(8px, calc(var(--card-w) * 0.025));
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #F0C96A;
}
.tessera-name { display: block; font-size: calc(var(--card-w) * 0.055); font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.tessera-note { display: block; margin-top: calc(var(--card-w) * 0.014); font-size: max(9px, calc(var(--card-w) * 0.027)); line-height: 1.4; color: rgba(245, 245, 247, 0.6); }
.tessera-price {
  flex-shrink: 0;
  padding: calc(var(--card-w) * 0.014) calc(var(--card-w) * 0.032);
  font-size: max(9px, calc(var(--card-w) * 0.03));
  font-weight: 800;
  color: #1a1000;
  background: linear-gradient(135deg, #F0C96A, #D4A43A);
  border-radius: 999px;
}

.back-top { align-items: center; }
.back-tag {
  font-size: max(8px, calc(var(--card-w) * 0.023));
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(245, 245, 247, 0.55);
  border: 1px solid rgba(245, 245, 247, 0.25);
  border-radius: 999px;
  padding: calc(var(--card-w) * 0.007) calc(var(--card-w) * 0.02);
}
.barcode-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(var(--card-w) * 0.014);
  padding: 5% 6% 4%;
  background: #fbfaf6;
  border-radius: calc(var(--card-w) * 0.023);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}
.barcode { display: block; width: 100%; height: auto; max-height: calc(var(--card-w) * 0.2); }
.barcode-code { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: max(9px, calc(var(--card-w) * 0.03)); font-weight: 600; letter-spacing: .3em; color: #1a1a1c; }
.back-note { font-size: max(9px, calc(var(--card-w) * 0.027)); color: rgba(245, 245, 247, 0.6); text-align: center; }

.flip-caption {
  position: absolute;
  left: 1.25rem;
  right: 1.25rem;
  bottom: 9vh;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  will-change: transform, opacity;
}
.flip-caption strong { display: block; font-size: clamp(2rem, 4.6vw, 3.6rem); letter-spacing: -0.035em; line-height: 1.05; }
.flip-caption span { display: block; margin-top: 0.625rem; color: var(--muted); font-size: clamp(1rem, 1.6vw, 1.25rem); }

/* Vantaggi accanto alla tessera */
.benefits {
  position: absolute;
  top: calc(50% + var(--nav-h) / 2);
  right: max(1.25rem, env(safe-area-inset-right), calc(50% - var(--page) / 2 + 1.25rem));
  width: min(30rem, 42vw);
  transform: translateY(-50%);
  pointer-events: none;
}
.benefits h2 { font-size: clamp(1.4rem, min(3.4vw, 6vh), 2.8rem); line-height: 1.08; margin: 0 0 1.625rem; }
.benefits ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.875rem; }
.benefits li {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1rem 1.125rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 1.125rem;
}
.benefits li strong { display: block; font-size: 1.05rem; margin-bottom: 0.1875rem; }
.benefits li span span { color: var(--muted); line-height: 1.45; font-size: .95rem; }
.benefit-icon {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 2.625rem;
  height: 2.625rem;
  border-radius: 0.75rem;
  background: linear-gradient(135deg, rgba(240, 195, 90, 0.22), rgba(240, 195, 90, 0.06));
  color: var(--gold);
}
.benefit-icon svg { width: 1.375rem; height: 1.375rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.benefits h2, .benefits li {
  opacity: 0;
  transform: translateY(1.5rem);
  filter: blur(0.375rem);
  will-change: opacity, transform, filter;
}

.scroll-hint {
  position: absolute;
  left: 50%;
  bottom: 1.75rem;
  width: 1.625rem;
  height: 2.625rem;
  margin-left: -0.8125rem;
  border: 0.125rem solid rgba(245, 245, 247, 0.3);
  border-radius: 999px;
}
.scroll-hint span {
  position: absolute;
  left: 50%;
  top: 0.5rem;
  width: 0.25rem;
  height: 0.5rem;
  margin-left: -0.125rem;
  border-radius: 0.125rem;
  background: rgba(245, 245, 247, 0.6);
  animation: scroll-hint 1.8s ease-in-out infinite;
}
@keyframes scroll-hint {
  0% { transform: translateY(0); opacity: 1; }
  70% { transform: translateY(0.875rem); opacity: 0; }
  100% { transform: translateY(0); opacity: 0; }
}

/* Sezioni sotto */
.section { max-width: var(--page); margin: 0 auto; padding: 7.5rem 1.25rem; }
.section-title { font-size: clamp(2rem, 4vw, 3rem); text-align: center; margin: 0 0 3rem; }

.free { text-align: center; padding-top: 5rem; }
.free-amount {
  font-size: clamp(7rem, 22vw, 15rem);
  font-weight: 800;
  line-height: .9;
  letter-spacing: -0.06em;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, #ffe7ad 0%, #f0c35a 45%, #8a6416 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.free-amount span:last-child { font-size: .45em; letter-spacing: 0; margin-left: .05em; vertical-align: .9em; }
.free-amount.is-landed { animation: price-land .55s cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes price-land {
  0% { transform: scale(1.08); }
  100% { transform: scale(1); }
}
.free h2 { font-size: clamp(2rem, 4.5vw, 3.4rem); margin: 1.125rem 0 0.625rem; }
.free p { color: var(--muted); font-size: 1.25rem; margin: 0; }

.notice-section { padding-top: 0; }
.notice {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  max-width: 51.25rem;
  margin: 0 auto;
  padding: 1.75rem 2rem;
  border-radius: 1.5rem;
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(240, 195, 90, 0.16), transparent 60%),
    rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(240, 195, 90, 0.3);
}
.notice-icon {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: var(--gold);
  color: #1c1b1b;
  font-weight: 800;
  font-size: 1.5rem;
}
.notice-label { font-size: .78rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.notice p { margin: 0.375rem 0 0; font-size: clamp(1.15rem, 2.2vw, 1.5rem); line-height: 1.4; }
.notice strong { color: var(--gold); }

.steps-section { padding-top: 2.5rem; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.125rem; }
.steps li {
  display: grid;
  gap: 0.5rem;
  align-content: start;
  padding: 1.75rem;
  border-radius: 1.375rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.07);
}
.steps li:nth-child(2) { transition-delay: .08s; }
.steps li:nth-child(3) { transition-delay: .16s; }
.step-num {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  margin-bottom: 0.5rem;
  border-radius: 50%;
  border: 1px solid rgba(240, 195, 90, 0.5);
  color: var(--gold);
  font-weight: 700;
}
.steps strong { font-size: 1.15rem; }
.steps li > span:last-child { color: var(--muted); line-height: 1.5; }

.final-cta { text-align: center; padding-bottom: 8.75rem; }
.final-cta h2 { font-size: clamp(2.2rem, 5vw, 3.8rem); margin: 0 0 0.75rem; line-height: 1.05; }
.final-cta p { color: var(--muted); font-size: 1.2rem; margin: 0 0 1.875rem; }

.footer {
  max-width: var(--page);
  margin: 0 auto;
  padding: 1.75rem 1.25rem 2.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  color: var(--muted);
  font-size: .85rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
}
.footer a { color: var(--muted); text-decoration: none; }
.footer a:hover { color: var(--text); }
.footer-links { display: flex; gap: 1.25rem; }

/* Pagina privacy */
.legal { max-width: 47.5rem; margin: 0 auto; padding: calc(var(--nav-h) + 3.5rem) 1.25rem 5rem; }
.legal-kicker { color: var(--gold); font-size: .8rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; margin: 0 0 0.625rem; }
.legal h1 { font-size: clamp(2.4rem, 6vw, 3.6rem); margin: 0 0 1rem; line-height: 1.05; }
.legal-lead { color: var(--muted); font-size: 1.15rem; line-height: 1.6; margin: 0 0 2.25rem; }
.legal section { padding: 1.625rem 0; border-top: 1px solid rgba(255, 255, 255, 0.07); }
.legal h2 { font-size: 1.35rem; margin: 0 0 0.75rem; }
.legal p, .legal li { color: #d2d2d7; line-height: 1.65; }
.legal ul { padding-left: 1.25rem; margin: 0 0 0.75rem; }
.legal li { margin-bottom: 0.375rem; }
.legal strong { color: var(--text); }
.legal table { width: 100%; border-collapse: collapse; margin: 0.375rem 0 0.875rem; font-size: .95rem; }
.legal th, .legal td { text-align: left; vertical-align: top; padding: 0.75rem 0.625rem; border-bottom: 1px solid rgba(255, 255, 255, 0.07); }
.legal th { color: var(--muted); font-weight: 600; font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; }
.legal td { color: #d2d2d7; }
.legal code { color: var(--gold); }
.legal-page .nav-inner .btn { margin-left: auto; }
@media (max-width: 600px) {
  .legal table, .legal tbody, .legal tr, .legal td { display: block; }
  .legal thead { display: none; }
  .legal tr { padding: 0.625rem 0; border-bottom: 1px solid rgba(255, 255, 255, 0.07); }
  .legal td { border: 0; padding: 0.25rem 0; }
  .legal td:first-child { color: var(--text); font-weight: 600; }
}

.reveal {
  opacity: 0;
  transform: translateY(2.5rem);
  transition: opacity .9s cubic-bezier(0.16, 1, 0.3, 1), transform .9s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.is-visible { opacity: 1; transform: none; }

/* Schermi verticali (telefoni e tablet in verticale): testo sotto, tessera sopra.
   Deve restare uguale a STACKED in home.js. */
@media (max-width: 1199px) and (max-aspect-ratio: 1/1), (max-aspect-ratio: 4/5) {
  .hero-copy {
    top: auto;
    bottom: max(2.25rem, env(safe-area-inset-bottom));
    left: max(1.25rem, calc(50% - 18rem));
    right: max(1.25rem, calc(50% - 18rem));
    width: auto;
    transform: none;
    text-align: center;
  }
  .eyebrow { margin-bottom: 0.75rem; }
  .hero-copy h1 { font-size: clamp(1.75rem, min(9vw, 5.5vh), 3.2rem); margin-bottom: 0.75rem; }
  .hero-copy p { font-size: clamp(.92rem, 2.4vh, 1.15rem); margin-bottom: 1.25rem; }
  .hero-actions { justify-content: center; }
  .card-scene { --card-w: min(26rem, 80vw, 42vh); top: 50%; }
  .benefits {
    top: auto;
    bottom: max(1.5rem, env(safe-area-inset-bottom));
    left: max(1.25rem, calc(50% - 18rem));
    right: max(1.25rem, calc(50% - 18rem));
    width: auto;
    transform: none;
  }
  .benefits h2 { font-size: clamp(1.4rem, 7vw, 2.2rem); margin-bottom: 0.875rem; text-align: center; }
  .benefits ul { gap: 0.625rem; }
  .benefits li { padding: 0.75rem 0.875rem; gap: 0.75rem; border-radius: 1rem; }
  .benefits li strong { font-size: .98rem; }
  .benefits li span span { font-size: .86rem; }
  .benefit-icon { width: 2.25rem; height: 2.25rem; border-radius: 0.625rem; }
  .scroll-hint { display: none; }
}
@media (max-width: 1199px) and (max-aspect-ratio: 1/1) and (max-height: 700px), (max-aspect-ratio: 4/5) and (max-height: 700px) {
  .benefits li span span { display: none; }
}
@media (max-width: 1199px) and (max-aspect-ratio: 1/1) and (max-height: 620px), (max-aspect-ratio: 4/5) and (max-height: 620px) {
  .eyebrow { display: none; }
  .hero-copy { bottom: max(1.25rem, env(safe-area-inset-bottom)); }
  .hero-copy p { margin-bottom: 1rem; }
  .hero-actions .btn-lg { padding: 0.75rem 1.375rem; font-size: 1rem; }
}

/* Schermi orizzontali bassi (telefono girato, finestre basse) */
@media (max-height: 560px) and (min-aspect-ratio: 1001/1000) {
  .eyebrow, .scroll-hint { display: none; }
  .hero-copy h1 { margin-bottom: 0.625rem; }
  .hero-copy p { margin-bottom: 1rem; line-height: 1.45; }
  .hero-actions { gap: 0.25rem 0.625rem; }
  .hero-actions .btn-lg { padding: 0.6875rem 1.25rem; font-size: .95rem; }
  .flip-caption { bottom: 4vh; }
  .flip-caption strong { font-size: clamp(1.4rem, 8vh, 2.4rem); }
  .flip-caption span { margin-top: 0.25rem; font-size: .9rem; }
  .benefits h2 { margin-bottom: 0.75rem; }
  .benefits ul { gap: 0.5rem; }
  .benefits li { padding: 0.625rem 0.875rem; gap: 0.75rem; border-radius: 0.875rem; align-items: center; }
  .benefits li strong { margin: 0; font-size: .95rem; }
  .benefits li span span { display: none; }
  .benefit-icon { width: 2rem; height: 2rem; border-radius: 0.5rem; }
  .benefit-icon svg { width: 1.125rem; height: 1.125rem; }
}
@media (max-height: 380px) and (min-aspect-ratio: 1001/1000) {
  .flip-caption span { display: none; }
  .hero-copy p { font-size: .85rem; }
}

@media (max-width: 899px) {
  .section { padding: 5rem 1.25rem; }
  .notice { flex-direction: column; text-align: center; padding: 1.625rem 1.375rem; }
}
@media (max-width: 759px) {
  .steps { grid-template-columns: 1fr; }
}
@media (max-width: 380px) {
  .section { padding: 4rem 1rem; }
  .free-amount { font-size: 6rem; }
  .steps li { padding: 1.375rem; }
  .final-cta .btn-lg { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .benefits h2, .benefits li { transition: none; filter: none; }
  .scroll-hint span { animation: none; }
}

/* Modulo di richiesta */
dialog {
  width: min(30rem, calc(100vw - 1.5rem));
  max-height: calc(100svh - 2rem);
  padding: 0;
  border: 0;
  border-radius: 1.75rem;
  overflow: auto;
  overscroll-behavior: contain;
  color: var(--text);
  background: linear-gradient(180deg, #201f1d 0%, #141414 100%);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 2.5rem 5.625rem -1.25rem rgba(0, 0, 0, 0.85);
}
dialog[open] { animation: sheet-in .55s cubic-bezier(0.16, 1, 0.3, 1); }
dialog::backdrop { background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(0.75rem); -webkit-backdrop-filter: blur(0.75rem); }
dialog[open]::backdrop { animation: fade-in .35s ease; }
@keyframes sheet-in { from { opacity: 0; transform: translateY(1.75rem) scale(0.96); } }
@keyframes fade-in { from { opacity: 0; } }

.sheet { position: relative; padding: 1.625rem 1.75rem 1.625rem; }
.sheet::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 16.25rem;
  background: radial-gradient(60% 100% at 50% 0%, rgba(240, 195, 90, 0.18), transparent 70%);
  pointer-events: none;
}
.sheet > * { position: relative; }
.sheet-grabber { display: none; }
.sheet-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 2.125rem;
  height: 2.125rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.sheet-close:hover { background: rgba(255, 255, 255, 0.14); color: var(--text); }
.sheet-close svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }

.mini-scene { display: flex; justify-content: center; margin: 0.375rem 0 1.375rem; perspective: 62.5rem; }
.mini-card {
  position: relative;
  width: 13.75rem;
  aspect-ratio: 1.586;
  transform-style: preserve-3d;
  transform: rotateX(10deg) rotateZ(-4deg);
  transition: transform 1s cubic-bezier(0.2, 0.8, 0.2, 1);
  animation: mini-float 5s ease-in-out infinite;
}
.mini-card.is-flipped { transform: rotateX(0deg) rotateY(180deg) rotateZ(0deg) scale(1.08); animation: none; }
@keyframes mini-float {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -0.375rem; }
}
.mini-face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0.875rem 1rem;
  border-radius: 0.75rem;
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(212, 164, 58, 0.38), transparent 55%),
    linear-gradient(150deg, #2c2b2f 0%, #161618 100%);
  box-shadow:
    inset 0 0 0 1px rgba(240, 201, 106, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 1.25rem 2.5rem -0.875rem rgba(0, 0, 0, 0.8);
}
.mini-back { transform: rotateY(180deg); align-items: center; justify-content: center; gap: 0.625rem; text-align: center; }
.mini-top { display: flex; justify-content: space-between; align-items: flex-start; }
.mini-top img { width: 2.25rem; height: 2rem; object-fit: contain; }
.mini-top .tessera-label, .mini-back .tessera-label { font-size: 0.5625rem; }
.mini-name {
  display: block;
  overflow: hidden;
  font-size: 1.0625rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  white-space: nowrap;
  text-overflow: ellipsis;
  transition: color .2s;
}
.mini-name.is-placeholder { color: rgba(245, 245, 247, 0.35); }
.mini-note { display: block; margin-top: 0.1875rem; font-size: 0.6563rem; color: rgba(245, 245, 247, 0.55); }
.mini-code {
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  background: #fbfaf6;
  color: #1a1a1c;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: .18em;
}

.sheet-head { text-align: center; }
.sheet-head h2 { margin: 0 0 0.375rem; font-size: 1.75rem; }
.sheet-head p { margin: 0; color: var(--muted); }

#register-form { margin-top: 1.5rem; }
.group-label {
  display: block;
  margin: 1.25rem 0.25rem 0.625rem;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.group-label:first-child { margin-top: 0; }

.row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.625rem; }
.field { position: relative; margin-bottom: 0.625rem; }
.field input {
  width: 100%;
  height: 3.625rem;
  padding: 1.375rem 1rem 0.375rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.875rem;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.field input:hover { border-color: rgba(255, 255, 255, 0.18); }
.field input:focus {
  outline: none;
  border-color: var(--gold);
  background: rgba(240, 195, 90, 0.06);
  box-shadow: 0 0 0 0.25rem rgba(240, 195, 90, 0.14);
}
.field input:-webkit-autofill {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 6.25rem #2a2721 inset;
  caret-color: var(--text);
}
.field label {
  position: absolute;
  left: 1.0625rem;
  top: 1.1875rem;
  color: var(--muted);
  font-size: 1rem;
  pointer-events: none;
  transform-origin: left top;
  transition: transform .2s cubic-bezier(0.16, 1, 0.3, 1), color .2s;
}
.field input:focus + label,
.field input:not(:placeholder-shown) + label,
.field input:-webkit-autofill + label { transform: translateY(-0.6875rem) scale(0.75); }
.field input:focus + label { color: var(--gold); }
#taxCode { text-transform: uppercase; letter-spacing: .06em; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.phone-field {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.5rem;
}
.phone-field > .phone-prefix {
  position: relative;
  left: auto;
  top: auto;
  transform: none;
  pointer-events: auto;
  flex: 0 0 7.375rem;
  width: 7.375rem;
  color: inherit;
  font-size: inherit;
}
.phone-prefix select {
  width: 100%;
  height: 3.625rem;
  padding: 0 1.75rem 0 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.875rem;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  color-scheme: dark;
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.phone-prefix select:hover { border-color: rgba(255, 255, 255, 0.18); }
.phone-prefix select:focus {
  outline: none;
  border-color: var(--gold);
  background: rgba(240, 195, 90, 0.06);
  box-shadow: 0 0 0 0.25rem rgba(240, 195, 90, 0.14);
}
.phone-prefix select option { background: #1d1c1e; color: var(--text); }
.phone-prefix::after {
  content: '';
  position: absolute;
  right: 0.75rem;
  top: 50%;
  width: 0.5rem;
  height: 0.5rem;
  margin-top: -0.375rem;
  border-right: 0.125rem solid var(--muted);
  border-bottom: 0.125rem solid var(--muted);
  transform: rotate(45deg);
  pointer-events: none;
}
.phone-number { position: relative; flex: 1 1 10rem; min-width: 0; }
.phone-field .error { flex: 1 0 100%; }

.field.has-icon input { padding-left: 3rem; }
.field.has-icon.has-scan input { padding-right: 7.375rem; }
.field.has-icon label { left: 3.0625rem; }
.field-icon {
  position: absolute;
  left: 0.9375rem;
  top: 1.125rem;
  width: 1.375rem;
  height: 1.375rem;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
  transition: stroke .2s;
}
.field:focus-within .field-icon { stroke: var(--gold); }

.scan-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  height: 2.625rem;
  padding: 0 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  border: 0;
  border-radius: 0.625rem;
  background: rgba(240, 195, 90, 0.14);
  color: var(--gold);
  font: inherit;
  font-size: .8rem;
  font-weight: 700;
  cursor: pointer;
}
.scan-btn svg { width: 1.125rem; height: 1.125rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.scan-btn:hover { filter: brightness(1.1); }
.scan-hint { margin: -0.125rem 0.25rem 0.875rem; color: var(--muted); font-size: .82rem; line-height: 1.45; }
.scan-hint strong { color: var(--text); font-weight: 600; }

.sheet.is-scanning .mini-scene { display: none; }
.scan-panel { text-align: center; }
.scan-panel h2 { margin: 0.5rem 0 1rem; font-size: 1.45rem; }
.scan-steps {
  list-style: none;
  margin: 0 0 1.125rem;
  padding: 0;
  display: grid;
  gap: 0.5rem;
  text-align: left;
}
.scan-steps li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.4;
}
.scan-steps li::before {
  content: counter(scan-step);
  counter-increment: scan-step;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  margin-top: 1px;
  border-radius: 50%;
  background: rgba(240, 195, 90, 0.16);
  color: var(--gold);
  font-size: .75rem;
  font-weight: 700;
}
.scan-steps { counter-reset: scan-step; }
.scan-steps strong { color: var(--text); }
.scan-view {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border-radius: 1.125rem;
  background: #000;
}
.scan-view video,
#scan-reader,
#scan-reader video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
#scan-reader { position: absolute; inset: 0; }
#scan-reader img, #scan-reader canvas { display: none; }
.scan-frame {
  position: absolute;
  left: 4%;
  right: 4%;
  top: 36%;
  height: 28%;
  border: 0.125rem solid rgba(240, 195, 90, 0.9);
  border-radius: 0.625rem;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}
.scan-frame::after {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  height: 0.125rem;
  top: 50%;
  background: rgba(240, 195, 90, 0.85);
  animation: scan-line 1.6s ease-in-out infinite;
}
@keyframes scan-line {
  0%, 100% { transform: translateY(-1.125rem); opacity: .4; }
  50% { transform: translateY(1.125rem); opacity: 1; }
}
.scan-status { margin: 0.875rem 0.5rem 0; color: var(--muted); font-size: .9rem; min-height: 2.6em; }
.scan-status.is-ok { color: var(--ok); font-weight: 600; }
.scan-status.is-error { color: var(--danger); }
.field.has-scan.is-just-scanned input { border-color: var(--ok); box-shadow: 0 0 0 0.25rem rgba(76, 175, 122, 0.16); }

.field .error { display: block; margin: 0.375rem 0.25rem 0; color: var(--danger); font-size: .8rem; }
.field .error:empty { display: none; }
.field.invalid input,
.field.invalid .phone-prefix select { border-color: var(--danger); box-shadow: 0 0 0 0.25rem rgba(226, 88, 77, 0.14); animation: shake .4s; }
.field.invalid label, .field.invalid .field-icon { color: var(--danger); stroke: var(--danger); }
@keyframes shake {
  20%, 60% { transform: translateX(-0.3125rem); }
  40%, 80% { transform: translateX(0.3125rem); }
}

.alert { border-radius: 0.75rem; padding: 0.75rem 0.875rem; margin: 0.375rem 0 0; line-height: 1.45; font-size: .9rem; }
.alert-error { background: rgba(226, 88, 77, 0.12); border: 1px solid rgba(226, 88, 77, 0.5); }

.btn-submit { position: relative; width: 100%; height: 3.375rem; margin-top: 1rem; font-size: 1.05rem; }
.spinner {
  display: none;
  position: absolute;
  width: 1.375rem;
  height: 1.375rem;
  border: 0.1563rem solid rgba(28, 27, 27, 0.25);
  border-top-color: #1c1b1b;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.btn-submit.is-loading .btn-label { visibility: hidden; }
.btn-submit.is-loading .spinner { display: block; }
.btn-submit.is-loading:disabled { opacity: 1; }
@keyframes spin { to { transform: rotate(360deg); } }
.sheet-foot { margin: 0.875rem 0.5rem 0; text-align: center; color: var(--muted); font-size: .82rem; line-height: 1.45; }

.success { text-align: center; animation: fade-up .6s cubic-bezier(0.16, 1, 0.3, 1) .35s both; }
.success-check { width: 3.75rem; height: 3.75rem; fill: none; stroke: var(--ok); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.success-check circle { stroke-dasharray: 151; stroke-dashoffset: 151; animation: draw .7s ease-out .5s forwards; opacity: .9; }
.success-check path { stroke-dasharray: 36; stroke-dashoffset: 36; animation: draw .4s ease-out 1.1s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(1rem); } }
.success h2 { margin: 0.75rem 0 0.5rem; font-size: 1.6rem; }
.success p { margin: 0 auto; max-width: 21.25rem; color: var(--muted); line-height: 1.5; }
.success .btn-submit { margin-top: 1.375rem; }

.hidden { display: none !important; }

@media (max-height: 520px) {
  .mini-scene { display: none; }
  .sheet { padding-top: 1.25rem; }
  #register-form { margin-top: 1rem; }
}

@media (max-width: 600px) {
  dialog {
    width: 100%;
    max-width: 100%;
    max-height: 94svh;
    margin: auto 0 0;
    border-radius: 1.75rem 1.75rem 0 0;
  }
  dialog[open] { animation: sheet-up .5s cubic-bezier(0.16, 1, 0.3, 1); }
  @keyframes sheet-up { from { transform: translateY(100%); } }
  .sheet { padding: 0.75rem 1.25rem calc(1.375rem + env(safe-area-inset-bottom)); }
  .sheet-grabber { display: block; width: 2.375rem; height: 0.3125rem; margin: 0 auto 0.625rem; border-radius: 0.1875rem; background: rgba(255, 255, 255, 0.22); }
  .sheet-close { top: 0.875rem; right: 0.875rem; }
  .mini-card { width: 11.875rem; }
  .mini-scene { margin: 0.625rem 0 1.125rem; }
  .sheet-head h2 { font-size: 1.5rem; }
}

/* Casella informativa privacy nel modulo */
.field.consent { margin: 0.25rem 0 0.875rem; }
.field.consent input,
.field.consent input:focus { position: absolute; opacity: 0; width: 1px; height: 1px; padding: 0; border: 0; }
.field.consent input + label {
  position: static;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.45;
  cursor: pointer;
  transform: none;
  pointer-events: auto;
}
.field.consent a { color: var(--gold); font-weight: 600; }
.consent-box {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 1.625rem;
  height: 1.625rem;
  border-radius: 0.5rem;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.04);
  transition: background .2s, border-color .2s, transform .2s;
}
.consent-box svg { width: 1.125rem; height: 1.125rem; fill: none; stroke: #1c1b1b; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; opacity: 0; transform: scale(.5); transition: opacity .2s, transform .25s cubic-bezier(.2, .8, .2, 1.4); }
.field.consent input:checked + label .consent-box { background: var(--gold); border-color: var(--gold); }
.field.consent input:checked + label .consent-box svg { opacity: 1; transform: none; }
.field.consent input:focus-visible + label .consent-box { box-shadow: 0 0 0 0.25rem rgba(240, 195, 90, 0.25); }
.field.consent input:checked + label { color: var(--text); }
.field.consent.invalid .consent-box { border-color: var(--danger); }


@media (prefers-reduced-motion: reduce) {
  dialog[open], dialog[open]::backdrop, .mini-card, .success, .field.invalid input { animation: none; }
  .success-check circle, .success-check path { animation: none; stroke-dashoffset: 0; }
}

