/* Sito pubblico — verde, bianco, grigio.
   Scritto a mano e senza build: nessuna dipendenza da vite per andare online. */

:root {
    --brand-50: #ecfdf5;
    --brand-100: #d1fae5;
    --brand-500: #10b981;
    --brand-600: #059669;
    --brand-700: #047857;
    --brand-900: #064e3b;

    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-900: #111827;

    --warn: #b45309;
    --danger: #b91c1c;

    --radius: 10px;
    --shadow: 0 1px 2px rgba(17, 24, 39, .04), 0 10px 30px -20px rgba(17, 24, 39, .25);
    --measure: 68ch;
}

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

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.65;
    color: var(--gray-700);
    background: #fff;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { color: var(--gray-900); line-height: 1.15; margin: 0; text-wrap: balance; letter-spacing: -.02em; }
h1 { font-size: clamp(2rem, 5vw, 3.25rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 3vw, 2.125rem); font-weight: 700; }
h3 { font-size: 1.1875rem; font-weight: 650; }
p { margin: 0 0 1rem; max-width: var(--measure); }
a { color: var(--brand-700); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--brand-600); outline-offset: 3px; border-radius: 3px; }
img { max-width: 100%; height: auto; display: block; }

.wrap { max-width: 1140px; margin: 0 auto; padding: 0 1.5rem; }
.narrow { max-width: 780px; }

/* ---------------------------------------------------------------- header */
.site-header {
    position: sticky; top: 0; z-index: 40;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--gray-200);
}
.site-header__inner { display: flex; align-items: center; gap: 2rem; height: 68px; }
.brand { display: flex; align-items: center; gap: .625rem; font-weight: 750; color: var(--gray-900); font-size: 1.0625rem; letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand__mark {
    width: 30px; height: 30px; border-radius: 8px;
    background: var(--brand-600); color: #fff;
    display: grid; place-items: center; font-size: .8125rem; font-weight: 800;
}
.brand img { max-height: 34px; width: auto; }
.nav { display: none; gap: 1.75rem; margin-left: auto; align-items: center; }
.nav a { color: var(--gray-600); font-size: .9375rem; font-weight: 500; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--brand-700); text-decoration: none; }
/* La regola generica su .nav a vincerebbe per specificità e lascerebbe
   il pulsante con testo verde su fondo verde. */
.nav a.btn--primary, .nav a.btn--primary:hover { color: #fff; }
.nav a.btn--ghost { color: var(--gray-700); }
@media (min-width: 900px) { .nav { display: flex; } }
.nav-toggle { margin-left: auto; background: none; border: 1px solid var(--gray-200); border-radius: 8px; padding: .5rem .75rem; cursor: pointer; color: var(--gray-700); }
@media (min-width: 900px) { .nav-toggle { display: none; } }
.nav-mobile { display: none; border-top: 1px solid var(--gray-200); padding: .75rem 0 1rem; }
.nav-mobile[data-open="true"] { display: block; }
.nav-mobile a { display: block; padding: .625rem 0; color: var(--gray-700); font-weight: 500; }

/* ---------------------------------------------------------------- buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    padding: .75rem 1.375rem; border-radius: var(--radius);
    font-size: .9375rem; font-weight: 600; border: 1px solid transparent;
    cursor: pointer; transition: background-color .15s, border-color .15s, color .15s;
    text-decoration: none; line-height: 1.2;
}
.btn:hover { text-decoration: none; }
.btn--primary { background: var(--brand-600); color: #fff; }
.btn--primary:hover { background: var(--brand-700); color: #fff; }
.btn--ghost { background: #fff; color: var(--gray-700); border-color: var(--gray-300); }
.btn--ghost:hover { border-color: var(--brand-600); color: var(--brand-700); }
.btn--sm { padding: .5rem 1rem; font-size: .875rem; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------------------------------------------------------------- hero */
.hero { padding: clamp(3.5rem, 8vw, 6rem) 0 clamp(3rem, 6vw, 4.5rem); background: linear-gradient(180deg, var(--brand-50), #fff); }
.hero__eyebrow {
    font-size: .75rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
    color: var(--brand-700); margin: 0 0 1rem;
}
.hero__lede { font-size: 1.1875rem; color: var(--gray-600); max-width: 58ch; margin: 1.25rem 0 2rem; }
.hero__actions { display: flex; flex-wrap: wrap; gap: .75rem; }

/* ---------------------------------------------------------------- sections */
.section { padding: clamp(3rem, 6vw, 5rem) 0; }
.section--tint { background: var(--gray-50); }
.section__head { margin-bottom: 2.5rem; }
.section__head p { color: var(--gray-600); margin-top: .75rem; }

.grid { display: grid; gap: 1.25rem; }
.grid--2 { grid-template-columns: 1fr; }
.grid--3 { grid-template-columns: 1fr; }
@media (min-width: 720px) { .grid--2, .grid--3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .grid--3 { grid-template-columns: repeat(3, 1fr); } }

.card {
    background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius);
    padding: 1.5rem; display: flex; flex-direction: column; gap: .625rem;
    transition: border-color .15s, box-shadow .15s;
}
.card--link:hover { border-color: var(--brand-500); box-shadow: var(--shadow); text-decoration: none; }
.card h3 { color: var(--gray-900); }
.card p { color: var(--gray-600); font-size: .9375rem; margin: 0; max-width: none; }
.card__meta { margin-top: auto; padding-top: .75rem; font-size: .8125rem; color: var(--gray-500); font-weight: 500; }
.card__mark {
    width: 40px; height: 40px; border-radius: 9px; background: var(--brand-50);
    color: var(--brand-700); display: grid; place-items: center; font-weight: 800; font-size: .9375rem;
}

.chip {
    display: inline-flex; align-items: center; gap: .3rem;
    background: var(--gray-100); color: var(--gray-600);
    border-radius: 999px; padding: .25rem .625rem;
    font-size: .75rem; font-weight: 600;
}
.chip--brand { background: var(--brand-50); color: var(--brand-700); }

/* ---------------------------------------------------------------- forms */
.field { display: flex; flex-direction: column; gap: .375rem; margin-bottom: 1.125rem; }
.field label { font-size: .875rem; font-weight: 600; color: var(--gray-700); }
.field .hint { font-size: .8125rem; color: var(--gray-500); }
.field .error { font-size: .8125rem; color: var(--danger); font-weight: 500; }
input[type="text"], input[type="email"], input[type="tel"], input[type="number"], select, textarea {
    width: 100%; padding: .6875rem .875rem; font: inherit; font-size: .9375rem;
    color: var(--gray-900); background: #fff;
    border: 1px solid var(--gray-300); border-radius: 8px;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand-600); outline: none; box-shadow: 0 0 0 3px var(--brand-100); }
textarea { min-height: 110px; resize: vertical; }
.field-row { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .field-row--2 { grid-template-columns: 1fr 1fr; } }

/* ---------------------------------------------------------------- configurator */
.config { display: grid; gap: 2rem; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 960px) { .config { grid-template-columns: 1fr 340px; } }

.panel {
    background: #fff; border: 1px solid var(--gray-200);
    border-radius: var(--radius); padding: 1.5rem;
}
.panel__title { font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--gray-500); margin: 0 0 1.25rem; }

.quote-panel { position: sticky; top: 88px; border: 1.5px solid var(--brand-600); border-radius: var(--radius); overflow: hidden; }
.quote-panel__body { padding: 1.5rem; background: var(--brand-50); }
.quote-panel__price { font-size: 2.5rem; font-weight: 800; color: var(--brand-900); line-height: 1; font-variant-numeric: tabular-nums; }
.quote-panel__unit { font-size: .875rem; color: var(--brand-700); margin-top: .375rem; }
.quote-panel__rows { list-style: none; margin: 1.25rem 0 0; padding: 1.25rem 0 0; border-top: 1px solid var(--brand-100); display: flex; flex-direction: column; gap: .5rem; }
.quote-panel__rows li { display: flex; justify-content: space-between; gap: 1rem; font-size: .875rem; color: var(--brand-900); }
.quote-panel__rows strong { font-variant-numeric: tabular-nums; }
.quote-panel__foot { padding: 1.25rem 1.5rem; background: #fff; border-top: 1px solid var(--gray-200); }
.quote-panel__note { font-size: .75rem; color: var(--gray-500); margin: .75rem 0 0; }

.loading { opacity: .55; transition: opacity .12s; }

/* ---------------------------------------------------------------- quote document */
.doc { background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius); overflow: hidden; }
.doc__head { padding: 2rem; border-bottom: 1px solid var(--gray-200); display: flex; flex-wrap: wrap; gap: 1.5rem; justify-content: space-between; align-items: flex-start; }
.doc__number { font-size: .8125rem; color: var(--gray-500); font-weight: 600; letter-spacing: .04em; }
.doc__lines { width: 100%; border-collapse: collapse; }
.doc__lines th { text-align: left; font-size: .6875rem; text-transform: uppercase; letter-spacing: .08em; color: var(--gray-500); padding: .875rem 2rem; background: var(--gray-50); border-bottom: 1px solid var(--gray-200); }
.doc__lines td { padding: 1.125rem 2rem; border-bottom: 1px solid var(--gray-100); vertical-align: top; }
.doc__lines .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.doc__spec { font-size: .875rem; color: var(--gray-500); margin-top: .25rem; }
.doc__totals { padding: 1.5rem 2rem; background: var(--gray-50); }
.doc__totals dl { display: flex; flex-direction: column; gap: .5rem; margin: 0; max-width: 340px; margin-left: auto; }
.doc__totals div { display: flex; justify-content: space-between; gap: 2rem; font-size: .9375rem; }
.doc__totals .grand { border-top: 1px solid var(--gray-300); padding-top: .625rem; margin-top: .25rem; font-size: 1.125rem; font-weight: 700; color: var(--gray-900); }
.doc__actions { padding: 1.5rem 2rem; display: flex; flex-wrap: wrap; gap: .75rem; border-top: 1px solid var(--gray-200); }

/* ---------------------------------------------------------------- alerts */
.alert { border-radius: var(--radius); padding: 1rem 1.25rem; margin-bottom: 1.5rem; font-size: .9375rem; border: 1px solid; }
.alert--ok { background: var(--brand-50); border-color: var(--brand-500); color: var(--brand-900); }
.alert--warn { background: #fffbeb; border-color: #fcd34d; color: var(--warn); }
.alert--error { background: #fef2f2; border-color: #fca5a5; color: var(--danger); }
.alert strong { display: block; margin-bottom: .25rem; }

/* ---------------------------------------------------------------- footer */
.site-footer { border-top: 1px solid var(--gray-200); background: var(--gray-50); padding: 3rem 0 2rem; margin-top: 4rem; font-size: .875rem; color: var(--gray-500); }
.site-footer__grid { display: grid; gap: 2rem; grid-template-columns: 1fr; margin-bottom: 2rem; }
@media (min-width: 720px) { .site-footer__grid { grid-template-columns: 2fr 1fr 1fr; } }
.site-footer h4 { font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; color: var(--gray-500); margin-bottom: .75rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.site-footer a { color: var(--gray-600); }
.site-footer__legal { border-top: 1px solid var(--gray-200); padding-top: 1.5rem; font-size: .8125rem; }

.steps { list-style: none; counter-reset: s; margin: 0; padding: 0; display: grid; gap: 1.25rem; }
@media (min-width: 720px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .steps { grid-template-columns: repeat(4, 1fr); } }
.steps li { counter-increment: s; padding-top: 1rem; border-top: 2px solid var(--brand-500); }
.steps li::before { content: counter(s, decimal-leading-zero); display: block; font-size: .75rem; font-weight: 700; color: var(--brand-600); letter-spacing: .1em; margin-bottom: .5rem; }
.steps h3 { margin-bottom: .375rem; }
.steps p { font-size: .9375rem; color: var(--gray-600); margin: 0; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

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

/* Prova grafica: la bozza è la cosa più grande della pagina, poi le due scelte. */
.proof { margin-top: 1.5rem; border: 1px solid var(--gray-200); border-radius: 12px; overflow: hidden; background: var(--gray-50); }
.proof img { display: block; width: 100%; height: auto; }
.proof object { display: block; width: 100%; height: min(75vh, 900px); border: 0; }
.proof__none { margin: 0; padding: 3rem 1.5rem; text-align: center; color: var(--gray-500); font-size: .9375rem; }

.proof__feedback { margin-top: 1.25rem; padding: 1rem 1.25rem; border-left: 3px solid var(--gray-300); background: var(--gray-50); border-radius: 0 8px 8px 0; }
.proof__label { margin: 0 0 .25rem; font-size: .6875rem; letter-spacing: .08em; text-transform: uppercase; color: var(--gray-500); font-weight: 700; }
.proof__feedback p:last-child { margin: 0; font-size: .9375rem; line-height: 1.6; }

.proof__actions { display: grid; gap: 1.25rem; margin-top: 1.75rem; }
@media (min-width: 820px) { .proof__actions { grid-template-columns: 1fr 1fr; align-items: start; } }
.proof__form { border: 1px solid var(--gray-200); border-radius: 12px; padding: 1.25rem; display: flex; flex-direction: column; gap: .5rem; }
.proof__form label { font-size: .75rem; font-weight: 700; color: var(--gray-600); }
.proof__form input, .proof__form textarea {
    font: inherit; padding: .6rem .75rem; border: 1px solid var(--gray-300); border-radius: 8px; width: 100%;
}
.proof__form textarea { resize: vertical; }
.proof__form .btn { margin-top: .35rem; }
.proof__hint { margin: .25rem 0 0; font-size: .75rem; color: var(--gray-500); line-height: 1.5; }
