/* Manrope ospitato sul sito (niente Google Fonts = nessun dato inviato a terzi) */
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("assets/fonts/manrope-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("assets/fonts/manrope-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #ffffff;
  --ink: #0f1a2b;
  --accent: #1a4fb5;      /* blu */
  --accent-dark: #123b8a;
  --sky: #4cc3f2;         /* azzurro */
  --line: #dde5ef;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; }

/* scorrimento morbido verso le sezioni (numeri e menu) */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ---------- ANIMAZIONE D'INGRESSO ----------
   1) foto  2) icone a coppie: mail+1, WhatsApp+2, telefono+3  3) linea blu  4) I nostri servizi
   .intro la mette lo script in <head>, .is-go la mette script.js quando la foto è caricata */

/* Schermo d'apertura: c'è solo con .intro (chi ha le animazioni disattivate non lo vede) */
.loader { display: none; }

.intro .loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 1.1rem;
  padding: 1rem;
  background: var(--accent);
  color: #fff;
  transition: transform 750ms cubic-bezier(0.77, 0, 0.175, 1);
}
.intro.is-loaded .loader { transform: translateY(-100%); }

.intro:not(.is-loaded) body { overflow: hidden; } /* niente scroll finché c'è lo schermo blu */

.loader__name {
  font-weight: 800;
  font-size: clamp(1.15rem, 3vw, 2rem);
  letter-spacing: 0.06em;
  text-align: center;
  text-transform: uppercase;
  animation: loader-name 700ms cubic-bezier(0.23, 1, 0.32, 1) 100ms both;
}

.loader__bar {
  position: relative;
  width: clamp(7rem, 16vw, 11rem);
  height: 3px;
  border-radius: 3px;
  overflow: hidden;
  background: rgb(255 255 255 / 0.25);
}
.loader__bar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--sky);
  transform-origin: left;
  animation: loader-bar 950ms cubic-bezier(0.65, 0, 0.35, 1) 150ms both;
}

@keyframes loader-name { from { opacity: 0; translate: 0 14px; } to { opacity: 1; translate: 0 0; } }
@keyframes loader-bar  { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.intro .hero__box,
.intro .hero__areas > span,
.intro .hero__contacts .icon-btn,
.intro .hero__dots .dot,
.intro .marquee,
.intro .services { opacity: 0; }

.intro.is-go .hero__box { animation: intro-photo 800ms cubic-bezier(0.23, 1, 0.32, 1) both; }

.intro.is-go .hero__contacts .icon-btn,
.intro.is-go .hero__dots .dot {
  animation: intro-pop 450ms cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(650ms + var(--n) * 160ms);
}
/* province: scorrono una dopo l'altra insieme alla foto */
.intro.is-go .hero__areas > span {
  animation: intro-up 500ms cubic-bezier(0.23, 1, 0.32, 1) both;
  animation-delay: calc(200ms + var(--p, 0) * 45ms);
}
.hero__areas > span:nth-child(2)  { --p: 1; }
.hero__areas > span:nth-child(3)  { --p: 2; }
.hero__areas > span:nth-child(4)  { --p: 3; }
.hero__areas > span:nth-child(5)  { --p: 4; }
.hero__areas > span:nth-child(6)  { --p: 5; }
.hero__areas > span:nth-child(7)  { --p: 6; }
.hero__areas > span:nth-child(8)  { --p: 7; }
.hero__areas > span:nth-child(9)  { --p: 8; }
.hero__areas > span:nth-child(10) { --p: 9; }
.hero__areas > span:nth-child(11) { --p: 10; }

.hero__contacts .icon-btn:nth-child(1), .hero__dots .dot:nth-child(1) { --n: 0; }
.hero__contacts .icon-btn:nth-child(2), .hero__dots .dot:nth-child(2) { --n: 1; }
.hero__contacts .icon-btn:nth-child(3), .hero__dots .dot:nth-child(3) { --n: 2; }

.intro.is-go .marquee  { animation: intro-band 650ms cubic-bezier(0.77, 0, 0.175, 1) 1350ms both; }
.intro.is-go .services { animation: intro-up 700ms cubic-bezier(0.23, 1, 0.32, 1) 1750ms both; }

@keyframes intro-photo { from { opacity: 0; scale: 0.97; } to { opacity: 1; scale: 1; } }
@keyframes intro-pop   { from { opacity: 0; scale: 0.6; } to { opacity: 1; scale: 1; } }
@keyframes intro-band  { from { opacity: 1; clip-path: inset(0 100% 0 0); } to { opacity: 1; clip-path: inset(0); } }
@keyframes intro-up    { from { opacity: 0; translate: 0 24px; } to { opacity: 1; translate: 0 0; } }

/* ---------- HERO ---------- */

.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

/* Menu */
.header {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1rem, 3vw, 2.5rem);
  background: var(--accent); /* stesso blu della striscia che scorre */
}

/* Nome dell'attività a sinistra */
.header__brand {
  color: #fff;
  font-weight: 800;
  font-size: clamp(0.95rem, 1.4vw, 1.2rem);
  letter-spacing: 0.04em;
  line-height: 1.2;
  text-transform: uppercase;
  text-decoration: none;
}

.header .header__cta { color: var(--accent); }

.header__cta svg { width: 1.1em; height: 1.1em; fill: currentColor; margin-right: 0.5rem; }

.header__brand:focus-visible,
.header .header__cta:focus-visible {
  outline: 3px solid rgb(255 255 255 / 0.6);
  outline-offset: 4px;
  border-radius: 4px;
}

.hero__content {
  flex: 1;
  display: grid;
  /* icone e punti stanno subito accanto al box, non ai bordi dello schermo */
  grid-template-columns: auto minmax(0, 90rem) auto;
  justify-content: center;
  align-items: center;
  gap: clamp(0.5rem, 1vw, 0.875rem);
  padding: clamp(1.75rem, 4.5vw, 4.25rem) clamp(0.75rem, 1.5vw, 1.25rem);
}

/* Contatti a sinistra */
.hero__contacts {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  color: var(--ink);
  background: var(--bg);
  transition: transform 160ms ease-out, background-color 160ms ease-out,
              border-color 160ms ease-out, color 160ms ease-out;
  -webkit-tap-highlight-color: transparent;
}

.icon-btn svg { width: 1.35rem; height: 1.35rem; fill: currentColor; }

.icon-btn:active { transform: scale(0.94); }

/* Centro: scritta + box immagine */
.hero__center { width: 100%; }

/* Province coperte, in piccolo sopra la foto */
.hero__areas {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0;
  margin: 0 0 0.85rem;
  padding-inline: 0.25rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--ink) 60%, var(--bg));
}

/* puntino dopo ogni provincia (non prima), così una riga nuova non inizia con il puntino */
.hero__areas span:not(.hero__areas-label):not(:last-child)::after {
  content: "·";
  margin-inline: 0.55rem;
  color: var(--sky);
}

.hero__areas-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-right: 0.75rem;
  color: var(--accent);
  font-weight: 800;
}
/* su tablet e telefono le province non si mostrano sopra la foto */
@media (max-width: 1024px) {
  .hero__areas { display: none; }
}

.hero__areas-label svg {
  width: 1.05rem;
  height: 1.05rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.accent { color: var(--accent); }

.hero__box {
  position: relative;
  /* stesse proporzioni della foto (16:9) così non viene tagliata; su schermi bassi si ferma prima */
  width: 100%; /* larghezza fissa: se l'altezza si ferma, la foto si taglia un po' invece di restringersi */
  aspect-ratio: 16 / 9;
  max-height: max(19rem, 100svh - 12rem);
  border-radius: clamp(1rem, 2vw, 1.75rem);
  border: 1.5px solid var(--line); /* stesso bordo dei cerchi dei contatti */
  overflow: hidden;
  background: #e7edf5;
}

.hero__box img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 60% 10%; /* la nuova foto è 16:9: tiene la testa del tecnico dentro il box */
}

.hero__overlay {
  position: absolute;
  inset: auto 0 0 0;
  padding: clamp(1.25rem, 3.5vw, 3rem);
  padding-top: 8rem;
  background: linear-gradient(to top, rgba(8, 18, 40, 0.84), rgba(8, 18, 40, 0.6) 55%, transparent);
  color: #fff;
}

.hero__title {
  max-width: 34rem;
  margin: 0 0 1.5rem;
  font-size: clamp(1.6rem, 3.2vw, 2.9rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.accent-light { color: var(--sky); }

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.95rem 1.5rem;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  transition: transform 160ms ease-out, background-color 160ms ease-out;
  -webkit-tap-highlight-color: transparent;
}

.btn:active { transform: scale(0.97); }

.btn--primary { background: var(--accent); color: #fff; }
.btn--light   { background: #fff; color: var(--ink); }

.btn:focus-visible,
.icon-btn:focus-visible,
.dot:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent);
  outline-offset: 3px;
}

/* Numeri a destra: portano alle sezioni */
.hero__dots {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.dot {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1.5px solid var(--line);
  border-radius: 50%;
  background: var(--bg);
  color: var(--ink);
  font-weight: 800;
  font-size: 1rem;
  line-height: 1;
  text-decoration: none;
  transition: transform 160ms ease-out, background-color 160ms ease-out,
              border-color 160ms ease-out, color 160ms ease-out;
  -webkit-tap-highlight-color: transparent;
}

.dot:active { transform: scale(0.94); }

.dot.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }

@media (hover: hover) and (pointer: fine) {
  .btn--primary:hover { background: var(--accent-dark); }
  .btn--light:hover   { background: #e6f1fb; }
  .icon-btn:hover     { background: var(--accent); border-color: var(--accent); color: #fff; }
  .dot:hover          { background: var(--accent); border-color: var(--accent); color: #fff; }
}

/* Barra scorrevole */
.marquee {
  overflow: hidden;
  background: var(--accent);
  color: #fff;
  padding-block: clamp(1.1rem, 2vw, 1.6rem);
}

.marquee__track {
  display: flex;
  width: max-content;
  animation: marquee 75s linear infinite; /* scritte più grandi = percorso più lungo, la durata sale per non correre di più */
}

.marquee__group {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.marquee span {
  font-size: clamp(1.3rem, 2.5vw, 2.05rem);
  font-weight: 800;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* separatore tra le frasi */
.marquee i {
  width: 0.6rem;
  height: 0.6rem;
  margin-inline: clamp(1.5rem, 3.5vw, 3rem);
  border-radius: 50%;
  background: var(--sky);
  flex-shrink: 0;
}

@keyframes marquee {
  to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .marquee__track { animation-duration: 200s; }
}

/* ---------- TABLET / SMARTPHONE ---------- */

@media (max-width: 700px) {
  /* box in alto, sotto: icone a sinistra e punti a destra sulla stessa riga */
  .hero__content {
    grid-template-columns: 1fr auto;
    align-content: center;
    gap: 1rem;
  }

  .hero__center { order: 1; grid-column: 1 / -1; }

  .hero__contacts { order: 2; flex-direction: row; }

  .hero__dots { order: 3; flex-direction: row; }

  .hero__box { height: clamp(22rem, calc(100svh - 22rem), 30rem); }

  .header { padding-block: 0.75rem; }

  .header .header__cta { flex: 0 0 auto; padding: 0.8rem 1.2rem; }

  .hero__overlay { padding-top: 6rem; }

  .btn { flex: 1 1 100%; }
}

/* ---------- PER CHI LAVORIAMO (privati / aziende) ---------- */

.audience {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1rem, 2vw, 1.5rem);
  max-width: 90rem;
  margin-inline: auto;
  padding: clamp(3rem, 6vw, 5rem) clamp(1rem, 3vw, 2.5rem) 0;
}

.audience-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: clamp(1.75rem, 4vw, 3.25rem);
  border-radius: clamp(1rem, 2vw, 1.75rem);
  border: 1.5px solid color-mix(in srgb, var(--sky) 30%, var(--line));
  background: linear-gradient(150deg, color-mix(in srgb, var(--sky) 10%, var(--bg)) 0%, color-mix(in srgb, var(--sky) 22%, var(--bg)) 100%);
  color: var(--ink);
  overflow: hidden;
  isolation: isolate;
}

/* cerchi grandi e leggeri nell'angolo, solo decorazione */
.audience-card::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: -9rem;
  right: -9rem;
  width: 22rem;
  height: 22rem;
  border-radius: 50%;
  border: 2.75rem solid color-mix(in srgb, var(--sky) 16%, transparent);
}

.audience-card--dark {
  border-color: var(--accent);
  background: linear-gradient(150deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: #fff;
}
.audience-card--dark::before { border-color: rgb(255 255 255 / 0.06); }

.audience-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  align-self: stretch;
  gap: 1rem;
  margin-bottom: clamp(1.5rem, 3vw, 2.25rem);
}

.audience-card__icon {
  display: grid;
  place-items: center;
  width: 4.25rem;
  height: 4.25rem;
  border-radius: 1.25rem;
  background: linear-gradient(150deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: #fff;
  box-shadow: 0 10px 24px rgba(26, 79, 181, 0.25);
}
.audience-card--dark .audience-card__icon {
  background: #fff;
  color: var(--accent);
  box-shadow: 0 10px 24px rgba(8, 18, 40, 0.25);
}

.audience-card__icon svg {
  width: 2rem;
  height: 2rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* etichetta piccola in alto a destra */
.audience-card__tag {
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  background: var(--bg);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.audience-card--dark .audience-card__tag { background: rgb(255 255 255 / 0.14); color: #fff; }

.audience-card__name {
  margin: 0 0 0.85rem;
  font-size: clamp(2.25rem, 4.5vw, 3.5rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}
.audience-card:not(.audience-card--dark) .audience-card__name { color: var(--accent); }

.audience-card__text {
  max-width: 34rem;
  margin: 0 0 1.75rem;
  font-size: clamp(1rem, 1.3vw, 1.125rem);
  line-height: 1.65;
  color: color-mix(in srgb, var(--ink) 78%, transparent);
}
.audience-card--dark .audience-card__text { color: rgb(255 255 255 / 0.85); }

/* voci con icona, due per riga */
.audience-card__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  align-self: stretch;
  margin: 0 0 2rem;
  padding: 0;
  list-style: none;
}

.audience-card__list li {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.75rem 0.9rem;
  border-radius: 0.9rem;
  background: rgb(255 255 255 / 0.75);
  border: 1px solid color-mix(in srgb, var(--sky) 25%, var(--line));
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.25;
}
.audience-card--dark .audience-card__list li {
  background: rgb(255 255 255 / 0.08);
  border-color: rgb(255 255 255 / 0.16);
}

.audience-card__list svg {
  flex-shrink: 0;
  width: 1.35rem;
  height: 1.35rem;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.audience-card--dark .audience-card__list svg { stroke: var(--sky); }

.audience-card__btn { flex: none; margin-top: auto; gap: 0.5rem; }
.audience-card__btn svg { width: 1.1rem; height: 1.1rem; fill: currentColor; transition: transform 200ms ease-out; }
.audience-card--dark .audience-card__btn { color: var(--accent); }

@media (hover: hover) and (pointer: fine) {
  .audience-card__btn:hover svg { transform: translateX(4px); }
}

/* Comparsa una dopo l'altra (classi messe da script.js) */
.audience.is-animated .audience-card {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 550ms ease-out, transform 700ms cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: calc(var(--i) * 180ms);
}
.audience.is-visible .audience-card { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .audience.is-animated .audience-card { transform: none; transition: opacity 400ms ease-out; }
}

/* Tablet e smartphone: uno sotto l'altro */
@media (max-width: 860px) {
  .audience { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 480px) {
  .audience-card__list { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- SERVIZI ---------- */

.services {
  max-width: 90rem;
  margin-inline: auto;
  padding: clamp(3.5rem, 8vw, 7rem) clamp(1rem, 3vw, 2.5rem);
}

.services__title {
  margin: 0 0 clamp(1.5rem, 3vw, 2.5rem);
  font-size: clamp(2rem, 4vw, 3.25rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.services__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: clamp(1rem, 2vw, 1.5rem);
}

/* Sinistra: le schede occupano la stessa cella, così il box ha l'altezza della più lunga e non salta */
.services__card {
  display: grid;
  padding: clamp(1.75rem, 4vw, 3.5rem);
  border-radius: clamp(1rem, 2vw, 1.75rem);
  border: 1.5px solid color-mix(in srgb, var(--sky) 30%, var(--line));
  background: linear-gradient(150deg, color-mix(in srgb, var(--sky) 10%, var(--bg)) 0%, color-mix(in srgb, var(--sky) 22%, var(--bg)) 100%);
  color: var(--ink);
}

.service {
  grid-area: 1 / 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  visibility: hidden;
  opacity: 0;
}

.service.is-active {
  visibility: visible;
  opacity: 1;
  animation: service-in 320ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes service-in {
  from { opacity: 0; transform: translateY(10px); }
}

.service__num {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--accent);
}

.service__name {
  margin: 1rem 0 0.9rem;
  font-size: clamp(1.5rem, 2.6vw, 2.25rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.service__text {
  max-width: 38rem;
  margin: 0 0 2rem;
  font-size: clamp(1rem, 1.3vw, 1.15rem);
  line-height: 1.65;
  color: color-mix(in srgb, var(--ink) 78%, transparent);
}

.service .btn { margin-top: auto; }

/* Destra: pulsanti */
.services__tabs {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.service-tab {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 4rem;
  padding: 1rem 1.25rem;
  border: 1.5px solid var(--line);
  border-radius: 1rem;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: clamp(1rem, 1.3vw, 1.125rem);
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  transition: background-color 160ms ease-out, border-color 160ms ease-out,
              color 160ms ease-out, transform 160ms ease-out;
  -webkit-tap-highlight-color: transparent;
}

.service-tab__num {
  min-width: 1.6em; /* titoli allineati anche se "01" è più stretto di "02" */
  font-size: 0.85em;
  font-weight: 800;
  color: color-mix(in srgb, var(--ink) 45%, transparent);
  transition: color 160ms ease-out;
}

.service-tab svg {
  width: 1.25rem;
  height: 1.25rem;
  margin-left: auto;
  flex-shrink: 0;
  fill: currentColor;
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 160ms ease-out, transform 160ms ease-out;
}

.service-tab:active { transform: scale(0.98); }

.service-tab.is-active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--sky) 14%, var(--bg));
  color: var(--accent);
}

.service-tab.is-active .service-tab__num { color: var(--accent); }
.service-tab.is-active svg { opacity: 1; transform: none; }

.service-tab:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent);
  outline-offset: 2px;
}

@media (hover: hover) and (pointer: fine) {
  .service-tab:not(.is-active):hover { background: #eef4fb; border-color: color-mix(in srgb, var(--sky) 60%, var(--line)); }
}

@media (prefers-reduced-motion: reduce) {
  .service.is-active { animation-name: service-fade; }
  @keyframes service-fade { from { opacity: 0; } }
}

/* Smartphone e tablet stretti: pulsanti sopra, scheda sotto */
@media (max-width: 860px) {
  .services__grid { grid-template-columns: 1fr; }
  .services__tabs { order: -1; }
  .service-tab { min-height: 3.5rem; }
  .service .btn { flex: 0 1 auto; }
}

/* ---------- QUALITÀ ---------- */

.qualities {
  max-width: 90rem;
  margin-inline: auto;
  padding-inline: clamp(1rem, 3vw, 2.5rem);
}

.qualities__list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.5rem;
  margin: 0;
  padding: clamp(1.75rem, 3vw, 2.5rem) 0;
  list-style: none;
  /* linee sottili di separazione sopra e sotto */
  border-block: 1px solid var(--line);
}

.quality {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
}

/* cerchio blu pieno con l'icona bianca */
.quality__icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background: linear-gradient(150deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: #fff;
  box-shadow: 0 8px 20px rgba(26, 79, 181, 0.22);
}

.quality__icon svg {
  width: 1.6rem;
  height: 1.6rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.quality__name {
  font-size: clamp(1rem, 1.4vw, 1.2rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

/* Comparsa una dopo l'altra quando la sezione entra nello schermo.
   La classe .is-animated la mette script.js: senza JavaScript le voci restano visibili. */
.qualities.is-animated .quality {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 500ms ease-out, transform 600ms cubic-bezier(0.2, 0.8, 0.2, 1);
  transition-delay: calc(var(--i) * 150ms);
}

.qualities.is-animated .quality__icon {
  transform: scale(0.6);
  transition: transform 600ms cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: calc(var(--i) * 150ms + 120ms);
}

.qualities.is-visible .quality { opacity: 1; transform: none; }
.qualities.is-visible .quality__icon { transform: none; }

@media (prefers-reduced-motion: reduce) {
  .qualities.is-animated .quality { transform: none; transition: opacity 400ms ease-out; transition-delay: calc(var(--i) * 100ms); }
  .qualities.is-animated .quality__icon { transform: none; transition: none; }
}

/* Tablet: 2 per riga */
@media (max-width: 860px) {
  .qualities__list { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 2rem; }
  .quality { justify-content: flex-start; }
}

/* Smartphone: le qualità non si mostrano */
@media (max-width: 700px) {
  .qualities { display: none; }
  .specials__title { padding-top: 0; } /* basta lo spazio sotto i servizi */
}

/* ---------- SERVIZI SPECIALI ---------- */

/* Sfondo bianco, separata dai servizi da una linea sottile; contenuto allineato alle altre sezioni (max 90rem) */
.specials {
  --pad: clamp(1rem, 3vw, 2.5rem);
  max-width: 90rem;
  margin-inline: auto;
  padding: 0 var(--pad) clamp(3.5rem, 8vw, 7rem);
}

.specials__title { padding-top: clamp(3.5rem, 8vw, 6rem); }

.specials__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(1rem, 2vw, 1.5rem);
}

.special {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: clamp(1.5rem, 2.5vw, 2rem);
  border: 1.5px solid color-mix(in srgb, var(--sky) 35%, var(--line));
  border-radius: clamp(1rem, 2vw, 1.5rem);
  background: var(--bg);
  color: var(--ink);
  box-shadow: 0 6px 18px rgba(15, 26, 43, 0.05);
  transition: border-color 200ms ease-out, background-color 200ms ease-out,
              transform 200ms ease-out, box-shadow 200ms ease-out;
}

/* icona senza fondino, allineata a sinistra col titolo */
.special__icon {
  display: block;
  margin-bottom: 1.1rem;
  color: var(--accent);
}

.special__icon svg {
  display: block;
  width: 2.25rem;
  height: 2.25rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.special__name {
  margin: 0 0 0.75rem;
  font-size: clamp(1.2rem, 1.6vw, 1.4rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.015em;
}

/* il pulsante nel titolo copre tutta la card, così si clicca ovunque */
.special__link {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.special__link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.special__text {
  margin: 0 0 1.5rem;
  line-height: 1.6;
  color: color-mix(in srgb, var(--ink) 78%, transparent);
}

.special__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: auto;
  padding-top: 1.1rem;
  border-top: 1px solid color-mix(in srgb, var(--sky) 35%, var(--line));
  color: var(--accent);
  font-weight: 700;
  font-size: 0.95rem;
}

.special__cta svg {
  width: 1.1rem;
  height: 1.1rem;
  fill: currentColor;
  transition: transform 200ms ease-out;
}

.special:active { transform: scale(0.98); }

.special:has(.special__link:focus-visible) {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.special__link:focus-visible { outline: none; }

@media (hover: hover) and (pointer: fine) {
  .special:hover {
    border-color: color-mix(in srgb, var(--accent) 55%, var(--sky));
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(26, 79, 181, 0.12);
  }
  .special:hover .special__cta svg { transform: translateX(4px); }
}

@media (max-width: 1024px) {
  .specials__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .specials__grid { grid-template-columns: 1fr; }
}

/* ---------- DOVE LAVORIAMO ---------- */

.area {
  max-width: 90rem;
  margin-inline: auto;
  padding: 0 clamp(1rem, 3vw, 2.5rem) clamp(3.5rem, 8vw, 7rem);
}

/* stesso azzurro tenue della scheda servizi */
.area__box {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(2.25rem, 6vw, 4.5rem) clamp(1.25rem, 4vw, 3rem);
  border: 1.5px solid color-mix(in srgb, var(--sky) 30%, var(--line));
  border-radius: clamp(1rem, 2vw, 1.75rem);
  background: linear-gradient(150deg, color-mix(in srgb, var(--sky) 10%, var(--bg)) 0%, color-mix(in srgb, var(--sky) 22%, var(--bg)) 100%);
  text-align: center;
}

.area__title {
  margin: 0;
  font-size: clamp(1.9rem, 4vw, 3rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.area__intro {
  margin: 0.85rem 0 1.75rem;
  font-size: clamp(1rem, 1.3vw, 1.125rem);
  color: color-mix(in srgb, var(--ink) 78%, transparent);
}

.area__form {
  display: flex;
  gap: 0.6rem;
  width: min(100%, 32rem);
}

.area__field {
  position: relative;
  flex: 1;
}

.area__field > svg {
  position: absolute;
  left: 1.1rem;
  top: 50%;
  width: 1.3rem;
  height: 1.3rem;
  translate: 0 -50%;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.area__field input {
  width: 100%;
  height: 100%;
  min-height: 3.25rem;
  padding: 0.8rem 1rem 0.8rem 3rem;
  border: 1.5px solid color-mix(in srgb, var(--sky) 35%, var(--line));
  border-radius: 999px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  transition: border-color 160ms ease-out, box-shadow 160ms ease-out;
}

.area__field input::placeholder { color: color-mix(in srgb, var(--ink) 62%, transparent); font-weight: 500; }

.area__field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--sky) 35%, transparent);
}

.area__form .btn { flex: none; }

/* Suggerimenti province */
.area__suggest {
  position: absolute;
  z-index: 5;
  top: calc(100% + 0.4rem);
  left: 0;
  right: 0;
  margin: 0;
  padding: 0.4rem;
  list-style: none;
  border: 1.5px solid color-mix(in srgb, var(--sky) 35%, var(--line));
  border-radius: 1.25rem;
  background: var(--bg);
  text-align: left;
  box-shadow: 0 18px 40px rgba(15, 26, 43, 0.12);
  transform-origin: top center;
  animation: suggest-in 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.area__suggest[hidden] { display: none; }

@keyframes suggest-in {
  from { opacity: 0; transform: translateY(-4px) scale(0.98); }
}

.area__option {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 0.9rem;
  border-radius: 0.85rem;
  color: var(--ink);
  font-weight: 500;
  cursor: pointer;
  transition: background-color 120ms ease-out, color 120ms ease-out;
}

.area__option strong { font-weight: 800; color: var(--accent); }

.area__option svg {
  width: 1.1rem;
  height: 1.1rem;
  flex-shrink: 0;
  fill: none;
  stroke: color-mix(in srgb, var(--ink) 40%, transparent);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 120ms ease-out;
}

.area__option[aria-selected="true"] {
  background: color-mix(in srgb, var(--sky) 16%, var(--bg));
  color: var(--accent);
}

.area__option[aria-selected="true"] svg { stroke: var(--accent); }

@media (hover: hover) and (pointer: fine) {
  .area__option:hover { background: color-mix(in srgb, var(--sky) 16%, var(--bg)); color: var(--accent); }
  .area__option:hover svg { stroke: var(--accent); }
}

@media (prefers-reduced-motion: reduce) {
  .area__suggest { animation: none; }
}

/* Risultato */
.area__result:empty { display: none; }

.area__result {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  width: min(100%, 32rem);
  margin-top: 1.5rem;
  padding: 1.25rem 1.4rem;
  border-radius: 1.25rem;
  background: var(--bg);
  text-align: left;
  box-shadow: 0 10px 30px rgba(15, 26, 43, 0.08);
  animation: result-in 380ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes result-in {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
}

.area__result p { margin: 0 0 0.35rem; line-height: 1.5; }
.area__result .btn { margin-top: 0.75rem; }

.area__headline {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.area__icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  color: #fff;
}

.area__icon svg {
  width: 1.4rem;
  height: 1.4rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.area__result--ok .area__icon { background: linear-gradient(150deg, var(--accent), var(--accent-dark)); }
.area__result--ok .area__headline { color: var(--accent); }
.area__result--no .area__icon { background: color-mix(in srgb, var(--ink) 55%, transparent); }
.area__result--help .area__icon { background: color-mix(in srgb, var(--sky) 25%, var(--bg)); color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  .area__result { animation-name: fade-in; }
}

@media (max-width: 520px) {
  .area__form { flex-direction: column; }
}

/* testo per i lettori di schermo, invisibile a video */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- PREVENZIONE E MONITORAGGIO ---------- */

.prevention {
  max-width: 90rem;
  margin-inline: auto;
  padding: 0 clamp(1rem, 3vw, 2.5rem) clamp(3.5rem, 8vw, 7rem);
}

.prevention__title {
  margin-bottom: clamp(2.75rem, 6vw, 4.5rem);
  padding-top: clamp(3rem, 6vw, 5rem);
  border-top: 1px solid var(--line); /* separa dalla sezione prima */
  text-align: center;
}

.prevention__list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}

.prevention__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-inline: clamp(1rem, 2.5vw, 2.5rem);
  text-align: center;
}

/* linee sottili tra un blocco e l'altro */
.prevention__item + .prevention__item { border-left: 1px solid var(--line); }

/* cerchio blu con icona bianca, come le qualità */
.prevention__icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 3.75rem;
  height: 3.75rem;
  margin-bottom: 1.1rem;
  border-radius: 50%;
  background: linear-gradient(150deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: #fff;
  box-shadow: 0 8px 20px rgba(26, 79, 181, 0.22);
}

.prevention__icon svg {
  width: 1.7rem;
  height: 1.7rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.prevention__name {
  margin: 0 0 0.6rem;
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.prevention__text {
  max-width: 26rem;
  margin: 0;
  font-size: clamp(1rem, 1.2vw, 1.075rem);
  line-height: 1.65;
  color: color-mix(in srgb, var(--ink) 78%, transparent);
}

.prevention__cta {
  display: flex;
  justify-content: center;
  margin-top: clamp(2rem, 4vw, 3rem);
}

.prevention__cta .btn { flex: none; }

/* Comparsa uno dopo l'altro (classi messe da script.js) */
.prevention__list.is-animated .prevention__item {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 550ms ease-out, transform 700ms cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: calc(var(--i) * 250ms);
}

.prevention__list.is-visible .prevention__item { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .prevention__list.is-animated .prevention__item { transform: none; transition: opacity 400ms ease-out; transition-delay: calc(var(--i) * 150ms); }
}

/* Tablet e smartphone: uno sotto l'altro */
@media (max-width: 860px) {
  .prevention__list { grid-template-columns: 1fr; }
  .prevention__item { padding: 1.75rem 0; }
  .prevention__item + .prevention__item { border-left: 0; border-top: 1px solid var(--line); }
  .prevention__item:first-child { padding-top: 0; }
  .prevention__cta { margin-top: 0.5rem; }
}

/* ---------- CHI SIAMO ---------- */

.about {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
  /* stessa larghezza del contenuto delle altre sezioni, così la riga sopra non arriva ai bordi */
  width: min(100% - 2 * clamp(1rem, 3vw, 2.5rem), 85rem);
  margin-inline: auto;
  padding-block: clamp(3.5rem, 8vw, 7rem);
  border-top: 1px solid var(--line); /* separa dalla sezione prima */
}

/* Sinistra: le foto sono sovrapposte, quella nuova entra con una tendina dal basso */
.about__media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: clamp(1rem, 2vw, 1.75rem);
  background: color-mix(in srgb, var(--sky) 15%, var(--bg));
  isolation: isolate;
}

.about__slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  z-index: 0;
}
.about__slide.is-active  { opacity: 1; z-index: 2; }
.about__slide.is-leaving { opacity: 1; z-index: 1; }

@media (prefers-reduced-motion: no-preference) {
  .about__media.is-started .about__slide.is-active {
    animation: about-in 1100ms cubic-bezier(0.77, 0, 0.175, 1) both, about-zoom 6500ms cubic-bezier(0.23, 1, 0.32, 1) both;
  }
  .about__slide.is-leaving { animation: about-out 1100ms cubic-bezier(0.77, 0, 0.175, 1) both; }
}
@keyframes about-in   { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0); } }
@keyframes about-zoom { from { scale: 1.12; } to { scale: 1; } }
@keyframes about-out  { to { scale: 1.06; filter: brightness(0.65); } }

@media (prefers-reduced-motion: reduce) {
  .about__slide { transition: opacity 600ms ease-out; }
}

/* sfumatura in basso così le barrette si leggono su ogni foto */
.about__media::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 30%;
  background: linear-gradient(to top, rgb(15 26 43 / 0.45), transparent);
  z-index: 3;
  pointer-events: none;
}

.about__bars {
  position: absolute;
  left: clamp(1rem, 3vw, 1.75rem);
  right: clamp(1rem, 3vw, 1.75rem);
  bottom: clamp(0.75rem, 2.5vw, 1.25rem);
  display: flex;
  gap: 0.5rem;
  z-index: 4;
}

.about__bar {
  position: relative;
  flex: 1;
  height: 1.5rem; /* area di click comoda, la barra visibile è più sottile */
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.about__bar::before,
.about__bar span {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 3px;
  margin-top: -1.5px;
  border-radius: 3px;
}
.about__bar::before { background: rgb(255 255 255 / 0.4); }
.about__bar span {
  display: block;
  background: #fff;
  transform: scaleX(0);
  transform-origin: left;
}
.about__bar.is-done span { transform: scaleX(1); }
.about__bar.is-active span { animation: about-fill var(--about-time, 5000ms) linear both; }
.about__media.is-paused .about__bar.is-active span { animation-play-state: paused; }
@keyframes about-fill { to { transform: scaleX(1); } }

.about__bar:focus-visible { outline: 2px solid #fff; outline-offset: 2px; border-radius: 4px; }

/* Destra: descrizione */
.about__title { margin-bottom: clamp(1.25rem, 2.5vw, 1.75rem); }

.about__text {
  margin: 0 0 1rem;
  max-width: 36rem;
  font-size: clamp(1rem, 1.2vw, 1.125rem);
  line-height: 1.7;
  color: color-mix(in srgb, var(--ink) 75%, var(--bg));
}
.about__text:last-of-type { margin-bottom: 0; }

.about__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: clamp(1.75rem, 3vw, 2.25rem);
}
.about__actions .btn--light { box-shadow: inset 0 0 0 1.5px var(--line); } /* su sfondo bianco serve il bordo */

/* Tablet e smartphone: foto sopra, testo sotto */
@media (max-width: 860px) {
  .about { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- FOOTER ---------- */

.footer {
  background: var(--accent); /* stesso blu di menu e striscia */
  color: #fff;
}

.footer__inner {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr));
  gap: clamp(2rem, 4vw, 4rem);
  max-width: 90rem;
  margin-inline: auto;
  padding: clamp(3rem, 6vw, 4.5rem) clamp(1rem, 3vw, 2.5rem);
}

.footer__name {
  color: #fff;
  font-weight: 800;
  font-size: clamp(1.1rem, 1.6vw, 1.35rem);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
}

.footer__text {
  max-width: 24rem;
  margin: 0.9rem 0 0;
  line-height: 1.6;
  color: rgb(255 255 255 / 0.75);
}

.footer__title {
  margin: 0 0 1rem;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--sky) 45%, #fff); /* azzurro più chiaro: si legge bene sul blu */
}

.footer__list {
  display: grid;
  gap: 0.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
  color: rgb(255 255 255 / 0.85);
  overflow-wrap: anywhere; /* l'email è lunga: sui telefoni stretti va a capo invece di uscire */
}

.footer a {
  color: #fff;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.footer__list a { text-decoration: underline; text-decoration-color: rgb(255 255 255 / 0.3); text-underline-offset: 0.2em; }

.footer a:focus-visible {
  outline: 3px solid rgb(255 255 255 / 0.6);
  outline-offset: 3px;
  border-radius: 4px;
}

@media (hover: hover) and (pointer: fine) {
  .footer__list a { transition: text-decoration-color 160ms ease-out; }
  .footer__list a:hover { text-decoration-color: #fff; }
  .footer__bottom a:hover { text-decoration: underline; }
}

.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  max-width: 90rem;
  margin-inline: auto;
  padding: 1.25rem clamp(1rem, 3vw, 2.5rem);
  border-top: 1px solid rgb(255 255 255 / 0.18);
  font-size: 0.875rem;
  color: rgb(255 255 255 / 0.7);
}

.footer__legal {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
}

/* Tablet: nome sopra, le due colonne sotto. Telefono: tutto in colonna */
@media (max-width: 860px) {
  .footer__inner { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer__brand { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
  .footer__inner { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- POP-UP PREVENTIVO ---------- */

html.has-modal { overflow: hidden; }

.quote {
  width: min(100% - 2rem, 36rem);
  max-height: calc(100svh - 2rem);
  padding: 0;
  border: 0;
  border-radius: clamp(1rem, 2vw, 1.5rem);
  background: var(--bg);
  color: var(--ink);
  box-shadow: 0 30px 80px rgba(15, 26, 43, 0.28);
  overflow: auto;
}

.quote[open] { animation: quote-in 260ms cubic-bezier(0.2, 0.8, 0.2, 1); }

.quote::backdrop {
  background: rgba(15, 26, 43, 0.55);
  backdrop-filter: blur(3px);
}

.quote[open]::backdrop { animation: fade-in 260ms ease-out; }

@keyframes quote-in {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
}

@keyframes fade-in { from { opacity: 0; } }

.quote__form,
.quote__done {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: clamp(1.5rem, 4vw, 2.5rem);
}

.quote__done { align-items: flex-start; }
.quote__done p { margin: 0 0 0.5rem; line-height: 1.6; }

.quote__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background-color 160ms ease-out;
  -webkit-tap-highlight-color: transparent;
}

.quote__close svg { width: 1.3rem; height: 1.3rem; fill: currentColor; }

.quote__title {
  margin: 0;
  padding-right: 2.5rem; /* spazio per la X */
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

/* Riquadro con il servizio scelto */
.quote__service {
  margin: 0 0 0.25rem;
  padding: 0.85rem 1rem;
  border-radius: 0.85rem;
  background: color-mix(in srgb, var(--sky) 14%, var(--bg));
  font-size: 0.95rem;
  line-height: 1.5;
}

.quote__service strong { color: var(--accent); }

.quote__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.9rem;
  font-weight: 700;
}

.field input,
.field textarea {
  width: 100%;
  padding: 0.8rem 0.95rem;
  border: 1.5px solid var(--line);
  border-radius: 0.75rem;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 1rem; /* 16px: su iPhone il campo non fa zoom */
  font-weight: 500;
  transition: border-color 160ms ease-out, box-shadow 160ms ease-out;
}

.field textarea { resize: vertical; min-height: 7rem; }

.field input::placeholder,
.field textarea::placeholder { color: color-mix(in srgb, var(--ink) 62%, transparent); }

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--sky) 35%, transparent);
}

.quote__error {
  margin: 0;
  color: #c2261d;
  font-size: 0.95rem;
  font-weight: 600;
}

.quote__submit { align-self: stretch; gap: 0.55rem; margin-top: 0.25rem; }
.quote__submit svg { width: 1.25rem; height: 1.25rem; fill: currentColor; }

.quote__note {
  margin: -0.25rem 0 0;
  font-size: 0.85rem;
  line-height: 1.5;
  color: color-mix(in srgb, var(--ink) 70%, transparent);
  text-align: center;
}

.quote__note a,
.quote__done a { color: var(--accent); font-weight: 700; }

.quote__close:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent);
  outline-offset: 2px;
}

@media (hover: hover) and (pointer: fine) {
  .quote__close:hover { background: #eef4fb; }
}

@media (prefers-reduced-motion: reduce) {
  .quote[open] { animation-name: fade-in; }
}

@media (max-width: 520px) {
  .quote__row { grid-template-columns: 1fr; }
}
.quote .btn { flex: none; }
.quote__form[hidden],
.quote__done[hidden] { display: none; }

/* ---------- AVVISO COOKIE (lo crea cookie.js) ---------- */

.cookie {
  position: fixed;
  z-index: 90; /* sotto lo schermo blu d'apertura */
  left: 50%;
  bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem 1.5rem;
  width: min(100% - 2rem, 46rem);
  padding: 1rem 1rem 1rem 1.5rem;
  border: 1.5px solid color-mix(in srgb, var(--sky) 35%, var(--line));
  border-radius: 1.25rem;
  background: var(--bg);
  color: var(--ink);
  box-shadow: 0 20px 50px rgba(15, 26, 43, 0.18);
  translate: -50% 0;
  animation: cookie-in 450ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
/* nella home compare dopo l'animazione d'ingresso */
.intro .cookie { animation-delay: 2.2s; }

.cookie.is-closing { animation: cookie-out 250ms ease-in both; }

@keyframes cookie-in  { from { opacity: 0; transform: translateY(16px); } }
@keyframes cookie-out { to   { opacity: 0; transform: translateY(16px); } }

.cookie__text {
  flex: 1;
  margin: 0;
  font-size: 0.925rem;
  line-height: 1.5;
}
.cookie__text a { color: var(--accent); font-weight: 700; }

.cookie .cookie__ok { flex: none; padding: 0.75rem 1.4rem; }

@media (max-width: 560px) {
  .cookie { flex-direction: column; align-items: stretch; padding: 1.1rem; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  .cookie, .cookie.is-closing { animation-name: fade-in; }
  .cookie.is-closing { animation-direction: reverse; }
}

/* ---------- PAGINE PRIVACY E COOKIE POLICY ---------- */

.legal {
  max-width: 50rem;
  margin-inline: auto;
  padding: clamp(2.5rem, 6vw, 5rem) clamp(1rem, 3vw, 2.5rem) clamp(3.5rem, 8vw, 6rem);
}

.legal__back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}
.legal__back svg { width: 1.1rem; height: 1.1rem; fill: currentColor; rotate: 180deg; }

.legal__title { margin-bottom: 0.75rem; }

.legal__date {
  margin: 0 0 clamp(2rem, 4vw, 3rem);
  color: color-mix(in srgb, var(--ink) 65%, transparent);
  font-weight: 600;
}

/* riquadro azzurro con il riassunto */
.legal__summary {
  margin: 0 0 2.5rem;
  padding: 1.25rem 1.5rem;
  border: 1.5px solid color-mix(in srgb, var(--sky) 30%, var(--line));
  border-radius: 1.25rem;
  background: color-mix(in srgb, var(--sky) 12%, var(--bg));
  font-size: 1.05rem;
  line-height: 1.6;
}

.legal h2 {
  margin: 2.25rem 0 0.75rem;
  font-size: clamp(1.2rem, 2vw, 1.45rem);
  font-weight: 800;
  letter-spacing: -0.015em;
}

.legal p,
.legal li {
  line-height: 1.7;
  color: color-mix(in srgb, var(--ink) 82%, transparent);
}
.legal p { margin: 0 0 1rem; }
.legal ul { margin: 0 0 1rem; padding-left: 1.25rem; }
.legal li { margin-bottom: 0.35rem; }
.legal a:not(.legal__back) { color: var(--accent); font-weight: 600; overflow-wrap: anywhere; }

.legal__back:focus-visible,
.legal a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent);
  outline-offset: 3px;
  border-radius: 4px;
}
