/* =========================================================================
   Centro Servizi Doganali - foglio di stile
   Raggi: pulsanti a pillola, card 16px, input 10px, immagini 20px.
   Z-index: header 50, menu mobile 40, skip-link 60.
   ========================================================================= */

@font-face { font-family: "Avenir Next"; src: url("../fonts/avenirnextltpro-regular-webfont.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Avenir Next"; src: url("../fonts/avenirnextltpro-medium-webfont.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Avenir Next"; src: url("../fonts/avenirnextltpro-demibold-webfont.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Avenir Next"; src: url("../fonts/avenirnextltpro-bold-webfont.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Avenir Next"; src: url("../fonts/avenirnextltpro-heavy-webfont.woff2") format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Smaragd"; src: url("../fonts/SmaragdRegular.woff") format("woff"); font-display: swap; }

:root {
  --brand: #fd7631;          /* arancio CSD */
  --brand-strong: #e85f1b;
  --brand-ink: #b84a12;      /* arancio leggibile come testo su chiaro */
  --brand-soft: #fff0e7;
  --bg: #f7f7f6;
  --surface: #ffffff;
  --surface-2: #efeeec;
  --media-bg: #f1f0ee;
  --ink: #161a21;
  --ink-2: #2b313b;
  --muted: #5a616c;
  --line: #e1e0dd;
  --on-brand: #161a21;
  --shadow: 0 1px 2px rgb(22 26 33 / .05), 0 12px 32px -12px rgb(22 26 33 / .14);
  --shadow-lg: 0 2px 4px rgb(22 26 33 / .05), 0 28px 60px -20px rgb(22 26 33 / .24);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-img: 20px;
  --wrap: 1240px;
  --gutter: clamp(16px, 4vw, 40px);
  --header-h: 72px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  color-scheme: light;
}


/* ---------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--header-h) + 16px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "Avenir Next", "Avenir", "Segoe UI", system-ui, sans-serif;
  font-size: 17px; line-height: 1.65; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
h1, h2, h3 { line-height: 1.12; letter-spacing: -.02em; font-weight: 700; margin: 0 0 .5em; text-wrap: balance; }
h1 { font-size: clamp(2.1rem, 4.4vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 2.8vw, 2.35rem); }
h3 { font-size: 1.2rem; letter-spacing: -.01em; }
p { margin: 0 0 1em; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; list-style: none; }
figure { margin: 0; }
/* icone SVG inline: prendono dimensione e colore dal testo, come il vecchio font */
.ph { display: inline-flex; width: 1em; height: 1em; line-height: 1; flex-shrink: 0; vertical-align: -0.125em; }
.ph svg { width: 100%; height: 100%; display: block; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 4px; }
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }

.skip-link { position: absolute; left: 16px; top: -60px; z-index: 60; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: var(--radius-sm); transition: top .2s; }
.skip-link:focus { top: 12px; }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em; white-space: nowrap;
  font: inherit; font-weight: 600; font-size: .95rem; line-height: 1; padding: .85em 1.4em; border-radius: 999px;
  border: 1.5px solid transparent; cursor: pointer; text-decoration: none;
  transition: background-color .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease), transform .2s var(--ease), box-shadow .25s var(--ease);
}
.btn:active { transform: translateY(1px) scale(.98); }
.btn-lg { font-size: 1rem; padding: 1em 1.7em; }
.btn-primary { background: var(--brand); color: var(--on-brand); box-shadow: 0 8px 20px -10px rgb(253 118 49 / .8); }
.btn-primary:hover { background: var(--brand-strong); }
.btn-ghost { color: #fff; border-color: rgb(255 255 255 / .45); background: rgb(255 255 255 / .06); }
.btn-ghost:hover { background: rgb(255 255 255 / .16); border-color: #fff; }
.btn-outline { color: var(--ink); border-color: var(--line); background: var(--surface); }
.btn-outline:hover { border-color: var(--ink); }

.text-link, .tile-link {
  display: inline-flex; align-items: center; gap: .45em; font-weight: 600; color: var(--brand-ink); text-decoration: none;
}
.text-link i, .tile-link i { transition: transform .3s var(--ease); }
.text-link:hover i, a:hover .tile-link i { transform: translateX(4px); }

/* ---------------------------------------------------------------- header */
.site-header {
  position: sticky; top: 0; z-index: 50; height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent; transition: border-color .3s, box-shadow .3s;
}
.site-header.is-scrolled { border-bottom-color: var(--line); box-shadow: 0 6px 24px -18px rgb(22 26 33 / .4); }
.header-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; flex-shrink: 0; }
.brand img { width: 44px; height: 44px; }
.brand-word { display: flex; flex-direction: column; font-family: "Smaragd", "Avenir Next", serif; font-size: 1.02rem; line-height: 1.02; letter-spacing: .06em; text-transform: uppercase; color: var(--ink); }

.nav { display: flex; align-items: center; gap: 28px; }
.nav-list { display: flex; align-items: center; gap: 4px; }
.nav-item { position: relative; display: flex; align-items: center; }
.nav-link { display: block; padding: 10px 12px; font-weight: 500; font-size: .97rem; text-decoration: none; color: var(--ink-2); border-radius: 8px; transition: color .2s; }
.nav-link:hover, .nav-item.is-active > .nav-link, .nav-link[aria-current="page"] { color: var(--brand-ink); }
.nav-item.is-active > .nav-link { box-shadow: inset 0 -2px 0 var(--brand); border-radius: 0; }
.sub-toggle { display: none; }
.has-sub > .nav-link { padding-right: 6px; }
.has-sub > .nav-link::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 8px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: translateY(-3px) rotate(45deg); opacity: .6; }

.sub {
  position: absolute; top: calc(100% + 6px); left: -8px; min-width: 300px; padding: 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden; transform: translateY(6px); transition: opacity .2s var(--ease), transform .25s var(--ease), visibility .2s;
}
.sub::before { content: ""; position: absolute; inset: -12px 0 auto; height: 12px; }
.sub-wide { min-width: 560px; }
/* voci del sottomenu: spazio fisso tra le voci e sfondo hover a tutta altezza della riga */
.sub ul { display: grid; gap: 4px; }
.sub-wide ul { grid-template-columns: 1fr 1fr; gap: 4px 8px; }
.sub li { display: flex; }
.sub a { flex: 1; display: flex; align-items: center; padding: 9px 12px; border-radius: var(--radius-sm); text-decoration: none; font-size: .93rem; line-height: 1.35; color: var(--ink-2); transition: background-color .2s, color .2s; }
.sub a:hover, .sub a[aria-current="page"] { background: var(--brand-soft); color: var(--brand-ink); }
@media (hover: hover) and (min-width: 1081px) {
  .has-sub:hover > .sub, .has-sub:focus-within > .sub { opacity: 1; visibility: visible; transform: none; }
}
.menu-toggle { display: none; }

/* ---------------------------------------------------------------- hero */
.hero { position: relative; isolation: isolate; color: #fff; min-height: min(84dvh, 760px); display: flex; align-items: center; overflow: hidden; background: #12151b; }
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(100deg, rgb(14 17 22 / .92) 0%, rgb(14 17 22 / .72) 48%, rgb(14 17 22 / .35) 100%); }
.hero-inner { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 48px; padding-block: 72px 80px; }
.hero-copy { max-width: 760px; }
.hero-word { font-family: "Smaragd", serif; font-size: clamp(1rem, 1.6vw, 1.25rem); letter-spacing: .14em; text-transform: uppercase; color: var(--brand); margin-bottom: 18px; }
.hero h1 { font-size: clamp(2.2rem, 4.6vw, 3.6rem); font-weight: 700; margin-bottom: 18px; }
.hero-sub { font-size: clamp(1.05rem, 1.5vw, 1.25rem); color: rgb(255 255 255 / .82); margin-bottom: 32px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-side { display: flex; flex-direction: column; align-items: center; gap: 24px; }
.hero-logo { width: clamp(140px, 13vw, 200px); height: auto; filter: drop-shadow(0 10px 30px rgb(0 0 0 / .35)); }
.hero-aeo {
  display: flex; align-items: center; gap: 16px; padding: 16px 22px 16px 16px; border-radius: var(--radius);
  background: rgb(255 255 255 / .08); border: 1px solid rgb(255 255 255 / .16); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .12);
}
.hero-aeo img { width: 72px; height: 72px; background: #fff; border-radius: 12px; padding: 4px; }
.hero-aeo p { margin: 0; display: flex; flex-direction: column; font-size: .9rem; line-height: 1.4; }
.hero-aeo strong { font-weight: 600; }
.hero-aeo span { color: rgb(255 255 255 / .72); font-variant-numeric: tabular-nums; letter-spacing: .02em; }

/* Hero + banner dei numeri in una schermata: il blocco e alto lo schermo meno l'header e l'hero
   prende lo spazio sopra il banner. Altezza "minima": su schermi troppo bassi si allunga invece di tagliare. */
.hero-screen { display: flex; flex-direction: column; min-height: calc(100svh - var(--header-h)); }
.hero-screen .hero { flex: 1; min-height: 0; }
.hero-screen .hero-inner { padding-block: clamp(24px, 7svh, 72px) clamp(28px, 8svh, 80px); gap: clamp(24px, 4svh, 48px); }
.hero-screen .hero h1 { font-size: clamp(2rem, min(4.6vw, 6.4svh), 3.6rem); margin-bottom: clamp(10px, 2svh, 18px); }
.hero-screen .hero-sub { margin-bottom: clamp(18px, 3.5svh, 32px); }
.hero-screen .hero-logo { width: clamp(96px, min(13vw, 19svh), 200px); }
.hero-screen .hero-side { gap: clamp(14px, 2.6svh, 24px); }
.hero-screen .fact { padding-block: clamp(14px, 3svh, 28px) clamp(16px, 3.2svh, 30px); }
/* tablet e finestre medie: hero su due colonne e banner su una riga, cosi entra in una schermata */
@media (min-width: 860px) and (max-width: 1080px) {
  .hero-screen .hero-inner { grid-template-columns: minmax(0, 1fr) auto; align-items: end; padding-block: clamp(20px, 5svh, 56px) clamp(24px, 6svh, 64px); }
  .hero-screen .hero-side { flex-direction: column; }
  .hero-screen .facts-grid { grid-template-columns: repeat(5, 1fr); }
  .hero-screen .facts .facts-grid .fact { grid-column: auto; border-top: 0; padding-left: 16px; border-left: 1px solid var(--line); }
  .hero-screen .facts .facts-grid .fact:first-child { padding-left: 0; border-left: 0; }
  .hero-screen .fact-l { font-size: .82rem; }
}
/* smartphone: banner piu compatto e meno spazio intorno al testo dell'hero */
@media (max-width: 767px) {
  .hero-screen .hero-inner { padding-block: 24px 28px; gap: 20px; }
  .hero-screen .hero-sub { margin-bottom: 18px; }
  .hero-screen .fact { padding-block: 12px 14px; gap: 2px; }
  .hero-screen .fact-n { font-size: 1.4rem; }
  .hero-screen .fact-l { font-size: .8rem; line-height: 1.35; }
}

/* ---------------------------------------------------------------- facts */
.facts { background: var(--surface); border-bottom: 1px solid var(--line); }
.facts-grid { display: grid; grid-template-columns: repeat(5, 1fr); }
.fact { display: flex; flex-direction: column; gap: 4px; padding: 28px 24px 30px 0; }
.facts .fact + .fact { padding-left: 24px; border-left: 1px solid var(--line); }
.fact-n { white-space: nowrap; font-size: clamp(1.5rem, 2.2vw, 2rem); font-weight: 700; letter-spacing: -.02em; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.1; }
.fact-l { font-size: .92rem; color: var(--muted); line-height: 1.45; max-width: 24ch; }

/* ---------------------------------------------------------------- sections */
.section { padding-block: clamp(64px, 9vw, 112px) clamp(72px, 10vw, 124px); }
.section-tight { padding-block: clamp(40px, 5vw, 64px) clamp(64px, 8vw, 104px); }
.section-tint { background: var(--surface-2); }
.section-intro { max-width: 760px; margin-bottom: 48px; }
.section-intro p { font-size: 1.1rem; color: var(--muted); }
.lead { font-size: 1.18rem; line-height: 1.6; color: var(--ink); }

/* bento servizi */
.services-bento { display: grid; grid-template-columns: 1.25fr 1fr; grid-template-rows: auto auto; gap: 20px; }
.tile {
  position: relative; display: flex; flex-direction: column; text-decoration: none; overflow: hidden;
  border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
  transition: transform .4s var(--ease), box-shadow .4s var(--ease);
}
.tile:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.tile-text { padding: 30px 30px 0; position: relative; z-index: 1; }
.tile-text p { color: var(--muted); max-width: 44ch; }
.tile h3 { font-size: 1.5rem; }
.tile img { transition: transform .6s var(--ease); }
.tile:hover img { transform: scale(1.03); }
.tile-dogana { grid-row: span 2; background: linear-gradient(180deg, var(--surface) 0%, var(--brand-soft) 100%); }
.tile-dogana img { margin: auto 24px 24px; width: calc(100% - 48px); }
.tile-intrastat { flex-direction: row; align-items: center; }
.tile-intrastat .tile-text { padding: 30px; flex: 1; }
.tile-intrastat img { width: 38%; max-width: 220px; margin-right: 24px; border-radius: 12px; }
.tile-consulenza { background: var(--ink); border-color: var(--ink); color: #fff; }
.tile-consulenza p { color: rgb(255 255 255 / .72); }
.tile-consulenza .tile-link { color: var(--brand); }
.tile-consulenza img { margin: 18px 22px 22px; width: calc(100% - 44px); background: #fff; border-radius: 12px; padding: 12px; }

/* split */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 88px); align-items: center; }
.split-rev .split-media { order: -1; }
.split-top { align-items: start; }
.split-media img { border-radius: var(--radius-img); width: 100%; box-shadow: var(--shadow-lg); }
.split-media.plain img { box-shadow: none; border-radius: 0; }
.split-text p { color: var(--muted); }
.split-intro .lead { font-size: clamp(1.2rem, 2vw, 1.45rem); line-height: 1.5; }
.mission { margin: 28px 0; padding: 4px 0 4px 20px; border-left: 3px solid var(--brand); font-size: 1.2rem; font-weight: 500; line-height: 1.5; color: var(--ink); }
.pill-links { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.pill-links a { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; font-weight: 500; font-size: .93rem; transition: border-color .2s, color .2s; }
.pill-links a:hover { border-color: var(--brand); color: var(--brand-ink); }
.pill-links i { color: var(--brand-ink); font-size: 1.1em; }

/* persone */
.people-head { margin-bottom: 40px; }
.people-layout { display: grid; grid-template-columns: 1.5fr 1fr; gap: clamp(32px, 5vw, 72px); align-items: start; }
.people-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.people-grid .person:nth-child(2) { margin-top: 48px; }
.person-photo { border-radius: var(--radius-img); overflow: hidden; aspect-ratio: 4 / 5; background: var(--surface-2); }
.person-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.person:hover .person-photo img { transform: scale(1.04); }
.person figcaption { padding-top: 14px; display: flex; flex-direction: column; line-height: 1.35; }
.person strong { font-weight: 600; }
.person span { font-size: .9rem; color: var(--muted); }
.people-text p { color: var(--muted); }
.people-quote { font-size: 1.15rem; font-weight: 500; color: var(--ink) !important; line-height: 1.5; }

/* ---------------------------------------------------------------- page head */
.page-head { padding-block: clamp(40px, 6vw, 72px) clamp(28px, 4vw, 48px); background: var(--surface); border-bottom: 1px solid var(--line); }
.page-head h1 { max-width: 20ch; margin-bottom: 14px; }
.page-lead { font-size: 1.15rem; color: var(--muted); max-width: 66ch; margin: 0; }
.page-sub { font-size: 1.1rem; font-weight: 500; color: var(--brand-ink); margin: -6px 0 14px; }
.kicker { font-weight: 600; color: var(--brand-ink); margin-bottom: 10px; }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 6px; font-size: .88rem; color: var(--muted); margin-bottom: 22px; }
.crumbs li:not(:last-child)::after { content: "/"; margin-left: 6px; opacity: .5; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--brand-ink); text-decoration: underline; }

.service-head { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(28px, 5vw, 72px); align-items: center; }
.service-media { background: var(--media-bg); border-radius: var(--radius-img); padding: clamp(16px, 2.5vw, 28px); display: grid; place-items: center; aspect-ratio: 4 / 3; overflow: hidden; }
.service-media img { width: 100%; height: 100%; object-fit: contain; }
.service-media img[src$=".svg"] { width: 80%; height: 80%; }
/* immagini con sfondo proprio: riempiono tutto il riquadro (si perde solo sfondo vuoto ai bordi) */
.service-media.media-fill { padding: 0; position: relative; }
.service-media.media-fill img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 55%; }

/* ---------------------------------------------------------------- service body */
.service-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: clamp(32px, 5vw, 72px); align-items: start; }
.prose { max-width: 72ch; }
.prose p { color: var(--ink-2); }
.prose .lead { color: var(--ink); }
.prose h2 { margin-top: 1.6em; font-size: clamp(1.4rem, 2.2vw, 1.8rem); }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin-top: 1.4em; }
.prose a { color: var(--brand-ink); }
.checks { display: grid; gap: 10px; margin: 0 0 1.4em; }
.checks-2 { grid-template-columns: 1fr 1fr; gap: 10px 24px; }
.checks li { display: flex; gap: 10px; align-items: flex-start; line-height: 1.5; color: var(--ink-2); }
.checks i { color: var(--brand); font-size: 1.25rem; flex-shrink: 0; margin-top: 1px; }
.warns i { color: var(--brand-ink); }
.defs { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 0 0 1.6em; }
.def { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; }
.def dt { font-weight: 700; margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.def dt i { color: var(--brand); font-size: 1.3rem; }
.def dd { margin: 0; color: var(--muted); font-size: .97rem; line-height: 1.55; }
.defs-stack { grid-template-columns: 1fr; }
.steps { counter-reset: s; display: grid; gap: 0; margin: 8px 0 1.6em; border-left: 2px solid var(--line); }
.steps li { display: flex; gap: 18px; padding: 0 0 22px 0; margin-left: -15px; }
.steps li:last-child { padding-bottom: 0; }
.step-n { flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: var(--on-brand); display: grid; place-items: center; font-weight: 700; font-size: .85rem; }
.steps h3 { margin: 2px 0 4px; font-size: 1.08rem; }
.steps p { margin: 0; color: var(--muted); }
.callout { margin: 1.6em 0 0; padding: 22px 24px; border-radius: var(--radius); background: var(--brand-soft); color: var(--ink) !important; font-weight: 500; line-height: 1.55; border-left: 4px solid var(--brand); }
.aeo-card { display: flex; align-items: center; gap: 20px; margin-top: 1.6em; padding: 20px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
.aeo-card img { width: 80px; height: 80px; background: #fff; border-radius: 12px; padding: 4px; }
.aeo-card p { margin: 0; color: var(--muted); }
.aeo-card .aeo-card-title { font-weight: 700; color: var(--ink); }

.service-aside { position: sticky; top: calc(var(--header-h) + 24px); display: grid; gap: 16px; }
.aside-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.aside-box h2 { font-size: 1.05rem; letter-spacing: -.01em; margin-bottom: 12px; }
.aside-list a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin-inline: -10px; border-radius: var(--radius-sm); text-decoration: none; font-size: .93rem; line-height: 1.35; color: var(--ink-2); transition: background-color .2s, color .2s; }
.aside-list a:hover { background: var(--surface-2); }
.aside-list a[aria-current="page"] { background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; }
.aside-list i { font-size: 1.15rem; color: var(--brand-ink); flex-shrink: 0; }
.aside-contact { background: var(--ink); border-color: var(--ink); color: #fff; }
.aside-contact p { color: rgb(255 255 255 / .72); font-size: .95rem; }
.aside-contact .btn { width: 100%; }
.aside-phone { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 12px; text-decoration: none; font-weight: 600; color: #fff; }

/* ---------------------------------------------------------------- dogana menu */
.svc-rows { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.svc-row a { display: grid; grid-template-rows: auto 1fr; height: 100%; text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: transform .4s var(--ease), box-shadow .4s var(--ease); }
.svc-row a:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.svc-row figure { background: var(--media-bg); aspect-ratio: 16 / 9; display: grid; place-items: center; padding: 20px; overflow: hidden; }
.svc-row figure img { max-height: 100%; width: auto; transition: transform .6s var(--ease); }
.svc-row a:hover figure img { transform: scale(1.04); }
.svc-row div { padding: 24px 26px 26px; display: flex; flex-direction: column; }
.svc-row h2 { font-size: 1.4rem; }
.svc-row p { color: var(--muted); flex: 1; }

/* ---------------------------------------------------------------- consulenza menu */
.banner { background: #fff; border-radius: var(--radius-img); padding: clamp(16px, 3vw, 36px); margin-bottom: 40px; border: 1px solid var(--line); }
.banner img { margin-inline: auto; }
.cons-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.cons-card { display: flex; flex-direction: column; height: 100%; padding: 26px; text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); transition: transform .4s var(--ease), box-shadow .4s var(--ease), border-color .3s; }
.cons-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); }
.cons-icon { width: 48px; height: 48px; border-radius: 12px; background: var(--brand-soft); color: var(--brand-ink); display: grid; place-items: center; font-size: 1.5rem; margin-bottom: 18px; }
.cons-card h2 { font-size: 1.2rem; letter-spacing: -.01em; margin-bottom: 8px; }
.cons-card p { color: var(--muted); font-size: .97rem; flex: 1; }
.cons-grid li:first-child { grid-column: span 2; }
.cons-grid li:first-child .cons-card { background: var(--brand-soft); border-color: transparent; }
.cons-grid li:first-child .cons-icon { background: var(--brand); color: var(--on-brand); }

/* ---------------------------------------------------------------- chi siamo */
.history { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); align-items: start; margin-top: 40px; }
.timeline { position: sticky; top: calc(var(--header-h) + 24px); border-left: 2px solid var(--line); }
.timeline li { display: grid; grid-template-columns: 64px 1fr; gap: 12px; padding: 0 0 18px 20px; position: relative; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface-2); border: 2px solid var(--brand); }
.tl-year { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--brand-ink); }
.tl-body p { margin: 0; font-size: .93rem; line-height: 1.45; color: var(--ink-2); }
.tl-pres { margin-top: 4px !important; font-weight: 700; color: var(--ink) !important; }
.history-text p { color: var(--ink-2); }
.history-text p:first-child { font-size: 1.15rem; color: var(--ink); }
.bio { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.bio-photo { position: sticky; top: calc(var(--header-h) + 24px); }
.bio-photo img { border-radius: var(--radius-img); aspect-ratio: 1; object-fit: cover; width: 100%; box-shadow: var(--shadow-lg); }
.bio-photo figcaption { margin-top: 14px; font-weight: 600; color: var(--brand-ink); }

/* ---------------------------------------------------------------- vantaggi */
.badge-icon { width: 56px; height: 56px; border-radius: 14px; background: var(--brand-soft); color: var(--brand-ink); display: grid; place-items: center; font-size: 1.7rem; margin-bottom: 22px; }
.statement { font-size: clamp(1.45rem, 2.5vw, 2.05rem); font-weight: 500; line-height: 1.3; letter-spacing: -.015em; }
.statement em { font-style: normal; font-weight: 700; color: var(--brand-ink); }
.safety { display: grid; grid-template-columns: 1.3fr 1fr; gap: clamp(32px, 6vw, 88px); align-items: center; }
.safety-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.safety-facts .fact { background: var(--surface); border-radius: var(--radius); padding: 22px; border: 1px solid var(--line); }
.safety-facts .fact-n { color: var(--brand-ink); font-size: 2.4rem; }
.safety-facts p { grid-column: 1 / -1; color: var(--muted); margin: 0; }

/* ---------------------------------------------------------------- intrastat */
.flow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 32px; counter-reset: f; }
.flow li { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.flow li:not(:last-child)::after { content: ""; position: absolute; right: -13px; top: 44px; width: 10px; height: 10px; border: solid var(--brand); border-width: 2px 2px 0 0; transform: rotate(45deg); z-index: 1; }
.flow-icon { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: var(--on-brand); font-size: 1.4rem; margin-bottom: 8px; }
.flow-client .flow-icon { background: var(--ink); color: var(--bg); }
.flow-who { font-size: .85rem; font-weight: 600; color: var(--brand-ink); }
.flow-client .flow-who { color: var(--muted); }
.flow-what { font-weight: 600; line-height: 1.35; }
.flow-note { display: flex; align-items: center; gap: 10px; margin: 24px 0 0; font-weight: 500; color: var(--ink-2); }
.flow-note i { font-size: 1.4rem; color: var(--brand-ink); }
.benefits h2 { font-size: 1.3rem; letter-spacing: -.01em; }

/* ---------------------------------------------------------------- contatti */
.contact { display: grid; grid-template-columns: 1fr 1.05fr; gap: clamp(32px, 6vw, 80px); align-items: start; }
.contact-info p { color: var(--ink-2); }
.channels { display: grid; gap: 10px; margin-top: 28px; }
.channels a, .channels .channel { display: flex; align-items: center; gap: 16px; padding: 14px 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); text-decoration: none; transition: border-color .2s, transform .3s var(--ease); }
.channels a:hover { border-color: var(--brand); transform: translateX(4px); }
.channels .channel { cursor: default; }
.channels small { display: block; font-size: .8rem; color: var(--muted); }
.channels span { font-weight: 600; line-height: 1.35; }
.ch-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-ink); font-size: 1.3rem; flex-shrink: 0; }
.form-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(22px, 3.5vw, 40px); box-shadow: var(--shadow); }
.form-card h2 { font-size: 1.35rem; letter-spacing: -.01em; margin-bottom: 22px; }
.form { display: grid; gap: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 600; font-size: .92rem; }
.field input, .field select, .field textarea {
  font: inherit; font-size: 1rem; color: var(--ink); background: var(--bg); border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  padding: 12px 14px; width: 100%; transition: border-color .2s, box-shadow .2s;
}
.field textarea { resize: vertical; min-height: 140px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 22%, transparent); }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: #c62828; }
.field-error { margin: 0; font-size: .85rem; color: #c62828; min-height: 0; }
.form-privacy { font-size: .88rem; color: var(--muted); margin: 0; }
.form-privacy a { color: var(--brand-ink); }
.form .btn { justify-self: start; }
.form-status { margin: 0; font-weight: 500; }
.form-status.ok { color: var(--ink); background: var(--brand-soft); padding: 12px 16px; border-radius: var(--radius-sm); }
.map iframe { display: block; width: 100%; height: 380px; border: 0; filter: grayscale(.35); }

/* ---------------------------------------------------------------- cta + footer */
.cta-band { background: var(--brand); color: var(--on-brand); }
.cta-inner { display: flex; align-items: center; justify-content: space-between; gap: 32px; padding-block: clamp(44px, 6vw, 72px); }
.cta-inner h2 { font-size: clamp(1.5rem, 2.6vw, 2.15rem); max-width: 24ch; }
.cta-inner p { margin: 0; max-width: 60ch; color: rgb(22 26 33 / .8); }
.cta-actions { display: flex; flex-direction: column; align-items: center; gap: 12px; flex-shrink: 0; }
.cta-band .btn-primary { background: var(--ink); color: #fff; box-shadow: none; }
.cta-band .btn-primary:hover { background: #000; }
.cta-phone { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; text-decoration: none; }

.site-footer { background: #12151b; color: #c9ced6; font-size: .94rem; }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1.1fr 1fr; gap: 40px; padding-block: 64px 48px; }
.brand-footer .brand-word { color: #fff; }
.brand-footer img { width: 52px; height: 52px; }
.footer-contacts { display: grid; gap: 10px; margin-top: 24px; }
.footer-contacts li { display: flex; gap: 10px; align-items: flex-start; line-height: 1.45; }
.footer-contacts i { color: var(--brand); font-size: 1.15rem; margin-top: 2px; flex-shrink: 0; }
.footer-contacts a { text-decoration: none; }
.footer-contacts a:hover { color: #fff; text-decoration: underline; }
.footer-aeo { display: flex; align-items: center; gap: 12px; margin-top: 24px; font-size: .85rem; color: #9aa1ac; }
.footer-aeo img { width: 44px; height: 44px; background: #fff; border-radius: 8px; padding: 2px; }
.footer-col h2 { font-size: .98rem; letter-spacing: 0; color: #fff; margin-bottom: 12px; }
.footer-col h2 a { text-decoration: none; }
.footer-col h2.mt { margin-top: 28px; }
.footer-col ul { display: grid; gap: 7px; }
.footer-col ul a { text-decoration: none; color: #a9b0bb; line-height: 1.4; transition: color .2s; }
.footer-col ul a:hover { color: var(--brand); }
.footer-bottom { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 32px; padding-block: 22px 28px; border-top: 1px solid #262c36; color: #8b929d; font-size: .86rem; }
.footer-bottom p { margin: 0; }
.footer-legal { display: flex; gap: 20px; }
.footer-legal a { text-decoration: none; }
.footer-legal a:hover { color: #fff; }
.footer-social { display: flex; gap: 8px; margin-left: auto; }
.footer-social a { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; border: 1px solid #2c333e; font-size: 1.15rem; color: #c9ced6; transition: background-color .2s, color .2s, border-color .2s; }
.footer-social a:hover { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }

.notfound { min-height: 56dvh; display: flex; align-items: center; }
.notfound .page-lead { margin-bottom: 28px; }

/* ---------------------------------------------------------------- lingua */
.lang-switch { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); flex-shrink: 0; }
.lang-switch a { padding: 5px 10px; border-radius: 999px; font-size: .8rem; font-weight: 600; letter-spacing: .04em; text-decoration: none; color: var(--muted); transition: background-color .2s, color .2s; }
.lang-switch a:hover { color: var(--ink); }
.lang-switch a[aria-current="true"] { background: var(--ink); color: #fff; }
.header-inner .nav { margin-left: auto; }

/* ---------------------------------------------------------------- azioni nelle intestazioni */
.page-actions { margin-top: 26px; display: flex; flex-wrap: wrap; gap: 12px; }
.highlight-box { display: flex; align-items: center; gap: 14px; margin: 1.4em 0; padding: 18px 22px; border-radius: var(--radius); background: var(--ink); color: #fff !important; font-weight: 600; font-size: 1.05rem; line-height: 1.45; }
.highlight-box i { font-size: 1.8rem; color: var(--brand); flex-shrink: 0; }

/* ---------------------------------------------------------------- riquadro "In breve" */
.summary-box { margin: 0 0 2.2em; padding: 24px 26px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--brand); box-shadow: var(--shadow); }
.summary-box h2 { font-size: 1.15rem; letter-spacing: -.01em; margin: 0 0 14px; }
.summary-box dl { margin: 0; display: grid; gap: 14px; }
.summary-box dt { display: flex; align-items: center; gap: 8px; font-weight: 700; margin-bottom: 2px; }
.summary-box dt .ph { color: var(--brand); font-size: 1.2rem; }
.summary-box dd { margin: 0; color: var(--ink-2); line-height: 1.55; }
.prose .summary-box + .lead, .prose .summary-box + h2 { margin-top: 0; }

/* ---------------------------------------------------------------- footer dati legali */
.footer-legal-info { padding-block: 0 18px; }
.footer-legal-info p { margin: 0; font-size: .82rem; color: #8b929d; line-height: 1.6; }
.footer-legal-info .sep { margin: 0 6px; opacity: .5; }

/* ---------------------------------------------------------------- motion */
@media (prefers-reduced-motion: no-preference) {
  /* scorrimento fluido solo dopo il caricamento, cosi le ancore tra pagine arrivano subito */
  html.is-ready { scroll-behavior: smooth; }
  @view-transition { navigation: auto; }
  .js .reveal { opacity: 0; transform: translateY(22px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
  .js .reveal.is-in { opacity: 1; transform: none; }
  .hero-copy > * { animation: rise .9s var(--ease) both; }
  .hero-copy > :nth-child(2) { animation-delay: .08s; }
  .hero-copy > :nth-child(3) { animation-delay: .16s; }
  .hero-copy > :nth-child(4) { animation-delay: .24s; }
  .hero-aeo { animation: rise .9s .36s var(--ease) both; }
  @keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1080px) {
  :root { --header-h: 64px; }
  .menu-toggle {
    display: grid; place-items: center; gap: 5px; width: 44px; height: 44px; padding: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer;
    align-content: center;
  }
  .menu-toggle span { display: block; width: 18px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .3s var(--ease); }
  .menu-toggle[aria-expanded="true"] span:first-child { transform: translateY(3.5px) rotate(45deg); }
  .menu-toggle[aria-expanded="true"] span:last-child { transform: translateY(-3.5px) rotate(-45deg); }
  .nav {
    position: fixed; inset: var(--header-h) 0 0 0; z-index: 40; flex-direction: column; align-items: stretch; gap: 20px;
    background: var(--bg); padding: 16px var(--gutter) 32px; overflow-y: auto;
    opacity: 0; visibility: hidden; transform: translateY(-8px); transition: opacity .25s var(--ease), transform .3s var(--ease), visibility .25s;
  }
  .nav.is-open { opacity: 1; visibility: visible; transform: none; }
  .nav-list { flex-direction: column; align-items: stretch; gap: 0; }
  .nav-item { flex-wrap: wrap; border-bottom: 1px solid var(--line); }
  .nav-link { flex: 1; padding: 16px 4px; font-size: 1.1rem; font-weight: 600; }
  .nav-item.is-active > .nav-link { box-shadow: none; }
  .has-sub > .nav-link::after { display: none; }
  .sub-toggle { display: grid; place-items: center; width: 44px; height: 44px; border: 0; background: none; color: var(--ink); font-size: 1.2rem; cursor: pointer; border-radius: 10px; }
  .sub-toggle i { transition: transform .3s var(--ease); }
  .sub-toggle[aria-expanded="true"] i { transform: rotate(180deg); }
  .sub, .sub-wide { position: static; width: 100%; min-width: 0; padding: 0 0 12px; border: 0; box-shadow: none; background: none; opacity: 1; visibility: visible; transform: none; display: none; }
  .sub.is-open { display: block; }
  .sub-wide ul { grid-template-columns: 1fr; }
  .nav-cta { align-self: stretch; }
  body.menu-open { overflow: hidden; }

  .hero-inner { grid-template-columns: 1fr; align-items: start; gap: 32px; }
  .hero-side { flex-direction: row; align-items: center; justify-content: flex-start; }
  .hero-logo { width: 96px; }
  .facts-grid { grid-template-columns: 1fr 1fr; }
  .facts .fact:nth-child(odd) { padding-left: 0; border-left: 0; }
  .facts .fact:nth-child(n+3) { border-top: 1px solid var(--line); }
  .facts .fact:last-child { grid-column: 1 / -1; }
  .service-layout { grid-template-columns: 1fr; }
  .service-aside { position: static; grid-template-columns: 1fr 1fr; }
  .history { grid-template-columns: 1fr; }
  .timeline { position: static; }
  .people-layout { grid-template-columns: 1fr; }
  .cons-grid { grid-template-columns: 1fr 1fr; }
  .flow { grid-template-columns: 1fr 1fr; }
  .header-inner .nav { margin-left: 0; }
  .lang-switch { margin-left: auto; }
  /* il blur crea un contenitore per gli elementi fixed: su mobile header pieno, cosi il menu copre lo schermo */
  .site-header { background: var(--bg); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .header-inner { gap: 10px; }
  .flow li:nth-child(2)::after { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 767px) {
  body { font-size: 16px; }
  .hero { min-height: auto; }
  .hero-inner { padding-block: 48px 56px; }
  .hero-actions .btn { flex: 1 1 auto; }
  .split, .safety, .service-head, .contact, .bio { grid-template-columns: 1fr; }
  .split-rev .split-media { order: 0; }
  .service-head > figure { order: -1; aspect-ratio: 16 / 10; }
  .services-bento { grid-template-columns: 1fr; }
  .tile-dogana { grid-row: auto; }
  .tile-intrastat { flex-direction: column; align-items: stretch; }
  .tile-intrastat img { width: auto; max-width: none; margin: 0 24px 24px; }
  .people-grid { grid-template-columns: 1fr 1fr; }
  .people-grid .person:nth-child(2) { margin-top: 0; }
  .people-grid .person:nth-child(3) { grid-column: 1 / -1; max-width: 50%; }
  .checks-2, .defs, .form-row, .svc-rows, .cons-grid, .flow, .service-aside, .safety-facts { grid-template-columns: 1fr; }
  .cons-grid li:first-child { grid-column: auto; }
  .footer-legal-info .sep { display: none; }
  .brand { gap: 8px; min-width: 0; }
  .brand img { width: 36px; height: 36px; }
  .brand-word { font-size: .82rem; }
  .lang-switch a { padding: 4px 8px; font-size: .75rem; }
  .menu-toggle { flex-shrink: 0; }
  .flow li::after { display: none; }
  .bio-photo { position: static; max-width: 320px; }
  .timeline li { grid-template-columns: 52px 1fr; }
  .cta-inner { flex-direction: column; align-items: flex-start; }
  .cta-actions { align-items: flex-start; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .footer-social { margin-left: 0; }
  .map iframe { height: 300px; }
}
