/* Ecomatico.it - prototipo Fase 2. Mobile-first: gli stili di base sono per smartphone,
   le media query aggiungono tablet (>=720px) e desktop (>=1024px). */

:root {
  --ink: #18212d;
  --ink-2: #3f4a5a;
  --muted: #5f6977;
  --line: #e4e6ea;
  --bg: #ffffff;
  --soft: #f5f6f8;
  --warm: #fff4ec;
  --brand: #ff6600;      /* arancio del logo */
  --brand-grey: #878080; /* grigio del logo */
  --cta: #f05a00;        /* testo bianco grassetto >= 18.7px: contrasto 3.4:1 (AA testo grande) */
  --cta-hover: #d95200;
  --link: #c24700;       /* arancio per testo normale: 4.8:1 */
  --dark: #16202b;
  --ok: #1f7a4d;
  --r: 14px;
  --r-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 10px 30px rgba(16, 24, 40, .08);
  --wrap: 1160px;
  --gutter: 16px;
  --bar-h: 72px;         /* altezza della barra demo fissa su smartphone */
}

*, *::before, *::after { box-sizing: border-box; }
/* I collegamenti a una sezione (es. /funzionalita#fatturazione) non la lasciano sotto l'intestazione fissa */
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 64px; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--link); }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: 34px; font-weight: 800; }
h2 { font-size: 27px; font-weight: 800; }
h3 { font-size: 19px; font-weight: 700; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 12px; z-index: 100; border-radius: 6px; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid #2563eb; outline-offset: 2px; }

/* Pulsanti */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 8px 24px; border-radius: 999px; border: 2px solid transparent;
  font: inherit; font-size: 19px; font-weight: 700; line-height: 1.2; text-decoration: none; cursor: pointer;
  /* Su smartphone un testo lungo va a capo (righe bilanciate) invece di uscire dallo schermo */
  max-width: 100%; text-align: center; text-wrap: balance;
  transition: background-color .15s, color .15s, border-color .15s;
}
.btn svg { flex-shrink: 0; }
.btn-cta { background: var(--cta); color: #fff; }
.btn-cta:hover { background: var(--cta-hover); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink-2); }
.btn-sm { min-height: 42px; padding: 0 18px; font-size: 16px; white-space: nowrap; }
.btn-block { width: 100%; }
.btn svg { width: 20px; height: 20px; }

/* Header */
.header { position: sticky; top: 0; z-index: 40; background: rgba(255, 255, 255, .96); border-bottom: 1px solid var(--line); backdrop-filter: saturate(1.4) blur(8px); }
.header .wrap { display: flex; align-items: center; gap: 12px; height: 64px; }
.logo { display: block; margin-right: auto; }
.logo img { height: 32px; width: auto; display: block; }
/* Smartphone molto stretti (320px): logo più piccolo per lasciare spazio al pulsante del menu */
@media (max-width: 359px) { .logo img { height: 28px; } }
.logo-payoff { display: none; }
.nav { display: none; }
.header-login { display: none; }
.menu-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px;
  border: 0; background: none; border-radius: 10px; color: var(--ink); cursor: pointer;
}
.menu-btn svg { width: 26px; height: 26px; }
.header .btn-cta { display: none; }

/* Menu mobile a scomparsa */
.drawer { position: fixed; inset: 64px 0 0 0; background: #fff; z-index: 39; overflow-y: auto; padding: 8px var(--gutter) 120px; display: none; }
.drawer.open { display: block; }
.drawer a, .drawer summary { display: flex; align-items: center; justify-content: space-between; min-height: 52px; color: var(--ink); text-decoration: none; font-size: 19px; font-weight: 600; border-bottom: 1px solid var(--line); cursor: pointer; list-style: none; }
.drawer summary::-webkit-details-marker { display: none; }
.drawer summary::after { content: "+"; font-size: 24px; color: var(--muted); font-weight: 400; }
.drawer details[open] summary::after { content: "–"; }
.drawer details a { font-size: 17px; font-weight: 500; padding-left: 14px; color: var(--ink-2); }
.drawer .btn { margin-top: 20px; }
.drawer .drawer-util { display: flex; gap: 20px; margin-top: 18px; }
.drawer .drawer-util a { border: 0; min-height: 44px; font-size: 16px; font-weight: 500; color: var(--muted); }
.drawer a .badge { margin-right: auto; }

/* Sezioni */
.section { padding: 56px 0; }
.section-soft { background: var(--soft); }
.section-warm { background: var(--warm); }
.section-dark { background: var(--dark); color: #e8ecf1; }
.section-dark h2, .section-dark h3 { color: #fff; }
.eyebrow { display: inline-block; font-size: 14px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--link); margin-bottom: 12px; }
.section-dark .eyebrow { color: #ffb380; }
/* Link nel testo delle sezioni scure: l'arancio dei link (3.3:1 sul blu scuro) diventa quello chiaro degli occhielli */
.section-dark :where(a:not(.btn)) { color: #ffb380; }
.lead { font-size: 19px; color: var(--ink-2); }
.section-dark .lead { color: #cfd6de; }
.lead p { margin: 0 0 .6em; }
.lead p:last-child { margin-bottom: 0; }
.narrow { max-width: 760px; }
.crumbs span { color: var(--ink-2); }
.hero-note span { min-width: 0; }
.section-head { max-width: 720px; margin-bottom: 32px; }
.center { text-align: center; margin-left: auto; margin-right: auto; }

/* Hero */
.hero { padding: 32px 0 40px; background: linear-gradient(180deg, var(--warm) 0%, #fff 100%); }
/* --cta e non --brand: sui titoli grandi serve 3:1, #ff6600 su bianco si ferma a 2.9:1 */
.hero h1 .accent { color: var(--cta); display: block; }
.hero .lead { margin-bottom: 24px; }
.hero-cta { display: flex; flex-direction: column; gap: 12px; }
.hero-note { display: flex; align-items: flex-start; gap: 8px; font-size: 15px; color: var(--muted); margin-top: 14px; }
.hero-note svg { width: 18px; height: 18px; color: var(--ok); flex: none; margin-top: 3px; }
/* Su smartphone la nota sulla demo sta subito sotto il primo pulsante, prima del secondo */
.hero-cta .hero-note { order: 1; margin: 0; }
.hero-cta .btn-ghost { order: 2; }
.hero-visual { margin-top: 36px; position: relative; }
.hero-solo .wrap > div { max-width: 820px; }
.hero-solo + .section { padding-top: 16px; }

/* Cornici degli screenshot */
.browser { background: #fff; border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.browser-bar { display: flex; gap: 6px; align-items: center; height: 30px; padding: 0 12px; background: var(--soft); border-bottom: 1px solid var(--line); }
.browser > img { width: 100%; height: auto; }
.browser-bar i { width: 10px; height: 10px; border-radius: 50%; background: #d6d9de; }
.phone { width: 42%; max-width: 210px; position: absolute; right: -4px; bottom: -22px; background: #111; border-radius: 26px; padding: 7px; box-shadow: var(--shadow); }
.phone .shot { border-radius: 20px; aspect-ratio: 9 / 18; }
.phone img { width: 100%; height: auto; border-radius: 20px; }
/* Segnaposto: verrà sostituito da uno screenshot reale dell'applicativo (WebP responsive) */
.shot {
  position: relative; display: flex; align-items: center; justify-content: center; text-align: center;
  aspect-ratio: 16 / 10; background:
    linear-gradient(#eef0f3, #eef0f3) 0 0 / 22% 100% no-repeat,
    repeating-linear-gradient(180deg, #fff 0 34px, #f1f2f4 34px 35px);
  color: var(--muted); font-size: 13px; font-weight: 600; padding: 12px;
}
.shot span { background: rgba(255, 255, 255, .92); border: 1px dashed #c9cdd3; border-radius: 8px; padding: 6px 10px; max-width: 80%; }
.phone .shot { background: repeating-linear-gradient(180deg, #fff 0 44px, #f1f2f4 44px 45px); }

/* Loghi clienti */
.clients { padding: 28px 0 8px; }
/* Titolo centrato delle fasce (loghi dei clienti, 100% cloud): stesso carattere e misura ovunque */
.fascia-titolo { text-align: center; font-size: 18px; font-weight: 800; line-height: 1.25; letter-spacing: -.01em; color: var(--ink); margin: 0 0 18px; }
.logo-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px 20px; align-items: center; justify-items: center; }
.logo-row img { height: 30px; width: auto; max-width: 100%; opacity: .7; }
.logo-row img:nth-child(n+7) { display: none; }

/* Icone con titolo: stesso schema in tutti i blocchi (fascia, attività, funzioni, vantaggi). Icona arancione senza
   riquadro a sinistra del titolo, sulla stessa linea; il testo va sotto, dal bordo dell'icona */
.punti-elenco li, .feature { display: grid; grid-template-columns: 32px 1fr; column-gap: 12px; row-gap: 6px; align-items: center; align-content: start; }
.punti-elenco li > *, .feature > * { grid-column: 2; }
.punti-elenco .ico, .feature .ico { grid-column: 1; grid-row: 1; display: flex; color: var(--brand); }
.punti-elenco .ico svg, .feature .ico svg, .module .ico svg { width: 32px; height: 32px; }
.feature h3 { margin: 0; }
.feature > :not(.ico):not(h3), .punti-elenco small { grid-column: 1 / -1; }
.feature { row-gap: 10px; }
.punti-elenco li { row-gap: 2px; }

/* Fascia di vantaggi brevi (es. 100% cloud) */
.punti { padding: 28px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #fff; }
.punti-warm { background: var(--warm); border-color: #f6dccb; }
.punti-dark { background: var(--dark); color: #e8ecf1; border-color: var(--dark); }
.punti-elenco { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 18px 14px; }
.punti-dark .punti-elenco .ico { color: #ffb380; }
.punti-elenco strong { display: block; font-size: 15px; line-height: 1.3; }
.punti-elenco strong a { color: inherit; }
.punti-elenco small { display: block; font-size: 14px; color: var(--ink-2); line-height: 1.45; }
.punti-dark .punti-elenco small { color: #b7c0cb; }

/* Percorso a tappe */
.percorso { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; counter-reset: tappa; }
.tappa { position: relative; display: grid; grid-template-columns: 56px 1fr; align-content: start; gap: 14px; padding-bottom: 26px; counter-increment: tappa; }
.tappa:last-child { padding-bottom: 0; }
.tappa::after { content: ""; position: absolute; left: 27px; top: 58px; bottom: 4px; width: 2px; background: repeating-linear-gradient(180deg, var(--brand) 0 6px, transparent 6px 11px); }
.tappa:last-child::after { display: none; }
.tappa-ico { position: relative; width: 56px; height: 56px; border-radius: 50%; background: var(--warm); color: var(--brand); border: 2px solid var(--brand); display: flex; align-items: center; justify-content: center; }
.tappa-ico svg { width: 26px; height: 26px; }
.tappa-ico::before { content: counter(tappa); position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 12px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.tappa h3 { margin: 6px 0 4px; }
.tappa p { margin: 0; color: var(--ink-2); font-size: 16px; }
.section-dark .tappa p { color: #cfd6de; }
.section-dark .tappa-ico { background: rgba(255, 255, 255, .06); }
.percorso-nota { margin: 26px 0 0; padding: 14px 16px; background: var(--warm); border-radius: var(--r-sm); font-size: 16px; color: var(--ink-2); }
.section-dark .percorso-nota { background: rgba(255, 255, 255, .06); color: #e8ecf1; }
.section-dark .percorso-nota a { color: #ffb380; }
.percorso-cta { margin-top: 26px; }

/* Schermate reali */
.schermate { display: grid; gap: 28px; }
.schermata { margin: 0; }
.schermata img { width: 100%; height: auto; }
.schermata figcaption { margin-top: 12px; font-size: 15px; color: var(--ink-2); }
.schermata figcaption strong { display: block; color: var(--ink); font-size: 17px; margin-bottom: 2px; }


/* Benefici */
/* Griglia dei vantaggi (3 card): stesse card delle funzioni, su tre colonne già da tablet */
.benefits { display: grid; gap: 14px; }

/* Moduli */
.core { background: var(--ink); color: #fff; border-radius: var(--r); padding: 22px 20px; margin-bottom: 18px; }
.core h3 { color: #fff; display: flex; align-items: center; gap: 10px; }
.core .badge { background: var(--brand); color: var(--ink); }
.core ul { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.core li { display: flex; gap: 10px; align-items: flex-start; font-size: 16px; color: #dfe4ea; }
.core li svg { width: 20px; height: 20px; color: #ffb380; flex: none; margin-top: 2px; }
.badge { display: inline-block; font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; background: var(--warm); color: var(--link); }
.dd-menu .badge, .drawer .badge, .footer .badge { margin-left: 8px; font-size: 11px; padding: 2px 7px; vertical-align: 1px; }
.modules { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.module { position: relative; padding: 16px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); }
.module .ico { display: flex; color: var(--brand); margin-bottom: 8px; }
.module strong { display: block; font-size: 16px; line-height: 1.25; margin-bottom: 4px; }
.module p { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.4; }
.module .switch { position: absolute; top: 4px; right: 2px; width: 54px; height: 42px; border: 0; padding: 0; background: none; cursor: pointer; border-radius: 12px; }
.module .switch::before { content: ""; position: absolute; top: 12px; left: 12px; width: 30px; height: 18px; border-radius: 999px; background: var(--brand); transition: background-color .15s; }
.module .switch.off::before { background: #cfd3d9; }
.module .switch.off::after { left: 15px; }
.modules-note { font-size: 14px; color: var(--muted); margin: 12px 0 0; }
.module .switch::after { content: ""; position: absolute; top: 15px; left: 27px; width: 12px; height: 12px; border-radius: 50%; background: #fff; transition: left .15s; }

/* Elenco adempimenti (fascia RENTRI) */
.checks { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 12px; }
.checks li { display: grid; grid-template-columns: 26px 1fr; gap: 10px; font-size: 17px; }
.checks svg { width: 24px; height: 24px; color: #7ad3a5; margin-top: 1px; }
.section:not(.section-dark) .checks svg { color: var(--ok); }
.checks strong { display: block; }
.checks span { color: inherit; opacity: .85; font-size: 16px; }

/* Passi della demo: come i riquadri, numero a sinistra del titolo e testo sotto su tutta la larghezza */
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; counter-reset: step; }
.steps li { counter-increment: step; display: grid; align-content: start; grid-template-columns: 44px 1fr; column-gap: 14px; row-gap: 10px; align-items: center; }
.steps li::before { content: counter(step); grid-column: 1; grid-row: 1; width: 44px; height: 44px; border-radius: 50%; background: var(--brand); color: var(--ink); font-weight: 800; font-size: 19px; display: flex; align-items: center; justify-content: center; }
.steps li > div { display: contents; }
.steps h3 { grid-column: 2; grid-row: 1; margin: 0; }
.steps p { grid-column: 1 / -1; }
.steps p { margin: 0; color: var(--ink-2); font-size: 16px; }
.steps-spaced { margin: 32px 0; }

/* Card funzioni (landing) */
.features { display: grid; gap: 14px; }
.feature { padding: 20px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); }
.feature p { margin: 0; font-size: 17px; line-height: 1.55; color: var(--ink-2); }
/* Card cliccabili (funzioni, attività, moduli): tutta la card è il link e la freccia dopo il titolo lo segnala sempre,
   anche su smartphone; il titolo si colora e si sottolinea solo al passaggio del mouse o con il focus */
.feature-link, .module-link { color: inherit; text-decoration: none; transition: border-color .15s, box-shadow .15s, transform .15s, background-color .15s; }
.module-link strong a { color: inherit; text-decoration: none; }
.freccia { display: inline-block; width: .85em; height: .85em; margin-left: .35em; vertical-align: -.08em; color: var(--link); transition: transform .15s; }
.nowrap { white-space: nowrap; }
.feature-link:active, .module-link:active { background-color: var(--soft); }
@media (hover: hover) {
  .feature-link:hover, .module-link:hover { border-color: #f3b58c; box-shadow: var(--shadow); transform: translateY(-1px); }
  .feature-link:hover h3, .module-link:hover strong a { color: var(--link); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
  .feature-link:hover .freccia, .module-link:hover .freccia { transform: translateX(3px); }
}
.feature-link:focus-visible h3, .module-link strong a:focus-visible { color: var(--link); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.module-link strong a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.module-link .switch { z-index: 1; }
.checks strong a { color: inherit; text-decoration-color: rgba(194, 71, 0, .45); text-underline-offset: 3px; }
.section-dark .checks strong a { text-decoration-color: rgba(255, 179, 128, .6); }

/* FAQ */
.faq { max-width: 800px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { display: flex; justify-content: space-between; gap: 16px; align-items: center; min-height: 60px; padding: 14px 0; font-weight: 700; font-size: 18px; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 26px; font-weight: 400; color: var(--link); flex: none; }
.faq details[open] summary::after { content: "–"; }
.faq-a { color: var(--ink-2); padding-bottom: 6px; }
.faq-a p { margin: 0 0 12px; }

/* CTA finale */
.split > div > .btn { margin-bottom: 32px; }
.cta-band { background: var(--ink); color: #fff; border-radius: 20px; padding: 32px 22px; text-align: center; }
.cta-band h2 { color: #fff; }
.cta-band p { color: #cfd6de; margin-bottom: 22px; }

/* Testo libero (pagine legali) */
.prose { max-width: 780px; }
.prose h2 { font-size: 23px; margin-top: 1.6em; }
.prose h3 { margin-top: 1.4em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: .35em; }
.prose blockquote { margin: 0 0 1.4em; padding: 12px 16px; background: var(--warm); border-left: 4px solid var(--brand); border-radius: 8px; }
.prose blockquote p { margin: 0; }
.prose table { border-collapse: collapse; width: 100%; font-size: 15px; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }

/* Recapiti */
.contacts { list-style: none; padding: 0; margin: 0 0 32px; display: grid; gap: 14px; font-size: 18px; }
.contacts li { display: grid; grid-template-columns: 26px 1fr; gap: 12px; align-items: start; }
.contacts svg { width: 24px; height: 24px; color: var(--brand); margin-top: 2px; }
.contacts a { color: var(--ink); font-weight: 600; }

/* Breadcrumb */
.crumbs { font-size: 14px; color: var(--muted); margin-bottom: 14px; }
.crumbs a { color: var(--muted); }

/* Form richiesta demo */
.form-page { padding: 28px 0 56px; background: var(--soft); }
.form-card { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 22px 18px; box-shadow: var(--shadow); }
.field { margin-bottom: 18px; }
.field label, .field legend { display: block; font-weight: 700; font-size: 16px; margin-bottom: 6px; }
.field .opt { font-weight: 400; color: var(--muted); }
.field input[type=text], .field input[type=email], .field input[type=tel], .field input[type=password], .field input[type=url],
.field select, .field textarea {
  width: 100%; min-height: 52px; padding: 12px 14px; font: inherit; font-size: 17px; color: var(--ink);
  border: 1.5px solid #c8ccd2; border-radius: var(--r-sm); background: #fff;
}
.field textarea { min-height: 96px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--ink); outline: 3px solid rgba(255, 102, 0, .25); outline-offset: 0; }
.field fieldset { border: 0; padding: 0; margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip input { position: absolute; opacity: 0; }
.chip span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border: 1.5px solid #c8ccd2; border-radius: 999px; font-size: 15px; font-weight: 600; cursor: pointer; }
.chip input:checked + span { background: var(--warm); border-color: var(--brand); color: var(--ink); }
.chip input:focus-visible + span { outline: 3px solid #2563eb; outline-offset: 2px; }
.form-card { margin-top: 24px; }
.field label.check { display: grid; font-weight: 400; margin: 0; }
.check { display: grid; grid-template-columns: 24px 1fr; gap: 10px; font-size: 15px; color: var(--ink-2); align-items: start; }
.check input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--cta); }
.form-note { font-size: 14px; color: var(--muted); margin: 14px 0 0; }
.hp { position: absolute; left: -5000px; }
.form-error { background: #fdecea; border: 1px solid #f5c2bd; color: #8a1c12; border-radius: var(--r-sm); padding: 12px 14px; margin-bottom: 18px; font-size: 15px; }
.field-error { display: block; color: #b42318; font-size: 14px; margin-top: 4px; }
.field-error:empty { display: none; }
.input-validation-error { border-color: #b42318 !important; }
.consent-pref { display: grid; gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.consent-pref[hidden] { display: none; }
.linklike-dark { background: none; border: 0; padding: 0; font: inherit; text-decoration: underline; cursor: pointer; }
.aside-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.aside-list li { display: grid; grid-template-columns: 26px 1fr; gap: 10px; font-size: 16px; color: var(--ink-2); }
.aside-list svg { width: 22px; height: 22px; color: var(--ok); margin-top: 1px; }

/* Footer */
.footer { background: var(--dark); color: #b7c0cb; padding: 40px 0 calc(28px + var(--bar-h)); font-size: 15px; }
.footer a { color: #e3e8ee; text-decoration: none; }
.footer a:hover { text-decoration: underline; }
.footer .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 28px 20px; }
.footer .cols > :first-child { grid-column: 1 / -1; }
/* La colonna Ecomatico resta da sola nella sua riga: a tutta larghezza il badge "Nuovo" sta accanto ad "Accedi a Ecomatico" */
.footer .cols > :last-child { grid-column: 1 / -1; }
.footer .footer-h { color: #fff; font-size: 15px; font-weight: 700; margin: 0 0 10px; letter-spacing: 0; }
.footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.footer li:has(.badge) { white-space: nowrap; }
.footer .legal { border-top: 1px solid #2c3845; margin-top: 30px; padding-top: 18px; font-size: 13px; }
/* Logo e payoff con le misure dell'intestazione su desktop (34px e 14px) */
.footer .logo-w img { height: 34px; width: auto; display: block; filter: brightness(0) invert(1); opacity: .9; }
.footer .footer-payoff { margin: 6px 0 0; font-size: 14px; letter-spacing: .06em; line-height: 1; white-space: nowrap; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: #e3e8ee; cursor: pointer; }

/* Barra demo fissa su smartphone: compare quando il pulsante dell'hero esce dallo schermo */
.demo-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, .97); border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgba(16, 24, 40, .08);
  transform: translateY(110%); transition: transform .2s ease;
}
.demo-bar.show { transform: none; }
.demo-bar .btn { width: 100%; }

/* Banner cookie: barra compatta in basso, sopra la barra demo */
.consent {
  position: fixed; left: 8px; right: 8px; bottom: 8px; z-index: 50; background: #fff; border: 1px solid var(--line);
  border-radius: 16px; box-shadow: 0 10px 40px rgba(16, 24, 40, .22); padding: 16px 16px 14px;
}
.consent[hidden] { display: none; }
.consent p { font-size: 15px; margin: 0 28px 12px 0; color: var(--ink-2); }
.consent .row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.consent .btn { min-height: 46px; font-size: 16px; padding: 0 12px; }
.consent .btn-ghost { border-color: var(--ink); }
/* Testo di 16px: l'arancio dei link (4.8:1) come il pulsante dell'intestazione */
.consent .btn-cta { background: var(--link); }
.consent .btn-cta:hover { background: #a63d00; }
.consent .pref { display: inline-block; margin-top: 10px; font-size: 14px; color: var(--ink-2); }
.consent .close { position: absolute; top: 8px; right: 8px; width: 40px; height: 40px; border: 0; background: none; font-size: 24px; color: var(--muted); cursor: pointer; border-radius: 8px; }
body.consent-open .demo-bar { transform: translateY(110%); }

/* Tablet */
@media (min-width: 720px) {
  :root { --gutter: 24px; }
  h1 { font-size: 44px; }
  h2 { font-size: 34px; }
  .hero-cta { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .hero-cta .hero-note { order: 3; flex-basis: 100%; margin-top: 2px; }
  .logo img { height: 34px; }
  .logo-row { grid-template-columns: repeat(5, 1fr); }
  .logo-row img:nth-child(n+7) { display: block; }
  .modules { grid-template-columns: repeat(3, 1fr); }
  .features { grid-template-columns: repeat(2, 1fr); }
  .benefits { grid-template-columns: repeat(3, 1fr); }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .form-card { padding: 32px; }
  /* Tablet: logo su una riga, sotto le tre colonne di link */
  .footer .cols { grid-template-columns: repeat(3, 1fr); }
  .punti-elenco { grid-template-columns: repeat(4, 1fr); }
  .schermate { grid-template-columns: 1fr 1fr; }
  .footer .cols > :last-child { grid-column: auto; }
  .consent { left: auto; right: 20px; bottom: 20px; max-width: 420px; }
  .phone { width: 30%; right: -12px; }
}

/* Desktop stretto: logo e menu più compatti per stare su una riga */
@media (min-width: 1024px) and (max-width: 1199px) {
  .header .wrap { gap: 16px !important; }
  .logo img { height: 30px !important; }
  .logo-payoff { font-size: 13px !important; letter-spacing: .04em !important; }
  .nav > a, .nav .dd > button { padding: 10px 8px !important; }
}

/* Desktop */
@media (min-width: 1024px) {
  :root { --bar-h: 0px; }
  body { font-size: 18px; }
  h1 { font-size: 48px; }
  .section { padding: 88px 0; }
  .header .wrap { height: 80px; gap: 28px; }
  html { scroll-padding-top: 80px; }
  .logo img { height: 34px; }
  /* Colonna Ecomatico larga quanto "Accedi a Ecomatico" col badge */
  .footer .cols { grid-template-columns: 2fr 1fr 1fr auto; }
  .footer .cols > :first-child { grid-column: auto; }
  .logo { text-decoration: none; }
  /* Larga quasi quanto il logo: dimensione e spaziatura insieme al logo (34px qui, 30px tra 1024 e 1199) */
  .logo-payoff { display: block; margin-top: 6px; font-size: 14px; letter-spacing: .06em; line-height: 1; color: var(--muted); white-space: nowrap; }
  .menu-btn, .drawer, .demo-bar { display: none !important; }
  .nav { display: flex; gap: 6px; align-items: center; }
  .nav > a, .nav .dd > button { color: var(--ink); text-decoration: none; font-weight: 600; font-size: 16px; padding: 10px 12px; border-radius: 8px; background: none; border: 0; font-family: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
  .nav > a:hover, .nav .dd > button:hover { background: var(--soft); }
  .dd { position: relative; }
  .dd > button::after { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-3px); margin-left: 4px; }
  .dd-menu { position: absolute; top: calc(100% + 6px); left: 0; min-width: 280px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 8px; display: grid; visibility: hidden; opacity: 0; transition: opacity .15s .25s, visibility 0s .4s; }
  /* Ponte invisibile sullo spazio di 6px tra pulsante e menu, e chiusura ritardata: il menu non sparisce mentre il mouse ci arriva */
  .dd-menu::before { content: ""; position: absolute; left: 0; right: 0; top: -10px; height: 10px; }
  .dd:hover .dd-menu, .dd:focus-within .dd-menu { visibility: visible; opacity: 1; transition-delay: 0s; z-index: 1; }
  .dd-menu a { padding: 10px 12px; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: 15px; font-weight: 600; }
  .dd-menu a small { display: block; color: var(--muted); font-weight: 400; font-size: 13px; }
  .dd-menu a:hover { background: var(--soft); }
  .header-login { display: inline; font-size: 15px; font-weight: 600; color: var(--ink-2); text-decoration: none; margin-left: auto; }
  /* Accedi con più accessi: stesso menu di Soluzioni, allineato a destra perché sta vicino al bordo */
  .header-login.dd { display: block; }
  .header-login.dd > button { color: inherit; font: inherit; padding: 10px 8px; border-radius: 8px; background: none; border: 0; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
  .header-login.dd > button:hover { background: var(--soft); }
  .header-login .dd-menu { left: auto; right: 0; min-width: 240px; }
  /* Testo di 16px: con l'arancio dei pulsanti (3.4:1) non basta, con quello dei link si arriva a 4.8:1 */
  .header .btn-cta { display: inline-flex; background: var(--link); }
  .header .btn-cta:hover { background: #a63d00; }
  .logo { margin-right: 0; }
  .hero { padding: 72px 0 88px; }
  .hero .wrap { display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; }
  .hero-solo { padding: 56px 0 48px; }
  .hero-solo .wrap { display: block; }
  .hero-visual { margin-top: 0; }
  .hero .lead { font-size: 21px; }
  .clients { padding: 36px 0 12px; }
  .logo-row { grid-template-columns: repeat(10, 1fr); }
  .modules { grid-template-columns: repeat(4, 1fr); }
  .modules-wrap { display: grid; grid-template-columns: 300px 1fr; gap: 20px; align-items: start; }
  .core { margin-bottom: 0; position: sticky; top: 96px; }
  .split > div > .btn { margin-bottom: 0; }
  .split { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
  .features { grid-template-columns: repeat(3, 1fr); gap: 18px; }
  .benefits { gap: 18px; }
  .cta-band { padding: 56px; }
  .form-card { margin-top: 0; }
  .percorso { grid-template-columns: repeat(5, 1fr); gap: 18px; }
  .percorso.tappe-3 { grid-template-columns: repeat(3, 1fr); }
  .percorso.tappe-4 { grid-template-columns: repeat(4, 1fr); }
  .percorso.tappe-6 { grid-template-columns: repeat(6, 1fr); }
  .tappa { grid-template-columns: 1fr; padding-bottom: 0; text-align: left; }
  .tappa::after { left: 64px; right: -14px; top: 27px; bottom: auto; width: auto; height: 2px; background: repeating-linear-gradient(90deg, var(--brand) 0 6px, transparent 6px 11px); }
  .form-layout { display: grid; grid-template-columns: 1fr 1.25fr; gap: 56px; align-items: start; }
  .footer { padding-bottom: 28px; }
}
