/* ==========================================================================
   Dott. Giuseppe Napolitano — studio site
   Palette derived from the logo (deep navy → azure → ice blue)
   ========================================================================== */

:root {
  /* Brand palette (from logo) */
  --navy-900: #06213f;
  --navy-800: #0a2b4f;
  --navy-700: #0e3866;
  --navy-600: #14507f;
  --azure-500: #1e73ad;
  --azure-400: #2f8fce;
  --azure-300: #56aee1;
  --azure-200: #9ccfec;
  --azure-100: #dceefb;
  --ice: #f4f9fd;

  /* Neutrals */
  --text: #16293f;
  --text-soft: #4d6480;
  --line: #e2ebf3;
  --white: #ffffff;

  /* Type */
  --font-head: "Montserrat", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Source Sans 3", "Segoe UI", Arial, sans-serif;

  /* Layout */
  --container: 1180px;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 2px 10px rgba(10, 43, 79, .07);
  --shadow-md: 0 14px 40px rgba(10, 43, 79, .12);
  --header-h: 78px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-head);
  color: var(--navy-800);
  line-height: 1.2;
  margin: 0 0 .5em;
  letter-spacing: .01em;
}

h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); font-weight: 600; }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.35rem); font-weight: 600; }
h3 { font-size: 1.12rem; font-weight: 600; }

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

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

a { color: var(--azure-500); text-decoration: none; }
a:hover { color: var(--navy-600); }

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

:focus-visible {
  outline: 3px solid var(--azure-400);
  outline-offset: 3px;
  border-radius: 4px;
}

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--navy-800);
  color: #fff;
  padding: 10px 16px;
  border-radius: 0 0 8px 0;
  z-index: 200;
}
.skip-link:focus { left: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--font-head);
  font-size: .93rem;
  font-weight: 600;
  letter-spacing: .04em;
  padding: 14px 26px;
  border-radius: 999px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform .18s ease, background .18s ease, color .18s ease, box-shadow .18s ease;
  text-align: center;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: linear-gradient(120deg, var(--azure-500), var(--navy-600));
  color: #fff;
  box-shadow: 0 8px 22px rgba(20, 80, 127, .25);
}
.btn-primary:hover { color: #fff; box-shadow: 0 12px 28px rgba(20, 80, 127, .32); }

.btn-ghost {
  background: transparent;
  border-color: var(--azure-300);
  color: var(--navy-700);
}
.btn-ghost:hover { background: var(--azure-100); color: var(--navy-800); }

.btn-light { background: #fff; color: var(--navy-800); }
.btn-light:hover { color: var(--navy-900); box-shadow: var(--shadow-md); }

.btn-outline {
  background: transparent;
  border-color: rgba(255, 255, 255, .65);
  color: #fff;
}
.btn-outline:hover { background: rgba(255, 255, 255, .12); color: #fff; }

.btn-nav {
  padding: 10px 20px;
  background: linear-gradient(120deg, var(--azure-500), var(--navy-600));
  color: #fff !important;
}
.btn-nav:hover { color: #fff !important; }

.btn-block { display: block; width: 100%; }
.btn-small { padding: 9px 18px; font-size: .85rem; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, .93);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: var(--header-h);
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  flex: 0 0 auto;
  height: 42px;
  width: auto;
  object-fit: contain;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-name {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.02rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--navy-800);
}
.brand-role {
  font-size: .78rem;
  letter-spacing: .06em;
  color: var(--azure-500);
  text-transform: uppercase;
}

.main-nav ul { display: flex; align-items: center; gap: 6px; }
.main-nav a {
  display: block;
  font-family: var(--font-head);
  font-size: .9rem;
  font-weight: 500;
  letter-spacing: .05em;
  color: var(--navy-700);
  padding: 10px 14px;
  border-radius: 999px;
  transition: background .18s ease, color .18s ease;
}
.main-nav a:hover { background: var(--ice); color: var(--navy-800) !important; }
.main-nav a.is-active { background: var(--azure-100); color: var(--navy-800); }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 46px; height: 46px;
  background: transparent;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  padding: 0;
}
.nav-toggle span {
  display: block;
  width: 22px; height: 2px;
  margin-inline: auto;
  background: var(--navy-800);
  transition: transform .25s ease, opacity .2s 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 {
  background:
    radial-gradient(1000px 520px at 88% -12%, var(--azure-100), transparent 70%),
    linear-gradient(180deg, var(--ice), #fff 70%);
  border-bottom: 1px solid var(--line);
  padding: clamp(48px, 7vw, 92px) 0 clamp(44px, 6vw, 80px);
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(280px, 420px) 1fr;
  align-items: center;
  gap: clamp(28px, 5vw, 64px);
}

.hero-media {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: clamp(18px, 3vw, 34px);
  box-shadow: var(--shadow-md);
}
.hero-logo { width: 100%; height: auto; }

.eyebrow {
  font-family: var(--font-head);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--azure-500);
  margin-bottom: 10px;
}

.hero-sub {
  font-family: var(--font-head);
  font-size: clamp(1rem, 1.7vw, 1.25rem);
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--azure-500);
  margin-bottom: 4px;
}

.hero .sep { color: var(--azure-300); padding-inline: 6px; }

.ecg {
  width: min(420px, 100%);
  height: 40px;
  margin: 14px 0 18px;
  fill: none;
  stroke: var(--azure-400);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tagline {
  font-family: var(--font-head);
  font-size: clamp(1.05rem, 2vw, 1.45rem);
  font-weight: 300;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--navy-700);
  line-height: 1.45;
  margin-bottom: 22px;
}

.hero-values {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-bottom: 28px;
}
.hero-values li {
  font-family: var(--font-head);
  font-size: .8rem;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--navy-600);
  padding-left: 18px;
  position: relative;
}
.hero-values li::before {
  content: "";
  position: absolute;
  left: 0; top: 9px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--azure-400);
}

.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }

.hero-free {
  display: inline-block;
  background: var(--azure-100);
  border: 1px solid var(--azure-200);
  color: var(--navy-700);
  border-radius: 999px;
  padding: 10px 20px;
  font-size: .95rem;
}

/* ---------- Values strip ---------- */
.values {
  padding: clamp(44px, 6vw, 72px) 0;
  background: #fff;
}
.values-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(20px, 3vw, 34px);
}
/* `.value` è ora limitato alla striscia dei valori: prima collideva
   con le voci della lista recapiti e aggiungeva un border-top inatteso */
.values-grid .value {
  border-top: 2px solid var(--azure-200);
  padding-top: 18px;
}
.values-grid .value h3 { letter-spacing: .1em; text-transform: uppercase; font-size: .95rem; }
.values-grid .value p { font-size: .96rem; color: var(--text-soft); }

/* ---------- Sections ---------- */
.section { padding: clamp(52px, 7vw, 96px) 0; }

.section-head { max-width: 760px; margin-bottom: clamp(28px, 4vw, 44px); }
.section-lead { color: var(--text-soft); font-size: 1.05rem; }

.note {
  margin-top: 30px;
  font-size: .88rem;
  color: var(--text-soft);
  font-style: italic;
}

/* ---------- Services ---------- */
#servizi { background: var(--ice); }

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}

.service {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 24px 26px;
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.service:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--azure-200);
}
.service h3 {
  font-size: 1.02rem;
  letter-spacing: .04em;
  color: var(--navy-700);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--azure-100);
  margin-bottom: 12px;
}
.service p { font-size: .95rem; color: var(--text-soft); margin: 0; }

/* ---------- Emergency / guardia medica ---------- */
.emergency {
  background:
    radial-gradient(900px 460px at 12% 110%, rgba(47, 143, 206, .28), transparent 70%),
    linear-gradient(135deg, var(--navy-900), var(--navy-700) 55%, var(--azure-500));
  color: #eaf4fb;
}
.emergency .eyebrow { color: var(--azure-200); }
.emergency h2 { color: #fff; }
.emergency .section-lead { color: #cfe3f3; max-width: 720px; }
.emergency strong { color: #fff; }

.emergency-inner { max-width: 860px; }

.checklist { margin: 0 0 26px; display: grid; gap: 10px; }
.checklist li {
  position: relative;
  padding-left: 30px;
  color: #dcecf8;
  font-size: .98rem;
}
.checklist li::before {
  content: "\2713";
  position: absolute;
  left: 0; top: 0;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--azure-500);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
}

.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.emergency .note { color: #b9d5e8; }

/* ---------- Steps ---------- */
.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(18px, 2.5vw, 28px);
  list-style: none;   /* numerazione di default disattivata: si usano i .step-num */
}
.step {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 22px 24px;
  position: relative;
  box-shadow: var(--shadow-sm);
}
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px; height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--azure-400), var(--navy-600));
  color: #fff;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.05rem;
  margin-bottom: 14px;
}
.step h3 { font-size: 1rem; letter-spacing: .04em; }
.step p { font-size: .94rem; color: var(--text-soft); }

/* ---------- Contacts ---------- */
.contacts { background: var(--ice); }

.contacts-grid {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 22px;
  align-items: start;
}

.contact-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px;
  box-shadow: var(--shadow-sm);
}
.contact-card h3 { letter-spacing: .1em; text-transform: uppercase; font-size: .95rem; }

.contact-list { display: grid; gap: 18px; list-style: none; }
.contact-list li { padding-bottom: 16px; border-bottom: 1px solid var(--azure-100); }
.contact-list li:last-child { border-bottom: 0; padding-bottom: 0; }

/* nessuna decorazione sui recapiti: niente underline/line-through da :visited */
.contact-list a,
.contact-list a:link,
.contact-list a:visited,
.contact-list a:hover,
.contact-list a:active { text-decoration: none; }
.contact-list .detail {
  font-size: 1rem;
  color: var(--navy-800);
  font-weight: 500;
  text-decoration: none;
}
.contact-list .detail.big {
  font-family: var(--font-head);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: .03em;
  color: var(--navy-700);
}
.contact-list .label {
  display: block;
  font-family: var(--font-head);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--azure-500);
  margin-bottom: 4px;
}
.contact-list a.detail:hover { color: var(--azure-500); }

.cta-card {
  background: linear-gradient(150deg, var(--navy-800), var(--navy-600));
  border-color: var(--navy-600);
  color: #e8f2fa;
}
.cta-card h3 { color: #fff; }
.cta-card p { color: #c8dded; font-size: .97rem; }
.small-note { font-size: .85rem; color: var(--text-soft); margin-top: 14px; }
.cta-card .small-note { color: #a9c8de; }

.map-card {
  grid-column: 1 / -1;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.map-card iframe {
  width: 100%;
  height: 340px;
  border: 0;
  display: block;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--navy-900);
  color: #b9cee1;
  padding: clamp(34px, 5vw, 54px) 0 28px;
}
.footer-inner {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 26px 40px;
  align-items: start;
}
.footer-brand { display: flex; align-items: center; gap: 14px; }
.footer-brand strong {
  display: block;
  font-family: var(--font-head);
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #fff;
  font-size: .95rem;
}
.footer-brand span { font-size: .86rem; color: #9bb8ce; }
/* chip chiara: il monogramma navy sarebbe invisibile sul footer #06213f.
   Alternativa più pulita: fornire assets/logo-mark-white.png e usare
   .footer-brand .brand-mark { background: none; padding: 0; } */
.footer-brand .brand-mark {
  height: 44px;
  background: #fff;
  padding: 6px 9px;
  border-radius: 10px;
}

.footer-nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.footer-nav a {
  color: #cfe0ee;
  font-family: var(--font-head);
  font-size: .86rem;
  letter-spacing: .06em;
}
.footer-nav a:hover { color: #fff; }

.footer-legal { grid-column: 1 / -1; border-top: 1px solid rgba(255, 255, 255, .12); padding-top: 18px; }
/* footer ridotto della pagina privacy: un solo blocco, niente linea sopra */
.site-footer .footer-legal:only-child { border-top: 0; padding-top: 0; }
.footer-legal p { font-size: .84rem; color: #93aebf; margin-bottom: 6px; }
.footer-legal a { color: #cfe0ee; text-decoration: underline; }
.footer-legal .small { font-size: .8rem; }

/* ---------- Back to top ---------- */
.to-top {
  position: fixed;
  right: 22px; bottom: 22px;
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 0;
  background: linear-gradient(135deg, var(--azure-500), var(--navy-700));
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity .25s ease, transform .25s ease, visibility .25s;
  z-index: 90;
  box-shadow: var(--shadow-md);
}
.to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }

/* ---------- Cookie bar ---------- */
.cookie-bar {
  position: fixed;
  left: 50%; bottom: 22px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 18px;
  max-width: min(760px, calc(100% - 40px));
  background: var(--navy-900);
  color: #d9e8f3;
  border-radius: var(--radius);
  padding: 16px 22px;
  box-shadow: var(--shadow-md);
  z-index: 120;
}
/* classe dedicata: deve vincere su display:flex, altrimenti la barra non sparisce mai */
.cookie-bar.is-hidden { display: none; }

.cookie-bar p { margin: 0; font-size: .9rem; }
.cookie-bar a { color: var(--azure-200); text-decoration: underline; }

/* ---------- Modal ---------- */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(6, 33, 63, .72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 150;
}
.modal[hidden] { display: none; }
.modal-box {
  position: relative;
  background: #fff;
  max-width: 640px;
  border-radius: var(--radius);
  padding: 34px 32px 30px;
  box-shadow: var(--shadow-md);
  max-height: 84vh;
  overflow: auto;
}
.modal-box h2 { font-size: 1.4rem; }
.modal-box p { font-size: .95rem; color: var(--text-soft); }
.modal-close {
  position: absolute;
  top: 12px; right: 14px;
  width: 36px; height: 36px;
  border: 0;
  background: transparent;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--navy-700);
  cursor: pointer;
  border-radius: 50%;
}
.modal-close:hover { background: var(--ice); }
.modal-actions { margin-top: 16px; }

/* ---------- Reveal animation ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .6s ease, transform .6s ease;
}
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Policy page (privacy.html) ---------- */
.policy { max-width: 820px; }
.policy h1 { font-size: clamp(1.8rem, 3.6vw, 2.4rem); margin-bottom: 14px; }
.policy h2 {
  font-size: 1.18rem;
  margin-top: 30px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--azure-100);
}
.policy h3 { font-size: 1rem; margin-top: 20px; color: var(--navy-600); }
.policy p { font-size: .98rem; color: var(--text); }
.policy ul { display: grid; gap: 8px; margin: 12px 0 18px; }
.policy ul li {
  position: relative;
  padding-left: 24px;
  font-size: .96rem;
  color: var(--text-soft);
}
.policy ul li::before {
  content: "";
  position: absolute;
  left: 0; top: 9px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--azure-300);
}
.policy a { word-break: break-word; }
.policy-meta { font-size: .9rem; color: var(--text-soft); font-style: italic; }

.policy-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .values-grid { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-media { max-width: 420px; }
  .contacts-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
}

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

  .main-nav {
    position: absolute;
    top: var(--header-h);
    left: 0; right: 0;
    background: #fff;
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md);
    padding: 14px 24px 22px;
    display: none;
  }
  .main-nav.is-open { display: block; }
  .main-nav ul { flex-direction: column; align-items: stretch; gap: 4px; }
  .main-nav a { padding: 13px 14px; border-radius: 10px; }
  .main-nav .btn-nav { margin-top: 10px; text-align: center; }

  body.nav-locked { overflow: hidden; }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .values-grid, .steps { grid-template-columns: 1fr; }
  .brand-role { display: none; }
  .contact-card { padding: 24px 20px; }
  .contact-list .detail.big { font-size: 1.3rem; }
  .map-card iframe { height: 260px; }
  .cookie-bar { flex-direction: column; align-items: stretch; text-align: center; }
  .btn { padding: 13px 22px; }
  .hero-cta .btn { flex: 1 1 auto; }
}

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

@media print {
  .site-header, .to-top, .cookie-bar, .modal { display: none !important; }
  .section, .hero { padding: 12px 0; }
  body { color: #000; }
}
