/* =====================================================================
   AQUA — area pubblica
   Stessa identità del gestionale (blu lago, Public Sans, quadrante a rulli)
   con un registro più ampio e presentativo. Elemento distintivo: il
   totalizzatore che "gira" una volta all'apertura della pagina.
   ===================================================================== */

@font-face {
    font-family: "Public Sans";
    src: url("../fonts/public-sans.woff2") format("woff2");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

:root {
    --lake: #0B3954;
    --deep: #072A3E;
    --current: #087E8B;
    --current-ink: #06646E;
    --foam: #CFE6EE;
    --ink: #13232D;
    --ink-2: #4A5A64;
    --paper: #F6F8F9;
    --tint: #EAF1F4;
    --line: #D3DEE3;
    --white: #FFFFFF;
    --roller: #15232B;
    --red: #B42318;
    --ok: #1C6B44;
    --ok-bg: #E2F3E9;
    --danger: #B42318;
    --danger-bg: #FDEBE9;
    --font: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --wrap: 1180px;
    --gutter: clamp(1.1rem, 4vw, 2.5rem);
    --r: 12px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 76px; }
body.site {
    margin: 0; font-family: var(--font); font-size: 1.0625rem; line-height: 1.6;
    color: var(--ink); background: var(--paper); font-variant-numeric: tabular-nums;
}
h1, h2, h3 { margin: 0; line-height: 1.15; }
p { margin: 0 0 1rem; }
a { color: var(--current-ink); text-underline-offset: 3px; }
a:hover { color: var(--lake); }
:focus-visible { outline: 3px solid var(--current); outline-offset: 3px; border-radius: 3px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--white); padding: .6rem 1rem; z-index: 100; }
.skip:focus { left: .5rem; top: .5rem; }
main:focus { outline: none; }

/* ---------- Pulsanti ---------- */
.site-btn {
    display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 1.35rem;
    border-radius: 8px; border: 2px solid transparent; font: inherit; font-weight: 700; font-size: 1rem;
    text-decoration: none; cursor: pointer; white-space: nowrap; transition: background-color .15s, color .15s, border-color .15s;
}
.site-btn--primary { background: var(--lake); color: var(--white); }
.site-btn--primary:hover { background: var(--deep); color: var(--white); }
.site-btn--light { background: var(--white); color: var(--lake); }
.site-btn--light:hover { background: var(--foam); color: var(--deep); }
.site-btn--outline { border-color: rgba(255,255,255,.7); color: var(--white); }
.site-btn--outline:hover { background: rgba(255,255,255,.1); color: var(--white); border-color: var(--white); }
.site-btn--login { min-height: 42px; padding: 0 1rem; background: var(--lake); color: var(--white); font-size: .95rem; }
.site-btn--login:hover { background: var(--deep); color: var(--white); }

/* ---------- Header ---------- */
.site-head {
    position: sticky; top: 0; z-index: 50;
    background: rgba(246, 248, 249, .92); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
    border-bottom: 1px solid transparent; transition: border-color .2s, box-shadow .2s;
}
.site-head.is-scrolled { border-bottom-color: var(--line); }
.site-head__inner { max-width: var(--wrap); margin: 0 auto; padding: .7rem var(--gutter); display: flex; align-items: center; gap: 1rem; }
.site-brand { display: flex; align-items: center; gap: .55rem; text-decoration: none; color: var(--lake); margin-right: auto; }
.site-brand img { display: block; width: 36px; height: 36px; }
.site-brand__name { font-weight: 800; font-size: 1.2rem; letter-spacing: .16em; }
.site-nav__list { display: none; list-style: none; margin: 0; padding: 0; gap: 1.6rem; }
.site-nav__list a, .site-nav__menu a { color: var(--ink); text-decoration: none; font-weight: 600; font-size: .98rem; }
.site-nav__list a:hover { color: var(--current-ink); }
.site-nav__menu { position: relative; }
.site-nav__menu summary {
    list-style: none; cursor: pointer; display: flex; align-items: center; gap: .5rem; min-height: 42px; padding: 0 .7rem;
    border: 1px solid var(--line); border-radius: 8px; font-weight: 600; background: var(--white);
}
.site-nav__menu summary::-webkit-details-marker { display: none; }
.site-nav__bars { width: 16px; height: 2px; background: var(--ink); position: relative; }
.site-nav__bars::before, .site-nav__bars::after { content: ""; position: absolute; left: 0; width: 16px; height: 2px; background: var(--ink); }
.site-nav__bars::before { top: -5px; } .site-nav__bars::after { top: 5px; }
.site-nav__menu ul {
    position: absolute; right: 0; top: calc(100% + .5rem); min-width: 220px; list-style: none; margin: 0; padding: .5rem;
    background: var(--white); border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 12px 32px rgba(7, 42, 62, .14);
}
.site-nav__menu li a { display: block; padding: .7rem .8rem; border-radius: 6px; }
.site-nav__menu li a:hover { background: var(--tint); }
@media (min-width: 900px) {
    .site-nav__list { display: flex; }
    .site-nav__menu { display: none; }
    .site-nav { margin-right: 1.2rem; }
}

/* ---------- Hero ---------- */
.hero { position: relative; background: var(--lake); color: var(--white); overflow: hidden; }
.hero::before {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background:
        repeating-linear-gradient(180deg, rgba(255,255,255,.03) 0 1px, transparent 1px 28px),
        radial-gradient(120% 90% at 85% 10%, rgba(8, 126, 139, .45), transparent 60%);
}
.hero__inner {
    position: relative; max-width: var(--wrap); margin: 0 auto; padding: clamp(2.5rem, 8vw, 6rem) var(--gutter) clamp(5rem, 10vw, 7.5rem);
    display: grid; gap: 2.5rem; align-items: center;
}
@media (min-width: 960px) { .hero__inner { grid-template-columns: 1.1fr .9fr; gap: 3.5rem; } }
.hero__title { display: flex; flex-direction: column; gap: .3rem; margin-bottom: 1.5rem; }
.hero__brand { font-size: clamp(3.6rem, 13vw, 7rem); font-weight: 800; letter-spacing: .14em; line-height: .95; margin-left: -.04em; }
.hero__tag { font-size: clamp(1.05rem, 2.6vw, 1.4rem); font-weight: 600; color: var(--foam); letter-spacing: .02em; }
.hero__lead { font-size: clamp(1.3rem, 3.4vw, 1.75rem); line-height: 1.3; font-weight: 600; max-width: 26ch; margin-bottom: 1.1rem; }
.hero__body { color: #D8E8EE; max-width: 52ch; }
.hero__cta { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.8rem; }
.hero__cta .site-btn { min-height: 52px; }
.hero__visual { margin: 0; }
.hero__caption { margin-top: .6rem; font-size: .8rem; color: #9FC0CC; text-align: right; }
.hero__flow { position: absolute; left: 0; right: 0; bottom: -1px; width: 100%; height: clamp(40px, 7vw, 100px); }
.hero__flow path { fill: var(--paper); }

/* Lettura dimostrativa con totalizzatore */
.reading {
    background: rgba(4, 28, 42, .55); border: 1px solid rgba(207, 230, 238, .22); border-radius: 18px;
    padding: clamp(1.1rem, 3vw, 1.8rem);
}
.reading__label { font-size: .9rem; color: var(--foam); font-weight: 600; margin-bottom: .9rem; }
.odo { display: flex; align-items: stretch; gap: clamp(3px, .8vw, 6px); padding: clamp(6px, 1.2vw, 10px); background: #0B1419; border-radius: 10px; box-shadow: inset 0 2px 6px rgba(0,0,0,.7); width: fit-content; max-width: 100%; }
.reel {
    --h: clamp(2.6rem, 9vw, 4.4rem);
    position: relative; display: block; width: calc(var(--h) * .66); height: var(--h); overflow: hidden; border-radius: 5px;
    background: linear-gradient(#2A3840, var(--roller) 32%, var(--roller) 68%, #2A3840);
    color: #F4F7F8; font-weight: 800; font-size: calc(var(--h) * .62);
}
.reel--red { background: linear-gradient(#D6463A, var(--red) 32%, var(--red) 68%, #D6463A); }
.reel::after { content: ""; position: absolute; inset: 0; background: linear-gradient(rgba(0,0,0,.35), transparent 30%, transparent 70%, rgba(0,0,0,.35)); pointer-events: none; }
.reel__strip { display: flex; flex-direction: column; transition: transform 1.6s cubic-bezier(.2, .7, .1, 1); }
.reel__strip span { display: flex; align-items: center; justify-content: center; height: var(--h); line-height: 1; }
.reel[data-d="0"] .reel__strip { transform: translateY(0); }
.reel[data-d="1"] .reel__strip { transform: translateY(calc(var(--h) * -1)); }
.reel[data-d="2"] .reel__strip { transform: translateY(calc(var(--h) * -2)); }
.reel[data-d="3"] .reel__strip { transform: translateY(calc(var(--h) * -3)); }
.reel[data-d="4"] .reel__strip { transform: translateY(calc(var(--h) * -4)); }
.reel[data-d="5"] .reel__strip { transform: translateY(calc(var(--h) * -5)); }
.reel[data-d="6"] .reel__strip { transform: translateY(calc(var(--h) * -6)); }
.reel[data-d="7"] .reel__strip { transform: translateY(calc(var(--h) * -7)); }
.reel[data-d="8"] .reel__strip { transform: translateY(calc(var(--h) * -8)); }
.reel[data-d="9"] .reel__strip { transform: translateY(calc(var(--h) * -9)); }
.odo.is-pre .reel__strip { transform: translateY(0) !important; transition: none; }
.odo .reel:nth-of-type(2) .reel__strip { transition-delay: .08s; }
.odo .reel:nth-of-type(3) .reel__strip { transition-delay: .16s; }
.odo .reel:nth-of-type(4) .reel__strip { transition-delay: .24s; }
.odo .reel:nth-of-type(5) .reel__strip { transition-delay: .32s; }
.odo .reel:nth-of-type(6) .reel__strip { transition-delay: .4s; }
.odo .reel:nth-of-type(7) .reel__strip { transition-delay: .48s; }
.odo__sep { align-self: flex-end; color: #9FB3BD; font-weight: 800; font-size: 1.6rem; padding: 0 1px; }
.odo__unit { align-self: flex-end; color: #C9D6DC; font-weight: 700; padding: 0 .3rem 0 .4rem; font-size: clamp(.9rem, 2.4vw, 1.2rem); }
.reading__meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; margin: 1.3rem 0 0; }
.reading__meta dt { font-size: .78rem; color: #9FC0CC; font-weight: 600; }
.reading__meta dd { margin: .15rem 0 0; font-weight: 700; color: var(--white); }
.pill { display: inline-block; padding: .1rem .55rem; border-radius: 999px; background: var(--ok-bg); color: var(--ok); font-size: .85rem; font-weight: 800; }

/* ---------- Sezioni ---------- */
.sec { padding: clamp(3.5rem, 9vw, 6.5rem) 0; }
.sec--tint { background: var(--tint); }
.sec--deep { background: var(--deep); color: var(--white); }
.sec__inner { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.sec__title { font-size: clamp(1.75rem, 4.6vw, 2.75rem); font-weight: 800; letter-spacing: -.015em; color: var(--lake); max-width: 22ch; margin-bottom: 1.2rem; }
.sec--deep .sec__title { color: var(--white); }
.sec__lead { font-size: clamp(1.1rem, 2.4vw, 1.3rem); line-height: 1.5; color: var(--ink); max-width: 60ch; }
.sec--deep .sec__lead { color: #D8E8EE; }
.sec__lead--narrow { max-width: 52ch; margin-bottom: 2.5rem; }
.prose { max-width: 64ch; }
.prose p { color: var(--ink-2); }
.prose .sec__lead { color: var(--ink); }
.split { display: grid; gap: 1.5rem; }
@media (min-width: 900px) { .split { grid-template-columns: 5fr 7fr; gap: 4rem; } .split--top { align-items: start; } }

/* Funzionalità: pannello a griglia con separatori */
.features {
    list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr; gap: 1px;
    background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden;
}
@media (min-width: 600px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .features { grid-template-columns: repeat(4, 1fr); } }
.feature { background: var(--white); padding: 1.6rem 1.5rem 1.7rem; transition: background-color .2s; }
.feature:hover { background: #FBFDFD; }
.feature__icon {
    display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px; margin-bottom: 1.1rem;
    border-radius: 12px; background: var(--tint); color: var(--lake);
}
.feature__name { font-size: 1.12rem; font-weight: 750; color: var(--lake); margin-bottom: .45rem; }
.feature__text { color: var(--ink-2); margin: 0; font-size: 1rem; }

/* Operatore sul territorio */
.field { display: grid; gap: 3rem; align-items: center; }
@media (min-width: 960px) { .field { grid-template-columns: 1.15fr .85fr; gap: 4.5rem; } }
.steps { list-style: none; margin: 2rem 0 0; padding: 0; display: grid; gap: 1.15rem; }
.step { display: grid; grid-template-columns: auto 1fr; gap: 1rem; align-items: start; }
.step__n {
    display: inline-flex; align-items: center; justify-content: center; width: 2.4rem; height: 2.4rem; border-radius: 50%;
    border: 2px solid rgba(207, 230, 238, .5); color: var(--white); font-weight: 800; font-size: 1.05rem; position: relative;
}
.step:not(:last-child) .step__n::after { content: ""; position: absolute; top: calc(100% + 2px); left: 50%; width: 2px; height: 1.15rem; background: rgba(207, 230, 238, .25); }
.step__title { font-size: 1.1rem; font-weight: 700; margin-top: .35rem; }
.step__text { color: #B9D0D8; margin: .2rem 0 0; font-size: .98rem; }

.phone {
    justify-self: center; width: min(300px, 82vw); aspect-ratio: 9 / 18.5; padding: 12px; border-radius: 40px;
    background: #0E181E; box-shadow: 0 0 0 2px #24343D, 0 30px 60px rgba(0,0,0,.45);
}
.phone__screen { height: 100%; border-radius: 30px; overflow: hidden; background: #F2F5F6; color: var(--ink); display: flex; flex-direction: column; }
.ph-bar { display: flex; justify-content: space-between; padding: 1.1rem 1rem .7rem; background: var(--lake); color: var(--white); font-weight: 800; font-size: .82rem; letter-spacing: .08em; }
.ph-bar span:last-child { letter-spacing: 0; font-weight: 600; color: var(--foam); }
.ph-body { padding: .9rem; display: flex; flex-direction: column; gap: .6rem; flex: 1; }
.ph-serial { margin: 0; font-weight: 800; font-size: 1.05rem; letter-spacing: .04em; }
.ph-muted { margin: -.45rem 0 0; color: var(--ink-2); font-size: .8rem; }
.ph-photo { border-radius: 8px; overflow: hidden; border: 1px solid var(--line); line-height: 0; }
.ph-photo svg { width: 100%; height: auto; display: block; }
.ph-ocr { background: var(--ok-bg); border-left: 3px solid var(--ok); border-radius: 6px; padding: .5rem .65rem; display: flex; flex-direction: column; }
.ph-ocr__label { font-size: .68rem; font-weight: 700; color: var(--ok); }
.ph-ocr__value { font-size: 1.4rem; font-weight: 800; letter-spacing: .12em; color: var(--lake); }
.ph-input { border: 2px solid var(--lake); border-radius: 8px; text-align: center; font-weight: 800; font-size: 1.35rem; letter-spacing: .1em; color: var(--lake); padding: .35rem; background: var(--white); }
.ph-btn { margin-top: auto; background: var(--lake); color: var(--white); text-align: center; border-radius: 8px; padding: .7rem .4rem; font-weight: 700; font-size: .8rem; }

/* Tracciabilità */
.facts-list { list-style: none; margin: 1.6rem 0 0; padding: 0; display: grid; gap: .9rem; max-width: 52ch; }
.facts-list li { position: relative; padding-left: 1.6rem; color: var(--ink-2); }
.facts-list li::before { content: ""; position: absolute; left: 0; top: .55em; width: .75rem; height: .75rem; border-radius: 50%; border: 2px solid var(--current); }
.chain { list-style: none; margin: 0; padding: 0; position: relative; }
.chain::before {
    content: ""; position: absolute; left: 13px; top: 14px; bottom: 14px; width: 4px; border-radius: 2px;
    background: repeating-linear-gradient(180deg, var(--current) 0 10px, rgba(8,126,139,.35) 10px 18px);
    background-size: 4px 36px;
}
.chain__node { position: relative; padding: 0 0 1.5rem 3.2rem; }
.chain__node:last-child { padding-bottom: 0; }
.chain__dot { position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%; background: var(--white); border: 3px solid var(--lake); }
.chain__node:last-child .chain__dot { background: var(--lake); }
.chain__name { font-size: 1.15rem; font-weight: 800; color: var(--lake); letter-spacing: .02em; padding-top: .1rem; }
.chain__text { color: var(--ink-2); margin: .2rem 0 0; }
@media (prefers-reduced-motion: no-preference) {
    .chain.is-visible::before { animation: flow 2.4s linear infinite; }
}
@keyframes flow { to { background-position: 0 36px; } }

/* Contatti */
.contact { display: grid; gap: 2.5rem; }
@media (min-width: 960px) { .contact { grid-template-columns: 5fr 7fr; gap: 4rem; align-items: start; } }
.contact__intro p:not(.sec__lead) { color: var(--ink-2); }
.contact__box { background: var(--white); border: 1px solid var(--line); border-radius: 16px; padding: clamp(1.2rem, 4vw, 2.2rem); }
.c-grid { display: grid; grid-template-columns: 1fr; gap: 0 1.1rem; }
@media (min-width: 640px) { .c-grid { grid-template-columns: 1fr 1fr; } }
.c-field { display: flex; flex-direction: column; gap: .35rem; margin-bottom: 1.05rem; }
.c-field--wide { grid-column: 1 / -1; }
.c-field label { font-weight: 650; font-size: .97rem; }
.c-opt { color: var(--ink-2); font-weight: 400; }
.c-field input, .c-field textarea {
    width: 100%; min-height: 50px; padding: .65rem .85rem; font: inherit; color: var(--ink);
    background: var(--white); border: 1.5px solid #9DB0B9; border-radius: 8px;
}
.c-field textarea { min-height: 8rem; resize: vertical; }
.c-field input:focus, .c-field textarea:focus { border-color: var(--current); outline: 3px solid rgba(8,126,139,.22); outline-offset: 0; }
[aria-invalid="true"] { border-color: var(--danger) !important; background: #FFFBFA !important; }
.c-error { margin: .1rem 0 0; color: var(--danger); font-weight: 650; font-size: .92rem; }
.c-check { display: grid; grid-template-columns: auto 1fr; gap: .25rem .75rem; align-items: start; margin: .4rem 0 1.4rem; }
.c-check input { width: 1.35rem; height: 1.35rem; margin-top: .15rem; accent-color: var(--lake); }
.c-check label { font-size: .97rem; }
.c-check .c-error { grid-column: 2; }
.c-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.c-alert { padding: .85rem 1rem; margin-bottom: 1.2rem; border-radius: 8px; background: var(--danger-bg); border-left: 4px solid var(--danger); color: #7A160E; font-weight: 600; }
.c-alert:focus, .c-done:focus { outline: none; }
.c-form .site-btn { width: 100%; min-height: 54px; }
@media (min-width: 640px) { .c-form .site-btn { width: auto; } }
.c-done { padding: 1.4rem; border-radius: 10px; background: var(--ok-bg); border-left: 4px solid var(--ok); }
.c-done__title { font-size: 1.25rem; font-weight: 800; color: var(--ok); margin-bottom: .4rem; }
.c-done p:last-child { margin: 0; }

/* Pagine legali */
.legal__inner { max-width: 820px; }
.legal h2 { font-size: 1.25rem; color: var(--lake); margin: 2rem 0 .6rem; }
.legal__draft { padding: 1rem 1.2rem; border-radius: 10px; background: #FFF4DC; border-left: 4px solid #C77700; color: #5E3400; }
.legal__draft p { margin: 0; }
.legal__todo { color: var(--ink-2); font-style: italic; }
.legal__table { width: 100%; border-collapse: collapse; background: var(--white); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin-bottom: 1.2rem; font-size: .95rem; }
.legal__table th, .legal__table td { text-align: left; padding: .7rem .8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.legal__table th { background: var(--tint); font-weight: 700; }
@media (max-width: 640px) {
    .legal__table, .legal__table tbody, .legal__table tr, .legal__table td { display: block; }
    .legal__table thead { display: none; }
    .legal__table td { border: 0; padding: .35rem .8rem; }
}

/* ---------- Footer ---------- */
.site-foot { background: var(--deep); color: #B9D0D8; }
.site-foot__inner { max-width: var(--wrap); margin: 0 auto; padding: 3rem var(--gutter) 2rem; display: grid; gap: 1.6rem; }
@media (min-width: 800px) { .site-foot__inner { grid-template-columns: 1fr auto; } }
.site-foot__name { color: var(--white); font-weight: 800; font-size: 1.1rem; margin-bottom: .3rem; }
.site-foot__brand p { margin: 0 0 .2rem; }
.site-foot__legal { font-size: .9rem; }
.site-foot__links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; align-items: start; }
.site-foot__links a { color: var(--white); text-decoration: none; font-weight: 600; display: inline-block; padding: .3rem 0; }
.site-foot__links a:hover { text-decoration: underline; color: var(--white); }
.site-foot__copy { grid-column: 1 / -1; margin: 0; padding-top: 1.4rem; border-top: 1px solid rgba(207,230,238,.15); font-size: .88rem; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition: none !important; animation: none !important; }
}
