/* Studio Mazzavillani & Nicolai — foglio di stile principale */

@font-face {
    font-family: "Inter";
    src: url("../fonts/inter-var.woff2") format("woff2");
    font-weight: 100 900;
    font-display: swap;
}
@font-face {
    font-family: "Source Serif 4";
    src: url("../fonts/sourceserif4-var.woff2") format("woff2");
    font-weight: 200 900;
    font-display: swap;
}

:root {
    --ink: #1b2433;
    --ink-2: #2c3850;
    --text: #2a2f38;
    --muted: #5b6372;
    --bg: #faf8f4;
    --surface: #ffffff;
    --tint: #f2eee6;
    --line: #e3ddd2;
    --accent: #8a6227;
    --accent-light: #d8b679;
    --success: #1f6b45;
    --error: #b42318;

    --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-serif: "Source Serif 4", Georgia, "Times New Roman", serif;

    --radius: 14px;
    --radius-sm: 8px;
    --shadow: 0 1px 2px rgb(27 36 51 / .05), 0 8px 24px rgb(27 36 51 / .07);
    --container: 1160px;
    --gutter: clamp(16px, 4vw, 32px);
    --section: clamp(56px, 8vw, 104px);
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 90px; }
body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 1.0625rem;
    line-height: 1.65;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}
img, svg, picture { display: block; max-width: 100%; height: auto; }
a { color: var(--ink); text-decoration-color: var(--accent-light); text-underline-offset: 3px; }
a:hover { color: var(--accent); }
h1, h2, h3, h4, h5 {
    font-family: var(--font-serif);
    font-weight: 600;
    line-height: 1.15;
    color: var(--ink);
    margin: 0 0 .5em;
    letter-spacing: -.01em;
}
h1 { font-size: clamp(2.2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); }
h3 { font-size: 1.3rem; }
.h4 { font-size: 1.15rem; }
.h5 { font-size: 1rem; font-family: var(--font-sans); font-weight: 600; letter-spacing: 0; margin-bottom: .25em; }
p { margin: 0 0 1em; }
ul { margin: 0; padding: 0; }
address { font-style: normal; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition: none !important; animation: none !important; }
}

.visually-hidden {
    position: absolute !important; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap;
}
.skip-link {
    position: absolute; left: 16px; top: -100px; z-index: 100;
    background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--radius-sm);
}
.skip-link:focus { top: 12px; color: #fff; }
.break { overflow-wrap: anywhere; }
.muted { color: var(--muted); font-size: .95rem; }

/* ---------- layout ---------- */
.container { width: 100%; max-width: calc(var(--container) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: calc(820px + 2 * var(--gutter)); }
.section { padding: var(--section) 0; }
.section-top-tight { padding-top: 0; }
.section-tint { background: var(--tint); }
.section-dark { background: var(--ink); color: #d5dbe6; }
.section-dark h2 { color: #fff; }
.section-dark .eyebrow { color: var(--accent-light); }
.section-head { max-width: 680px; margin-bottom: clamp(32px, 5vw, 56px); }
.split { display: grid; gap: clamp(32px, 6vw, 72px); align-items: center; }
@media (min-width: 900px) {
    .split { grid-template-columns: 1fr 1fr; }
    .split-media { grid-template-columns: 1.1fr 1fr; }
}
.rounded { border-radius: var(--radius); box-shadow: var(--shadow); }

.eyebrow {
    font-family: var(--font-sans);
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: .9em;
}
.lead { font-size: clamp(1.1rem, 1.6vw, 1.25rem); color: var(--muted); max-width: 62ch; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* ---------- icone ---------- */
.icon { width: 1.15em; height: 1.15em; flex: none; display: inline-block; vertical-align: -.2em; }
.icon-md { width: 26px; height: 26px; color: var(--accent); }
.icon-lg { width: 40px; height: 40px; color: var(--accent); margin-bottom: 18px; }

/* ---------- bottoni ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .55em;
    font: 600 1rem/1 var(--font-sans);
    padding: 15px 24px; min-height: 48px;
    border-radius: 999px; border: 1.5px solid transparent;
    text-decoration: none; cursor: pointer;
    transition: background-color .2s, color .2s, border-color .2s, transform .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn-sm { padding: 11px 18px; min-height: 42px; font-size: .92rem; }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: var(--ink-2); color: #fff; }
.btn-ghost { border-color: var(--ink); color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: #fff; }
.btn-light { background: #fff; color: var(--ink); }
.btn-light:hover { background: var(--accent-light); color: var(--ink); }
.btn-outline-light { border-color: rgb(255 255 255 / .55); color: #fff; }
.btn-outline-light:hover { background: #fff; color: var(--ink); }
.link-arrow { display: inline-flex; align-items: center; gap: .4em; font-weight: 600; text-decoration: none; color: var(--ink); }
.link-arrow .icon { transition: transform .2s; }
.link-arrow:hover .icon { transform: translateX(3px); }

/* ---------- header ---------- */
.site-header {
    position: sticky; top: 0; z-index: 50;
    background: rgb(250 248 244 / .92);
    backdrop-filter: saturate(1.4) blur(10px);
    -webkit-backdrop-filter: saturate(1.4) blur(10px);
    border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 76px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); min-width: 0; }
.brand img { width: 44px; height: 44px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-name { font-family: var(--font-serif); font-weight: 600; font-size: 1.25rem; white-space: nowrap; }
.brand-sub { font-size: .78rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.site-nav { display: flex; align-items: center; gap: 28px; }
.site-nav ul { display: flex; gap: 26px; list-style: none; }
.site-nav ul a { text-decoration: none; font-weight: 500; font-size: .98rem; color: var(--text); padding: 6px 0; border-bottom: 2px solid transparent; }
.site-nav ul a:hover { color: var(--ink); border-color: var(--accent-light); }
.site-nav ul a[aria-current="page"] { color: var(--ink); border-color: var(--accent); }
.nav-toggle {
    display: none; width: 48px; height: 48px; border: 1px solid var(--line); border-radius: 12px;
    background: var(--surface); color: var(--ink); cursor: pointer; align-items: center; justify-content: center;
}
.nav-toggle .icon { width: 24px; height: 24px; }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-open { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }

@media (max-width: 1023px) {
    .nav-toggle { display: inline-flex; }
    .site-nav {
        position: absolute; left: 0; right: 0; top: 100%;
        flex-direction: column; align-items: stretch; gap: 20px;
        padding: 12px var(--gutter) 28px;
        background: var(--bg); border-bottom: 1px solid var(--line);
        box-shadow: 0 16px 24px rgb(27 36 51 / .08);
    }
    .site-nav ul { flex-direction: column; gap: 0; }
    .site-nav ul a { display: block; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 1.1rem; }
    .site-nav ul a[aria-current="page"] { color: var(--accent); border-color: var(--line); }
    /* con JS attivo il menu è chiuso di default; senza JS resta visibile */
    .js .site-nav { display: none; }
    .js .site-nav.is-open { display: flex; }
}
@media (max-width: 420px) {
    .brand-sub { display: none; }
    .brand-name { font-size: 1.1rem; }
}

/* ---------- hero ---------- */
.hero { padding: clamp(40px, 7vw, 96px) 0 var(--section); }
.hero-grid { display: grid; gap: clamp(36px, 6vw, 64px); align-items: center; }
@media (min-width: 900px) { .hero-grid { grid-template-columns: 1.05fr 1fr; } }
.hero h1 { margin-bottom: .4em; }
.amp { font-style: italic; color: var(--accent); font-weight: 400; }
.hero-media { margin: 0; position: relative; }
.hero-media img { border-radius: var(--radius); box-shadow: var(--shadow); aspect-ratio: 946 / 670; object-fit: cover; width: 100%; }
.hero-media figcaption {
    position: absolute; left: 16px; bottom: 16px;
    display: inline-flex; align-items: center; gap: 6px;
    background: rgb(255 255 255 / .94); color: var(--ink);
    padding: 8px 14px; border-radius: 999px; font-size: .88rem; font-weight: 500;
}
.hero-media figcaption .icon { color: var(--accent); }

.page-hero { padding: clamp(40px, 6vw, 80px) 0 clamp(32px, 5vw, 56px); }
.page-hero h1 { max-width: 20ch; }

/* ---------- griglie e card ---------- */
.feature-grid { list-style: none; display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
.feature-grid .feature:last-child:nth-child(odd) { grid-column: 1 / -1; }
@media (min-width: 960px) {
    .feature-grid { grid-template-columns: repeat(5, 1fr); }
    .feature-grid .feature:last-child:nth-child(odd) { grid-column: auto; }
}
@media (max-width: 380px) { .feature { padding: 22px 18px; } }
.feature {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 28px 24px;
}
.feature h3 { font-size: 1.12rem; margin: 0; }
.card-grid { display: grid; gap: 20px; }
@media (min-width: 720px) { .card-grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .card-grid-3 { grid-template-columns: repeat(3, 1fr); } }
.card {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: clamp(24px, 3vw, 36px); display: flex; flex-direction: column;
}
.card p { color: var(--muted); }
.card .link-arrow { margin-top: auto; }

.person picture { margin-bottom: 20px; }
.person img { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; border: 4px solid var(--tint); }
.person h3 { margin-bottom: .15em; }
.person .role { color: var(--accent); font-weight: 600; font-size: .92rem; margin-bottom: 1.1em; }

.check-list { list-style: none; display: grid; gap: 10px; }
.check-list li { position: relative; padding-left: 28px; }
.check-list li::before {
    content: ""; position: absolute; left: 0; top: .5em;
    width: 14px; height: 8px; border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent);
    transform: rotate(-45deg) translateY(-2px);
}
.check-list-light li { color: #fff; }
.check-list-light li::before { border-color: var(--accent-light); }
@media (min-width: 640px) { .columns-2 { grid-template-columns: 1fr 1fr; column-gap: 32px; } }
.card .check-list { font-size: .97rem; }

/* ---------- servizi ---------- */
.services { display: grid; gap: 24px; }
.service-block {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: clamp(24px, 4vw, 48px); display: grid; gap: 24px 48px;
}
@media (min-width: 900px) { .service-block { grid-template-columns: 300px 1fr; } }
.service-block h2 { font-size: clamp(1.4rem, 2.4vw, 1.75rem); }

/* ---------- info box / orari ---------- */
.info-box { background: var(--tint); border-radius: var(--radius); padding: 24px; margin: 24px 0; }
.info-box h2 { display: flex; gap: 8px; align-items: center; }
.info-box h2 .icon { color: var(--accent); }
.info-box .check-list { font-size: .97rem; }
.trust { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 24px; color: var(--muted); font-size: .93rem; }
.trust li { display: inline-flex; align-items: center; gap: 8px; }
.trust .icon { color: var(--accent); }
.footer-insurance { display: flex; align-items: center; gap: 8px; font-size: .88rem; }
.footer-insurance .icon { color: var(--accent-light); }
.hours { display: grid; grid-template-columns: auto 1fr; gap: 4px 20px; margin: 0; }
.hours dt { font-weight: 600; }
.hours dd { margin: 0; }

/* ---------- contatti ---------- */
.contact-grid { display: grid; gap: clamp(32px, 5vw, 56px); align-items: start; }
@media (min-width: 960px) { .contact-grid { grid-template-columns: 1fr 1.25fr; } }
.info-list { list-style: none; display: grid; gap: 28px; }
.info-list li { display: flex; gap: 18px; }
.info-list p { margin-bottom: .6em; }
.info-list .h5:not(:first-child) { margin-top: 1em; }

/* ---------- form ---------- */
.form-card {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: clamp(24px, 4vw, 44px); box-shadow: var(--shadow);
}
.form-grid { display: grid; gap: 18px 20px; }
@media (min-width: 640px) { .form-grid { grid-template-columns: 1fr 1fr; } }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-full { grid-column: 1 / -1; }
.field > label, .field legend { font-weight: 600; font-size: .95rem; color: var(--ink); }
fieldset.field { border: 0; padding: 0; margin: 0; }
fieldset.field legend { margin-bottom: 10px; padding: 0; }
.req { color: var(--error); }
input[type="text"], input[type="email"], input[type="tel"], textarea {
    width: 100%; font: inherit; font-size: 1rem; color: var(--text);
    background: #fff; border: 1.5px solid #cfc8bb; border-radius: var(--radius-sm);
    padding: 12px 14px; min-height: 48px;
    transition: border-color .2s, box-shadow .2s;
}
textarea { resize: vertical; min-height: 130px; }
input:focus, textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgb(27 36 51 / .12); }
[aria-invalid="true"] { border-color: var(--error) !important; }
.field-error { color: var(--error); font-size: .88rem; margin: 0; }
.field-captcha input { max-width: 140px; }
.checks { display: grid; gap: 10px; }
@media (min-width: 640px) { .checks { grid-template-columns: 1fr 1fr; } }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400 !important; font-size: .95rem; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--ink); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.alert { border-radius: var(--radius-sm); padding: 16px 18px; margin-bottom: 24px; }
.alert-success { background: #e8f4ec; color: var(--success); border: 1px solid #b9dcc6; }
.alert-error { background: #fdecea; color: var(--error); border: 1px solid #f4c3bd; }

/* tab Azienda / Privato */
.segmented { border: 0; padding: 0; margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 10px; }
.segmented legend { font-weight: 600; color: var(--ink); margin-bottom: 12px; padding: 0; font-size: 1.05rem; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label {
    flex: 1 1 160px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 14px 18px; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
    font-weight: 600; cursor: pointer; background: var(--bg); transition: all .2s;
}
.segmented input:checked + label { border-color: var(--ink); background: var(--ink); color: #fff; }
.segmented input:focus-visible + label { outline: 3px solid var(--accent); outline-offset: 2px; }
.tabs .form-grid { margin-top: 24px; }
.tabs:has(#per-privato:checked) .tab-azienda { display: none; }
.tabs:not(:has(#per-privato:checked)) .tab-privato { display: none; }

/* ---------- CTA ---------- */
.cta { background: var(--ink-2); color: #d5dbe6; padding: clamp(48px, 6vw, 72px) 0; }
.cta h2 { color: #fff; margin-bottom: .25em; }
.cta p { margin: 0; }
.cta-inner { display: flex; flex-wrap: wrap; gap: 24px 48px; align-items: center; justify-content: space-between; }
.cta .actions { margin-top: 0; }

/* ---------- testi legali ---------- */
.prose { max-width: 72ch; }
.prose h2 { font-size: 1.5rem; margin-top: 1.8em; }
.prose h3 { font-size: 1.15rem; margin-top: 1.4em; }
.prose ul { padding-left: 1.3em; margin-bottom: 1em; }
.prose li { margin-bottom: .35em; }
.table-wrap { overflow-x: auto; margin: 1em 0 1.5em; }
.prose table { border-collapse: collapse; width: 100%; font-size: .95rem; min-width: 560px; }
.prose th, .prose td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; vertical-align: top; }
.prose th { background: var(--tint); }

/* ---------- 404 ---------- */
.not-found { text-align: center; padding: var(--section) 0; }
.not-found .code { font-family: var(--font-serif); font-size: clamp(5rem, 15vw, 9rem); line-height: 1; color: var(--accent-light); margin-bottom: 8px; }
.not-found .lead { margin-inline: auto; }
.not-found .actions { justify-content: center; }

/* ---------- footer ---------- */
.site-footer { background: var(--ink); color: #b9c1cf; font-size: .95rem; padding-top: clamp(48px, 6vw, 72px); }
.site-footer a { color: #fff; text-decoration-color: rgb(255 255 255 / .3); }
.site-footer a:hover { color: var(--accent-light); }
.footer-grid { display: grid; gap: 36px; padding-bottom: 40px; }
@media (min-width: 640px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .footer-grid { grid-template-columns: 1.4fr 1.2fr 1fr .8fr; } }
.footer-brand img { width: 48px; height: 48px; margin-bottom: 14px; }
.footer-name { font-family: var(--font-serif); font-size: 1.2rem; color: #fff; margin-bottom: .2em; }
.footer-title { font-family: var(--font-sans); font-size: .8rem; text-transform: uppercase; letter-spacing: .14em; color: var(--accent-light); margin-bottom: 1em; }
.footer-links { list-style: none; display: grid; gap: 8px; }
.footer-links a { text-decoration: none; }
.site-footer .hours dt { color: #fff; font-weight: 500; }
.social { list-style: none; display: flex; gap: 10px; margin-top: 18px; }
.social a {
    display: inline-flex; width: 44px; height: 44px; align-items: center; justify-content: center;
    border: 1px solid rgb(255 255 255 / .2); border-radius: 50%;
}
.social a:hover { background: #fff; color: var(--ink); }
.social .icon { width: 20px; height: 20px; }
.footer-bottom {
    display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px;
    border-top: 1px solid rgb(255 255 255 / .12); padding-top: 20px; padding-bottom: 24px; font-size: .85rem;
}
.footer-bottom p { margin: 0; }

/* ---------- cookie banner ---------- */
.cookie-banner {
    position: fixed; z-index: 60; left: 16px; right: 16px; bottom: 16px;
    max-width: 560px; margin-left: auto;
    background: var(--surface); color: var(--text);
    border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 12px 40px rgb(27 36 51 / .2);
    padding: 20px 22px; display: flex; flex-wrap: wrap; gap: 14px 20px; align-items: center;
    font-size: .93rem;
}
.cookie-banner[hidden] { display: none; }
.cookie-banner p { margin: 0; flex: 1 1 260px; }

@media print {
    .site-header, .site-footer, .cookie-banner, .cta { display: none; }
    body { background: #fff; }
}
