/* Font ospitati sul sito (nessuna richiesta ai server Google) */
@font-face { font-family: "Figtree"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/figtree-400.woff2") format("woff2"); }
@font-face { font-family: "Figtree"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/figtree-500.woff2") format("woff2"); }
@font-face { font-family: "Figtree"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/figtree-600.woff2") format("woff2"); }
@font-face { font-family: "Figtree"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/figtree-700.woff2") format("woff2"); }

:root {
  --navy: #0f2550;
  --navy-footer: #0f2a52;
  --text: #1c2b4a;
  --muted: #4d5b78;
  --muted-2: #8a94a8;
  --blue: #1f6fe5;
  --blue-soft: #e2edfc;
  --card: rgba(255, 255, 255, 0.82);
  --container: 1180px;
  --header-h: 72px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }
body {
  margin: 0;
  font-family: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--text);
  background: #f6f9fd;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, p { margin: 0; }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 40px;
}

/* ---------- Elementi comuni ---------- */
.eyebrow {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #4a5670;
}
.eyebrow--muted { color: var(--muted-2); font-size: 13px; }
.rule {
  display: block;
  width: 40px;
  height: 2px;
  background: var(--blue);
  border-radius: 2px;
  margin: 14px 0 18px;
}
.rule--center { margin-left: auto; margin-right: auto; }
.section-title {
  font-size: clamp(30px, 3.6vw, 46px);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--navy);
}

/* ---------- Header ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #fff;
  border-bottom: 1px solid rgba(15, 37, 80, 0.06);
}
.header__inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { display: flex; flex-direction: column; line-height: 1.15; }
.brand__name { font-size: 21px; font-weight: 700; color: var(--navy); letter-spacing: -0.01em; }
.brand__role { font-size: 15px; color: var(--muted); }

.nav { display: flex; gap: 56px; }
.nav__link {
  position: relative;
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
  padding: 8px 0;
  transition: color .2s;
}
.nav__link::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  border-radius: 2px;
  background: var(--blue);
  transform: scaleX(0);
  transition: transform .25s ease;
}
.nav__link:hover { color: var(--blue); }
.nav__link.is-active::after { transform: scaleX(1); }

.nav-toggle { display: none; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 640px;
  display: flex;
  align-items: center;
  background: #eaf2fb;
  overflow: hidden;
}
.hero__bg {
  position: absolute;
  inset: 0;
  background: url("img/hero.jpg") right center / cover no-repeat;
}
.hero::before {
  z-index: 1;
  /* velatura bianco-azzurra a sinistra, come nel riferimento */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(240,246,253,.92) 0%, rgba(240,246,253,.75) 30%, rgba(240,246,253,0) 52%);
  pointer-events: none;
}
.hero__content { position: relative; z-index: 2; padding-top: 72px; padding-bottom: 96px; }
.hero__title {
  margin-top: 22px;
  max-width: 600px;
  font-size: clamp(36px, 4.2vw, 54px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--navy);
}
.hero__text {
  margin-top: 22px;
  max-width: 520px;
  font-size: 19px;
  line-height: 1.6;
  color: var(--muted);
}

/* ---------- Ecografia ---------- */
.eco {
  background: #f7fafe url("img/ecografia-bg.jpg") center / cover no-repeat;
  padding: 72px 0 88px;
}
.eco__head { text-align: center; max-width: 820px; margin: 0 auto; }
.eco__head .eyebrow { color: #4a5670; }
.section-sub {
  margin-top: 14px;
  font-size: 19px;
  line-height: 1.55;
  color: var(--muted);
}
.eco__grid {
  margin-top: 44px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 48px;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}
.checklist li {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 52px;
  padding: 6px 0 6px 74px;
  font-size: 18px;
  line-height: 1.35;
  color: var(--text);
}
.checklist li::before {
  /* cerchio azzurro */
  content: "";
  position: absolute;
  left: 0; top: 50%;
  width: 46px; height: 46px;
  margin-top: -23px;
  border-radius: 50%;
  background: var(--blue-soft);
}
.checklist li::after {
  /* spunta blu */
  content: "";
  position: absolute;
  left: 13px; top: 50%;
  width: 20px; height: 20px;
  margin-top: -10px;
  background: var(--blue);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12.5l5 5L20 6.5'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12.5l5 5L20 6.5'/%3E%3C/svg%3E") center / contain no-repeat;
}
/* voci su due righe: il cerchio si allinea alla prima riga */
.checklist li { align-items: flex-start; padding-top: 14px; padding-bottom: 8px; }
.checklist li::before { top: 4px; margin-top: 0; }
.checklist li::after { top: 17px; margin-top: 0; }

/* ---------- Contatti ---------- */
.contact {
  position: relative;
  background: #eef4fb url("img/contatti-bg.jpg") right center / cover no-repeat;
  padding: 80px 0 64px;
}
.contact::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(234,242,252,.9) 0%, rgba(234,242,252,.6) 35%, rgba(234,242,252,0) 58%);
  pointer-events: none;
}
.contact__content { position: relative; max-width: 560px; }
.contact__content .section-title { margin-top: 6px; }
.contact__text {
  margin-top: 14px;
  font-size: 19px;
  line-height: 1.55;
  color: var(--text);
}
.card {
  display: flex;
  align-items: center;
  margin-top: 18px;
  padding: 16px 24px 16px 28px;
  min-height: 110px;
  background: var(--card);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(15, 37, 80, .04);
  -webkit-backdrop-filter: blur(4px);
          backdrop-filter: blur(4px);
  transition: transform .2s ease, box-shadow .2s ease;
}
.card:first-of-type { margin-top: 22px; }
.card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(15, 37, 80, .08); }
.card__icon {
  flex: none;
  width: 84px; height: 84px;
  border-radius: 50%;
  background: var(--blue-soft);
  color: var(--blue);
  display: grid;
  place-items: center;
}
.card__icon svg { width: 36px; height: 36px; }
.card__body {
  display: flex;
  flex-direction: column;
  margin-left: 32px;
  padding-left: 32px;
  border-left: 1px solid rgba(15, 37, 80, .12);
  min-height: 74px;
  justify-content: center;
}
.card__label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #4a5670;
}
.card__value {
  margin-top: 4px;
  font-size: 20px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--navy);
}

/* Tasto nell'hero */
.hero__actions { margin-top: 30px; }

/* ---------- Tasti azione ---------- */
.actions { display: flex; gap: 14px; margin-top: 24px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 54px;
  padding: 0 26px;
  border-radius: 999px;
  font-size: 17px;
  font-weight: 600;
  transition: background-color .2s ease, color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.btn svg { width: 20px; height: 20px; flex: none; }
.btn--primary {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 6px 18px rgba(31, 111, 229, .28);
}
.btn--primary:hover { background: #185fc8; transform: translateY(-1px); }
.btn--secondary {
  background: rgba(255, 255, 255, .9);
  color: var(--navy);
  border: 1.5px solid rgba(31, 111, 229, .35);
}
.btn--secondary:hover { border-color: var(--blue); color: var(--blue); transform: translateY(-1px); }

/* ---------- Footer ---------- */
.footer {
  background: var(--navy-footer);
  color: #fff;
  padding: 34px 0 40px;
}
.footer__inner { display: flex; justify-content: space-between; align-items: center; gap: 24px; }
.footer__brand { display: flex; flex-direction: column; line-height: 1.3; }
.footer__name { font-size: 22px; font-weight: 700; }
.footer__role { font-size: 18px; opacity: .9; }
.footer__right { text-align: right; }
.footer__nav { display: flex; justify-content: flex-end; gap: 44px; font-size: 16px; font-weight: 500; }
.footer__nav a:hover { text-decoration: underline; text-underline-offset: 4px; }
.footer__copy { margin-top: 18px; font-size: 15px; opacity: .92; }

.footer__legal {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, .15);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px 24px;
  flex-wrap: wrap;
  font-size: 13px;
  opacity: .85;
}
.footer__legal p { margin: 0; line-height: 1.5; }
.footer__legal a:hover { text-decoration: underline; text-underline-offset: 3px; }
.footer__legal nav { display: flex; gap: 20px; }

/* ---------- Pagine legali ---------- */
.legal { padding: 56px 0 80px; }
.legal__box { max-width: 760px; margin: 0 auto; }
.legal__back { display: inline-flex; align-items: center; min-height: 44px; color: var(--blue); font-weight: 600; }
.legal h1 { font-size: clamp(30px, 4vw, 40px); color: var(--navy); letter-spacing: -0.02em; margin: 12px 0 6px; }
.legal .legal__sub { color: var(--muted); font-size: 15px; margin-bottom: 32px; }
.legal h2 { font-size: 20px; color: var(--navy); margin: 32px 0 10px; }
.legal p, .legal li { font-size: 17px; line-height: 1.7; color: var(--text); }
.legal p + p { margin-top: 12px; }
.legal ul { list-style: disc; padding-left: 22px; margin-top: 10px; }
.legal a { color: var(--blue); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Focus accessibile ---------- */
a:focus-visible, button:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; border-radius: 4px; }

/* ---------- Tablet ---------- */
@media (max-width: 960px) {
  .nav { gap: 32px; }
  .eco__grid { gap: 0 28px; }
  .checklist li { font-size: 17px; }
}

/* ---------- Mobile ---------- */
@media (max-width: 760px) {
  :root { --header-h: 64px; }
  .container { padding: 0 20px; }
  .brand__name { font-size: 18px; }
  .brand__role { font-size: 14px; }

  .nav-toggle {
    display: flex; flex-direction: column; justify-content: center; gap: 5px;
    width: 44px; height: 44px; padding: 10px;
    background: none; border: 0; cursor: pointer;
  }
  .nav-toggle span { display: block; height: 2px; background: var(--navy); border-radius: 2px; }
  .nav-toggle span { transition: transform .3s ease, opacity .2s ease; transform-origin: center; }
  .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); }
  .nav {
    position: absolute; top: var(--header-h); left: 0; right: 0;
    display: flex;
    flex-direction: column; gap: 0;
    background: #fff;
    border-bottom: 1px solid rgba(15, 37, 80, .08);
    box-shadow: 0 12px 24px rgba(15, 37, 80, .08);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity .25s ease, transform .25s ease, visibility 0s linear .25s;
  }
  .nav.is-open {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity .25s ease, transform .25s ease, visibility 0s;
  }
  .nav__link { padding: 16px 20px; border-top: 1px solid rgba(15, 37, 80, .06); }
  .nav__link::after { display: none; }
  .nav__link.is-active { color: var(--blue); }

  .hero {
    min-height: 0;
    flex-direction: column;
    align-items: stretch;
    background: #eef4fb;
  }
  .hero::before { display: none; }
  .hero__bg {
    /* foto verticale dedicata, in alto su mobile */
    position: relative;
    inset: auto;
    height: min(88vw, 380px);
    background-image: url("img/hero-mobile.jpg");
    background-position: center 80%; /* sonda sul paziente + ecografo */
  }
  .hero__bg::after {
    /* sfumatura morbida verso il colore della sezione */
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 28px;
    background: linear-gradient(to bottom, rgba(238,244,251,0), #eef4fb);
  }
  .hero__content { padding-top: 32px; padding-bottom: 48px; }
  .hero__title { font-size: 32px; margin-top: 18px; }
  .hero__text { font-size: 17px; }

  .eco { padding: 56px 0 56px; }
  .section-title { font-size: 30px; }
  .section-sub { font-size: 17px; }
  .eco__grid { grid-template-columns: 1fr; margin-top: 32px; }
  .checklist li { font-size: 16.5px; padding-left: 62px; }
  .checklist li::before { width: 42px; height: 42px; }
  .checklist li::after { left: 11px; top: 15px; }

  .contact { background: #eef4fb; padding: 56px 0 0; }
  .contact::before { display: none; }
  .contact::after {
    /* foto verticale dedicata, sfumata in alto nel colore della sezione */
    content: "";
    display: block;
    height: min(66vw, 270px);
    margin-top: 8px;
    background:
      linear-gradient(to bottom, #eef4fb 0%, rgba(238,244,251,0) 25%),
      url("img/contatti-mobile.jpg") center 68% / cover no-repeat;
  }
  .contact__text { font-size: 17px; }
  .card { padding: 14px 16px; min-height: 92px; }
  .card__icon { width: 60px; height: 60px; }
  .card__icon svg { width: 28px; height: 28px; }
  .card__body { margin-left: 16px; padding-left: 16px; min-height: 60px; }
  .card__value { font-size: 17px; }
  .actions { flex-direction: column; gap: 12px; }
  .btn { width: 100%; min-height: 56px; }

  .footer__inner { flex-direction: column; align-items: flex-start; }
  .footer__right { text-align: left; }
  .footer__nav { justify-content: flex-start; gap: 28px; }
}

/* ---------- Animazioni (leggere) ---------- */
.header { transition: box-shadow .3s ease; }
.header.is-scrolled { box-shadow: 0 4px 18px rgba(15, 37, 80, .07); }

/* Hero: immagine con zoom-out lento, testi che salgono in sequenza */
@keyframes heroZoom { from { transform: scale(1.06); } to { transform: scale(1); } }
@keyframes fadeUp   { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes growLine { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.hero__bg { animation: heroZoom 2.4s cubic-bezier(.2, .7, .2, 1) both; }
.intro { animation: fadeUp .8s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(.15s + var(--d, 0) * .12s); }
.intro--line { transform-origin: left; animation-name: growLine; }

/* Comparsa allo scroll (attiva solo se JS è caricato) */
.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .2, 1);
  transition-delay: calc(var(--d, 0) * 60ms);
}
.js .reveal.is-visible { opacity: 1; transform: none; }
.js .reveal--line { transform: scaleX(0); }
.js .reveal--line.is-visible { transform: scaleX(1); }

/* Le card mantengono il loro hover dopo la comparsa */
.js .card.reveal.is-visible:hover { transform: translateY(-2px); transition-delay: 0s; }

/* Spunte: piccolo "pop" del cerchio quando la voce compare */
.js .checklist li.reveal::before { transform: scale(.6); transition: transform .5s cubic-bezier(.3, 1.5, .5, 1); transition-delay: inherit; }
.js .checklist li.reveal.is-visible::before { transform: scale(1); }

/* Su mobile animazioni più brevi e ritardi ridotti */
@media (max-width: 760px) {
  .hero__bg { animation-duration: 1.8s; }
  .js .reveal { transform: translateY(12px); transition-duration: .55s; transition-delay: calc(var(--d, 0) * 30ms); }
  .js .reveal--line { transform: scaleX(0); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal, .js .reveal--line, .js .checklist li.reveal::before { opacity: 1; transform: none; }
}

/* Pagine legali: footer con sola riga legale */
.footer > .footer__legal:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
@media (max-width: 760px) {
  .footer__legal { flex-direction: column; align-items: flex-start; }
}
