:root {
  --text: #272727;
  --muted: #5c6e7b;
  --bg: #fff;
  --band: #f58284;
  --highlight: #eefe3c;
  --cta: #e7303f;
  --arrow: #f4524d;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 Roboto, system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* Fascia colorata con titolo e video */
.band {
  padding: 16px 16px clamp(32px, 6vw, 72px);
  background: var(--band);
  text-align: center;
}

.band-inner {
  width: 100%;
  max-width: min(1140px, max(480px, calc((100vh - 240px) * 16 / 9)));
  margin: 0 auto;
}

h1, #subheadline {
  color: #fff;
  font-family: "Roboto Condensed", Roboto, "Arial Narrow", sans-serif;
  font-weight: 700;
  text-shadow: 2px 4px 5px rgba(0, 0, 0, .5);
}

h1 {
  margin: 0 0 6px;
  font-size: clamp(1.9rem, 5vw, 3.75rem);
  line-height: 1.12;
}

h1 mark { background: none; color: var(--highlight); }

#subheadline {
  margin: 0 0 14px;
  font-size: clamp(1.1rem, 2.4vw, 1.75rem);
  line-height: 1.2;
}

/* Video */
#vsl {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  container-type: size;
  overflow: hidden;
  border: clamp(5px, .7vw, 10px) solid #fff;
  border-radius: 16px;
  background: #000;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .35);
}

#vsl[data-format="portrait"] {
  width: auto;
  max-width: 100%;
  height: min(90vh, calc(100vw * 16 / 9));
  aspect-ratio: 9 / 16;
  margin: 0 auto;
}

#vsl iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

#vsl-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  color: #fff;
  background: transparent center / cover no-repeat;
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

#vsl-layer:focus-visible { outline: 3px solid #fff; outline-offset: -3px; }

#vsl-layer[data-mode="loading"],
#vsl-layer[data-mode="ended"],
#vsl-layer[data-mode="error"] { background-color: #000; }
#vsl-layer[data-mode="sound"] { background-color: rgba(0, 0, 0, .5); }
#vsl-layer[data-mode="paused"] { background-color: rgba(0, 0, 0, .8); }
#vsl-layer[data-mode="error"] { cursor: default; }

/* Bottone circolare che pulsa */
#vsl-badge {
  --size: min(72cqw, 82cqh);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: calc(var(--size) * .04);
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background: rgba(20, 20, 20, .92);
  animation: vsl-pulse 1s linear infinite alternate;
}

@keyframes vsl-pulse {
  from { transform: scale(1); }
  to { transform: scale(1.05); }
}

#vsl-label {
  font-family: Montserrat, Roboto, sans-serif;
  font-size: calc(var(--size) * .098);
  font-weight: 800;
  line-height: 1.12;
  text-transform: uppercase;
  white-space: pre-line;
}

#vsl-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: calc(var(--size) * .4);
  height: calc(var(--size) * .4);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 calc(var(--size) * .04) rgba(255, 255, 255, .08);
}

#vsl-icon svg { width: 58%; height: 58%; fill: #141414; }

#vsl-arrow {
  position: absolute;
  right: 14%;
  bottom: 31%;
  width: 17%;
  height: auto;
  fill: none;
  stroke: var(--arrow);
  stroke-width: 7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#vsl-layer[data-mode="loading"] #vsl-badge,
#vsl-layer[data-mode="none"] #vsl-badge { display: none; }

#vsl-layer[data-mode="error"] #vsl-badge {
  width: 90%;
  height: auto;
  background: none;
  animation: none;
}
#vsl-layer[data-mode="error"] #vsl-label {
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  text-transform: none;
}
#vsl-layer[data-mode="error"] #vsl-icon,
#vsl-layer[data-mode="error"] #vsl-arrow { display: none; }

/* Durante la riproduzione resta solo il vetro con l'icona pausa */
#vsl-pause-hint {
  display: none;
  position: absolute;
  left: 14px;
  bottom: 14px;
  width: 26px;
  height: 26px;
  fill: #fff;
  opacity: .75;
}
#vsl-layer[data-mode="none"] #vsl-pause-hint { display: block; }

@media (prefers-reduced-motion: reduce) {
  #vsl-badge { animation: none; }
}

/* CTA */
main {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 16px;
  text-align: center;
}

#cta-wrap { padding-top: 32px; }

#cta, #lead-submit {
  width: 100%;
  max-width: 520px;
  min-height: 60px;
  padding: 14px 20px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: var(--cta);
  font: inherit;
  font-family: "Roboto Condensed", Roboto, sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .25);
  cursor: pointer;
}

#lead-submit:disabled { opacity: .6; cursor: progress; }

footer { padding: 32px 16px 20px; color: var(--muted); font-size: .85rem; text-align: center; }

/* Form */
dialog {
  width: min(440px, calc(100vw - 32px));
  padding: 24px;
  border: 0;
  border-radius: 12px;
  color: var(--text);
}

dialog::backdrop { background: rgba(0, 0, 0, .7); }

dialog h2 { margin: 0 32px 16px 0; font-size: 1.3rem; }

#lead-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 44px;
  height: 44px;
  border: 0;
  background: none;
  font-size: 1.75rem;
  cursor: pointer;
}

.field { margin-bottom: 12px; }
.field label { display: block; margin-bottom: 4px; font-weight: 600; }
.field input {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid #a1a1aa;
  border-radius: 6px;
  font: inherit;
}

#lead-message { min-height: 1.5em; margin: 8px 0; }
#lead-message[data-kind="error"] { color: #b42318; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
