/* ---------------------------------------------
   Variabili di progetto (palette + font di base)
--------------------------------------------- */
:root {
  --color-bg: #ffffff;
  --color-bg-alt: #f6f6f3;
  --color-text: #1a1a1a;
  --color-text-muted: #666660;
  --color-border: #e3e3dd;
  --color-accent: #0a6cff;
  --color-accent-dark: #0850c4;
  --color-accent-tint: #eaf2ff;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --max-width: 1180px;
  --space-xs: 8px;
  --space-sm: 16px;
  --space-md: 32px;
  --space-lg: 64px;
  --space-xl: 112px;
}

/* ---------------------------------------------
   Reset di base
--------------------------------------------- */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p {
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

img {
  max-width: 100%;
  display: block;
}

.section-inner,
.nav-inner,
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding-left: var(--space-md);
  padding-right: var(--space-md);
}

.eyebrow {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--color-accent);
  margin-bottom: var(--space-sm);
}

.btn {
  display: inline-block;
  padding: 14px 28px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.btn-accent {
  background: var(--color-accent);
  color: #ffffff;
}

.btn-accent:hover {
  background: var(--color-accent-dark);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(10, 108, 255, 0.25);
}

.btn-accent:active {
  transform: translateY(0);
}

/* ---------------------------------------------
   Schermata di ingresso
--------------------------------------------- */
html.intro-skip .intro-screen {
  display: none;
}

body.intro-locked {
  overflow: hidden;
}

.intro-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg);
  opacity: 1;
  transition: opacity 0.6s ease;
  padding: var(--space-md);
  overflow-y: auto;
}

.intro-screen.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.intro-inner {
  max-width: 320px;
  width: 100%;
  text-align: center;
  margin: auto;
}

.intro-inner .eyebrow {
  margin-bottom: var(--space-sm);
}

.intro-image-btn {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
}

.intro-placeholder {
  aspect-ratio: 1 / 1;
  width: 100%;
  border-radius: 8px;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-md);
  color: var(--color-text-muted);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 14px;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.intro-image-btn:hover .intro-placeholder {
  transform: translateY(-4px);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.08);
  border-color: var(--color-accent);
}

.intro-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 8px;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  animation: intro-pulse 2s ease-in-out infinite;
}

.intro-image-btn:hover .intro-image {
  transform: translateY(-4px);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.12);
  animation-play-state: paused;
}

@keyframes intro-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(10, 108, 255, 0.35);
  }
  50% {
    box-shadow: 0 0 0 14px rgba(10, 108, 255, 0);
  }
}

.intro-cta {
  display: inline-block;
  margin-top: var(--space-sm);
  font-weight: 600;
  color: var(--color-accent);
}

@media (prefers-reduced-motion: reduce) {
  .intro-image {
    animation: none;
  }
}

/* ---------------------------------------------
   Video in evidenza
--------------------------------------------- */
.video-hero {
  padding: 0;
}

.video-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--color-text-muted);
}

.hero-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.video-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-bg);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 15px;
}

.mute-toggle {
  position: absolute;
  right: var(--space-sm);
  bottom: var(--space-sm);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.55);
  color: #ffffff;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.mute-toggle:hover {
  background: rgba(0, 0, 0, 0.75);
  transform: scale(1.06);
}

.mute-toggle[hidden] {
  display: none;
}

.video-play-btn {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.35);
  transition: background-color 0.2s ease;
}

.video-play-btn:hover {
  background: rgba(0, 0, 0, 0.45);
}

.video-play-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--color-text);
  font-size: 26px;
  padding-left: 4px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease;
}

.video-play-btn:hover .video-play-icon {
  transform: scale(1.08);
}

.video-play-btn.is-hidden {
  display: none;
}

/* ---------------------------------------------
   Nav
--------------------------------------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--color-border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.nav-logo {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.nav-logo span {
  color: var(--color-accent);
}

.nav-links {
  display: flex;
  gap: var(--space-md);
}

.nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-muted);
  position: relative;
  padding: 4px 0;
  transition: color 0.2s ease;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 1px;
  background: var(--color-accent);
  transition: width 0.25s ease;
}

.nav-links a:hover {
  color: var(--color-text);
}

.nav-links a:hover::after {
  width: 100%;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: none;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---------------------------------------------
   Hero
--------------------------------------------- */
.hero {
  padding: var(--space-xl) var(--space-md) var(--space-lg);
  background: linear-gradient(180deg, var(--color-accent-tint) 0%, var(--color-bg) 65%);
}

.hero-inner {
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.12;
  margin-bottom: var(--space-sm);
}

.hero-sub {
  font-size: 18px;
  color: var(--color-text-muted);
  max-width: 560px;
  margin: 0 auto var(--space-md);
}

/* ---------------------------------------------
   Tiles
--------------------------------------------- */
.tiles {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-md) var(--space-xl);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

.tile {
  display: block;
  padding: var(--space-lg) var(--space-md);
  border-radius: 8px;
  background: var(--color-bg-alt);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.tile-alt {
  background: var(--color-accent-tint);
}

.tile:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.06);
}

.tile h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: var(--space-sm);
  letter-spacing: -0.01em;
}

.tile p {
  color: var(--color-text-muted);
  margin-bottom: var(--space-sm);
}

.tile-link {
  font-weight: 600;
  color: var(--color-accent);
  transition: transform 0.2s ease;
  display: inline-block;
}

.tile:hover .tile-link {
  transform: translateX(4px);
}

/* ---------------------------------------------
   Sezioni generiche
--------------------------------------------- */
.section {
  padding: var(--space-xl) 0;
}

.section-alt {
  background: var(--color-bg-alt);
}

.section-title {
  font-size: clamp(1.8rem, 3.2vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: var(--space-md);
  max-width: 640px;
}

.section-lead {
  color: var(--color-text-muted);
  font-size: 17px;
  max-width: 560px;
  margin-bottom: var(--space-md);
}

/* ---------------------------------------------
   Come funziona
--------------------------------------------- */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: var(--space-md);
}

.step {
  padding: var(--space-md) var(--space-md) 0 0;
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-md);
}

.step + .step {
  border-left: 1px solid var(--color-border);
  padding-left: var(--space-md);
}

.step-number {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--color-accent);
  margin-bottom: var(--space-xs);
}

.step h3 {
  font-size: 19px;
  font-weight: 700;
  margin-bottom: var(--space-xs);
}

.step p {
  color: var(--color-text-muted);
  font-size: 15px;
}

/* ---------------------------------------------
   Zone coperte / mappa di copertura
--------------------------------------------- */
.coverage-map {
  width: 100%;
}

.coverage-map-frame-wrap {
  position: relative;
  width: 100%;
  max-width: 620px;
  margin: 0 auto;
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--color-border);
  background: var(--color-bg-alt);
}

.coverage-map-frame {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  filter: grayscale(0.7) contrast(1.05);
}

/* Overlay che blocca la mappa (niente drag/zoom accidentale): si nasconde
   al click sul pulsante e può essere ripristinato in qualsiasi momento. */
.coverage-map-lock {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
}

.coverage-map-lock[hidden] {
  display: none;
}

.coverage-map-radius {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 59%;
  aspect-ratio: 1 / 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 2px dashed var(--color-accent);
  background: rgba(10, 108, 255, 0.05);
  pointer-events: none;
}

.coverage-map-activate {
  position: relative;
  z-index: 1;
  padding: 12px 22px;
  border: none;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.coverage-map-activate:hover {
  background: #ffffff;
  transform: translateY(-1px);
}

.coverage-map-relock {
  position: absolute;
  right: var(--space-sm);
  bottom: var(--space-sm);
  z-index: 1;
  padding: 8px 14px;
  border: none;
  border-radius: 6px;
  background: rgba(26, 26, 26, 0.82);
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.coverage-map-relock:hover {
  background: rgba(0, 0, 0, 0.9);
  transform: translateY(-1px);
}

.coverage-map-relock[hidden] {
  display: none;
}

.coverage-map-caption {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: var(--space-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-align: center;
}

.coverage-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-accent);
  flex-shrink: 0;
}

/* ---------------------------------------------
   Testimonianze
--------------------------------------------- */
.quote {
  max-width: 700px;
  padding: var(--space-md) 0;
  border-top: 1px solid var(--color-border);
}

.quote:last-child {
  border-bottom: 1px solid var(--color-border);
}

.quote p {
  font-size: clamp(20px, 2.4vw, 26px);
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: -0.01em;
  margin-bottom: var(--space-sm);
}

.quote-author {
  color: var(--color-text-muted);
  font-size: 14px;
  font-weight: 600;
}

/* ---------------------------------------------
   FAQ
--------------------------------------------- */
.faq-list {
  border-top: 1px solid var(--color-border);
}

.faq-item {
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-sm) 0;
}

.faq-item summary {
  cursor: pointer;
  font-size: 17px;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  font-size: 22px;
  font-weight: 400;
  color: var(--color-accent);
  transition: transform 0.25s ease;
  margin-left: var(--space-sm);
  flex-shrink: 0;
}

.faq-item[open] summary::after {
  transform: rotate(45deg);
}

.faq-item p {
  color: var(--color-text-muted);
  padding-top: var(--space-sm);
  max-width: 640px;
}

/* ---------------------------------------------
   Contatti / form richiamata
--------------------------------------------- */
.contact-inner {
  max-width: 560px;
  text-align: left;
}

.callback-form {
  margin-top: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-row label {
  font-size: 14px;
  font-weight: 600;
}

.form-row input {
  font-family: var(--font-sans);
  font-size: 15px;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  background: var(--color-bg);
  color: var(--color-text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-row input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-tint);
}

.callback-form .btn {
  align-self: flex-start;
  margin-top: var(--space-xs);
}

.form-note {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-top: 0;
}

.form-confirm {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-accent);
  min-height: 20px;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.form-confirm.visible {
  opacity: 1;
  transform: translateY(0);
}

.form-confirm.is-error {
  color: #c0392b;
}

/* ---------------------------------------------
   Footer
--------------------------------------------- */
.footer {
  border-top: 1px solid var(--color-border);
  padding: var(--space-md) 0;
}

.footer-inner {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.footer-name {
  font-weight: 700;
}

.footer-tagline {
  color: var(--color-text-muted);
  font-size: 14px;
}

/* ---------------------------------------------
   Animazioni allo scroll
--------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ---------------------------------------------
   Responsive
--------------------------------------------- */
@media (max-width: 860px) {
  .nav-links {
    gap: var(--space-sm);
  }

  .tiles {
    grid-template-columns: 1fr;
  }

  .steps {
    grid-template-columns: 1fr;
  }

  .step + .step {
    border-left: none;
    padding-left: 0;
  }
}

@media (max-width: 560px) {
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.06);
    max-height: 0;
    overflow: hidden;
    visibility: hidden;
    transition: max-height 0.3s ease, visibility 0.3s ease;
  }

  .nav-links.is-open {
    max-height: 320px;
    visibility: visible;
  }

  .nav-links a {
    padding: 14px var(--space-md);
    border-top: 1px solid var(--color-border);
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}
