/* Font ospitati localmente (nessuna chiamata a Google Fonts: conformità GDPR) */
@font-face { font-family: 'Lato'; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/lato-400.woff2) format('woff2'); }
@font-face { font-family: 'Lato'; font-style: normal; font-weight: 700; font-display: swap; src: url(/fonts/lato-700.woff2) format('woff2'); }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 500; font-display: swap; src: url(/fonts/poppins-500.woff2) format('woff2'); }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 600; font-display: swap; src: url(/fonts/poppins-600.woff2) format('woff2'); }

:root {
    --color-primary: #0c71c3;
    --color-primary-dark: #095a9c;
    --color-text: #2b2e3c;
    --color-text-muted: #4c5370;
    --color-bg: #ffffff;
    --color-bg-muted: #f0f2f8;
    --color-border: #e3e6f0;
    --color-dark: #1a1d2b;
    --font-heading: 'Poppins', system-ui, sans-serif;
    --font-body: 'Lato', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --max-width: 1175px;
    --header-h: 76px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 12px); }
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition: none !important; animation: none !important; }
}

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 1.0625rem;
    color: var(--color-text-muted);
    background: var(--color-bg);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}
body.nav-open { overflow: hidden; }

img { max-width: 100%; height: auto; display: block; }

a { color: var(--color-primary); text-decoration: none; transition: color .2s ease, opacity .2s ease; }
a:hover { opacity: .8; }
:focus-visible { outline: 3px solid var(--color-primary); outline-offset: 2px; }

h1, h2, h3 {
    font-family: var(--font-heading);
    color: var(--color-text);
    font-weight: 600;
    line-height: 1.25;
    margin: 0 0 .75rem;
}
h1 { font-size: clamp(1.8rem, 4.5vw, 2.6rem); }
h2 { font-size: clamp(1.45rem, 3.4vw, 1.9rem); }
h3 { font-size: 1.15rem; }

.skip-link {
    position: absolute; left: -9999px; top: 0; z-index: 2000;
    background: var(--color-primary); color: #fff; padding: .75rem 1rem;
}
.skip-link:focus { left: 1rem; top: 1rem; }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 clamp(18px, 4vw, 24px); }

.eyebrow {
    color: var(--color-primary);
    font-family: var(--font-heading);
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    font-size: .8rem;
    margin: 0 0 .5rem;
}
.center { text-align: center; margin-left: auto; margin-right: auto; }
.lead-text { max-width: 660px; }

/* Buttons: altezza minima 48px per il touch */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: .8rem 1.8rem;
    border-radius: 6px;
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: 1rem;
    line-height: 1.2;
    border: 2px solid transparent;
    cursor: pointer;
    text-align: center;
    transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.btn:hover { opacity: 1; }
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:hover { background: var(--color-primary-dark); }
.btn-outline { border-color: var(--color-primary); color: var(--color-primary); background: transparent; }
.btn-outline:hover { background: var(--color-primary); color: #fff; }
.btn-ghost { border-color: rgba(255,255,255,.8); color: #fff; }
.btn-ghost:hover { background: #fff; color: var(--color-text); }
.btn-light { background: #fff; color: var(--color-primary); }
.btn-light:hover { background: var(--color-bg-muted); }
.btn-sm { min-height: 42px; padding: .55rem 1.1rem; font-size: .92rem; }
.btn-block { width: 100%; }
.btn + .btn { margin-left: .5rem; }

.link-button {
    background: none; border: 0; padding: 0; font: inherit; color: inherit;
    text-decoration: underline; cursor: pointer;
}

/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255,255,255,.97);
    backdrop-filter: saturate(160%) blur(8px);
    border-bottom: 1px solid var(--color-border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); }
.logo { font-family: var(--font-heading); font-size: 1.3rem; font-weight: 600; color: var(--color-text); }
.logo span { color: var(--color-primary); }

.main-nav { display: flex; align-items: center; gap: 2rem; }
.main-nav a {
    color: var(--color-text-muted);
    font-family: var(--font-heading);
    font-size: .95rem;
    font-weight: 500;
    padding: .5rem 0;
    border-bottom: 2px solid transparent;
}
.main-nav a.active, .main-nav a:hover { color: var(--color-primary); border-bottom-color: var(--color-primary); opacity: 1; }
.main-nav .nav-cta {
    background: var(--color-primary); color: #fff; padding: .6rem 1.2rem; border-radius: 6px; border: 0;
}
.main-nav .nav-cta:hover, .main-nav .nav-cta.active { background: var(--color-primary-dark); color: #fff; }

.nav-toggle {
    display: none;
    position: relative;
    width: 48px; height: 48px;
    margin-right: -10px;
    background: none; border: none; cursor: pointer;
}
.nav-toggle span {
    position: absolute; left: 12px; right: 12px; height: 2px;
    background: var(--color-text); border-radius: 2px;
    transition: transform .25s ease, opacity .2s ease;
}
.nav-toggle span:nth-child(1) { top: 16px; }
.nav-toggle span:nth-child(2) { top: 23px; }
.nav-toggle span:nth-child(3) { top: 30px; }
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Hero */
.hero {
    position: relative;
    color: #fff;
    padding: clamp(5rem, 14vw, 9rem) 0 clamp(4rem, 10vw, 7rem);
    overflow: hidden;
    background: #2a3d4a;
}
.hero-bg {
    position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0;
}
.hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, rgba(15,20,35,.72), rgba(15,20,35,.35)); z-index: 1; }
.hero-inner { position: relative; z-index: 2; }
.hero-kicker { text-transform: uppercase; letter-spacing: .1em; font-family: var(--font-heading); font-size: .82rem; margin: 0 0 .75rem; color: rgba(255,255,255,.85); }
.hero h1 { color: #fff; font-size: clamp(2.2rem, 7vw, 3.4rem); margin-bottom: 1rem; }
.hero .lead { max-width: 480px; font-size: clamp(1.05rem, 2.6vw, 1.25rem); color: rgba(255,255,255,.92); margin: 0 0 2rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.hero-actions .btn + .btn { margin-left: 0; }

/* Page header */
.page-header { background: var(--color-bg-muted); padding: clamp(2.5rem, 7vw, 4rem) 0; text-align: center; }
.page-header h1 { margin-bottom: .5rem; }
.page-header .lead-text { margin: 0 auto; }
.page-header-compact { padding: clamp(2rem, 5vw, 3rem) 0; }

/* Sections */
.section { padding: clamp(3rem, 8vw, 5rem) 0; }
.section-muted { background: var(--color-bg-muted); }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 3.5rem); align-items: center; }
.two-col.reverse .col-image { order: 2; }
.two-col.reverse .col-text { order: 1; }
.col-image img { border-radius: 8px; width: 100%; }
.col-text .btn { margin-top: .5rem; }

blockquote {
    border-left: 3px solid var(--color-primary);
    margin: 1.5rem 0;
    padding: .25rem 0 .25rem 1.25rem;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--color-text);
}

/* Galleria */
.gallery-preview, .gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    list-style: none;
    padding: 0;
    margin: 2.5rem 0 0;
}
.gallery-grid { margin-top: 0; }
.gallery-item { display: block; overflow: hidden; border-radius: 6px; position: relative; background: var(--color-bg-muted); }
.gallery-grid .gallery-item { cursor: zoom-in; }
.gallery-item img {
    width: 100%;
    aspect-ratio: 3 / 2;
    height: auto;
    object-fit: cover;
    transition: transform .35s ease;
}
.gallery-item:hover { opacity: 1; }
.gallery-item:hover img { transform: scale(1.05); }
.gallery-caption {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    padding: 1.6rem .9rem .6rem;
    background: linear-gradient(transparent, rgba(15,20,35,.8));
    color: #fff;
    font-family: var(--font-heading);
    font-size: .9rem;
    opacity: 0;
    transition: opacity .25s ease;
}
.gallery-item:hover .gallery-caption, .gallery-item:focus-visible .gallery-caption { opacity: 1; }
@media (hover: none) { .gallery-caption { opacity: 1; } }

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(10,12,20,.95);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 4rem 4.5rem calc(1.5rem + var(--safe-bottom));
    touch-action: pan-y;
}
.lightbox.open { display: flex; }
.lightbox-stage { display: flex; flex-direction: column; align-items: center; justify-content: center; max-width: 100%; max-height: 100%; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 11rem); max-height: calc(100dvh - 11rem); border-radius: 4px; object-fit: contain; }
.lightbox-info { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .75rem 1.25rem; margin-top: 1rem; }
.lightbox-info p { color: #fff; font-family: var(--font-heading); margin: 0; font-size: 1.1rem; }
.lightbox-close, .lightbox-nav {
    position: absolute;
    background: rgba(255,255,255,.08);
    border: none;
    color: #fff;
    cursor: pointer;
    line-height: 1;
    border-radius: 50%;
    width: 52px; height: 52px;
    display: flex; align-items: center; justify-content: center;
}
.lightbox-close:hover, .lightbox-nav:hover { background: rgba(255,255,255,.2); }
.lightbox-close { top: 1rem; right: 1rem; font-size: 2rem; }
.lightbox-nav { top: 50%; transform: translateY(-50%); font-size: 2.6rem; padding-bottom: 6px; }
.lightbox-prev { left: 1rem; }
.lightbox-next { right: 1rem; }

/* CTA di fondo pagina */
.cta-band { background: var(--color-primary); color: rgba(255,255,255,.92); padding: clamp(2.5rem, 6vw, 3.5rem) 0; }
.cta-inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem 3rem; }
.cta-band h2 { color: #fff; margin-bottom: .4rem; }
.cta-band p { margin: 0; max-width: 620px; }
.cta-band .btn { flex-shrink: 0; }

/* Pulsante contatto flottante (solo mobile) */
.mobile-cta { display: none; }

/* Contatti */
.contact-layout { display: grid; grid-template-columns: 1.4fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.contact-aside { background: var(--color-bg-muted); border-radius: 10px; padding: clamp(1.5rem, 4vw, 2rem); }
.benefits { list-style: none; padding: 0; margin: 0 0 1.5rem; }
.benefits li { position: relative; padding-left: 1.8rem; margin-bottom: .9rem; }
.benefits li::before { content: '✓'; position: absolute; left: 0; top: 0; color: var(--color-primary); font-weight: 700; }
.benefits strong { color: var(--color-text); }
.contact-direct { border-top: 1px solid var(--color-border); padding-top: 1.25rem; }
.contact-direct p { margin: 0; word-break: break-word; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.25rem; }
.contact-form .form-group { margin-bottom: 1.25rem; }
.contact-form label {
    display: block;
    font-family: var(--font-heading);
    font-size: .9rem;
    font-weight: 500;
    color: var(--color-text);
    margin-bottom: .4rem;
}
.req { color: #b3261e; }
.optional { font-weight: 400; color: var(--color-text-muted); font-family: var(--font-body); }
.contact-form input[type=text],
.contact-form input[type=email],
.contact-form input[type=tel],
.contact-form select,
.contact-form textarea {
    width: 100%;
    min-height: 50px;
    padding: .75rem 1rem;
    border: 1px solid #cfd4e2;
    border-radius: 6px;
    font-family: var(--font-body);
    font-size: 16px; /* evita lo zoom automatico su iOS */
    color: var(--color-text);
    background: #fff;
    -webkit-appearance: none;
    appearance: none;
}
.contact-form select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%232b2e3c' stroke-width='2' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}
.contact-form textarea { resize: vertical; min-height: 150px; }
.contact-form input:focus, .contact-form select:focus, .contact-form textarea:focus {
    outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(12,113,195,.18);
}
.contact-form.was-validated :invalid { border-color: #b3261e; }
.form-check { display: flex; gap: .75rem; align-items: flex-start; }
.form-check input { width: 22px; height: 22px; margin: .15rem 0 0; flex-shrink: 0; accent-color: var(--color-primary); }
.contact-form .form-check label { font-family: var(--font-body); font-weight: 400; font-size: .95rem; color: var(--color-text-muted); margin: 0; }
.contact-form.was-validated .form-check input:invalid + label { color: #b3261e; }
.form-note { font-size: .85rem; margin: .9rem 0 0; }
.hp-field { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.alert { padding: 1rem 1.25rem; border-radius: 6px; margin-bottom: 1.5rem; font-size: .98rem; }
.alert-success { background: #e5f6ec; color: #1c7a42; }
.alert-error { background: #fbe9e9; color: #b3261e; }
.alert-error ul { margin: 0; padding-left: 1.1rem; }

/* Pagine legali */
.legal-content { max-width: 820px; }
.legal-content h2 { font-size: 1.35rem; margin-top: 2.25rem; }
.legal-content h3 { margin-top: 1.5rem; }
.legal-updated { font-size: .9rem; color: var(--color-text-muted); }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 1rem 0 1.5rem; }
.legal table { width: 100%; border-collapse: collapse; font-size: .95rem; min-width: 560px; }
.legal th, .legal td { border: 1px solid var(--color-border); padding: .7rem .8rem; text-align: left; vertical-align: top; }
.legal th { background: var(--color-bg-muted); color: var(--color-text); font-family: var(--font-heading); font-weight: 500; }
.legal code { font-size: .88em; background: var(--color-bg-muted); padding: .1em .35em; border-radius: 3px; }

/* Footer */
.site-footer { background: var(--color-dark); color: rgba(255,255,255,.72); padding: 3.5rem 0 0; }
.footer-inner {
    display: flex; flex-wrap: wrap; gap: 2rem; justify-content: space-between;
    padding-bottom: 2.5rem; border-bottom: 1px solid rgba(255,255,255,.1);
}
.footer-brand .logo { color: #fff; margin: 0; }
.footer-brand p { margin: .3rem 0 0; }
.footer-nav { display: flex; flex-wrap: wrap; gap: .25rem 1.5rem; }
.footer-nav a, .footer-nav a:visited { color: rgba(255,255,255,.75); padding: .35rem 0; }
.footer-contact a { color: #fff; }
.footer-bottom { padding: 1.5rem 0 calc(1.5rem + var(--safe-bottom)); font-size: .85rem; }
.footer-bottom-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 2rem; }
.footer-bottom p { margin: 0; }
.footer-legal { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; }
.footer-legal a, .footer-legal .link-button { color: rgba(255,255,255,.75); text-decoration: none; padding: .35rem 0; font-size: .85rem; }
.footer-legal a:hover, .footer-legal .link-button:hover { color: #fff; }

/* Banner cookie */
.cookie-banner {
    position: fixed;
    left: 1rem; right: 1rem; bottom: calc(1rem + var(--safe-bottom));
    max-width: 980px;
    margin: 0 auto;
    background: #fff;
    color: var(--color-text-muted);
    border-radius: 12px;
    box-shadow: 0 12px 48px rgba(10,15,30,.25);
    padding: 1.4rem 1.5rem;
    z-index: 1500;
    display: flex;
    gap: 1rem 2rem;
    align-items: flex-end;
    font-size: .95rem;
}
.cookie-banner[hidden] { display: none; }
.cookie-main { flex: 1; }
.cookie-title { font-family: var(--font-heading); font-weight: 600; color: var(--color-text); font-size: 1.05rem; margin: 0 0 .35rem; padding-right: 2rem; }
.cookie-main p { margin: 0; }
.cookie-actions { display: flex; flex-wrap: wrap; gap: .5rem; flex-shrink: 0; justify-content: flex-end; }
.cookie-actions .btn + .btn { margin-left: 0; }
.cookie-close {
    position: absolute; top: .4rem; right: .4rem;
    width: 44px; height: 44px; border: 0; background: none; font-size: 1.6rem; line-height: 1;
    color: var(--color-text-muted); cursor: pointer; border-radius: 50%;
}
.cookie-close:hover { background: var(--color-bg-muted); }
.cookie-prefs { margin-top: 1rem; display: grid; gap: .6rem; }
.cookie-prefs[hidden] { display: none; }
.cookie-option { display: flex; gap: .7rem; align-items: flex-start; cursor: pointer; }
.cookie-option input { width: 20px; height: 20px; margin-top: .15rem; flex-shrink: 0; accent-color: var(--color-primary); }

/* ===================== Responsive ===================== */
@media (max-width: 960px) {
    .gallery-preview, .gallery-grid { grid-template-columns: repeat(2, 1fr); }
    .cookie-banner { flex-direction: column; align-items: stretch; }
    .cookie-actions { justify-content: stretch; }
    .cookie-actions .btn { flex: 1 1 auto; }
}

@media (max-width: 860px) {
    :root { --header-h: 64px; }
    .two-col, .contact-layout { grid-template-columns: 1fr; }
    .two-col.reverse .col-image, .two-col.reverse .col-text { order: initial; }
    .col-image { max-width: 560px; }
    .cta-inner { flex-direction: column; align-items: flex-start; }

    .nav-toggle { display: block; }
    .main-nav {
        position: fixed;
        top: var(--header-h);
        left: 0; right: 0; bottom: 0;
        background: #fff;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 1rem clamp(18px, 4vw, 24px) calc(2rem + var(--safe-bottom));
        overflow-y: auto;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-8px);
        transition: opacity .2s ease, transform .2s ease, visibility 0s linear .2s;
    }
    .main-nav.open { opacity: 1; visibility: visible; transform: none; transition: opacity .2s ease, transform .2s ease; }
    .main-nav a { font-size: 1.2rem; padding: 1rem 0; border-bottom: 1px solid var(--color-border); }
    .main-nav a.active, .main-nav a:hover { border-bottom-color: var(--color-border); }
    .main-nav .nav-cta { margin-top: 1.5rem; text-align: center; padding: 1rem; border-radius: 6px; border: 0; }

    .lightbox { padding: 4.5rem .5rem calc(1rem + var(--safe-bottom)); }
    .lightbox-nav { top: auto; bottom: calc(1rem + var(--safe-bottom)); transform: none; width: 48px; height: 48px; }
    .lightbox-prev { left: .75rem; }
    .lightbox-next { right: .75rem; }
    .lightbox-info { padding: 0 3.75rem; }
    .lightbox img { max-height: calc(100vh - 13rem); max-height: calc(100dvh - 13rem); }

    /* Pulsante contatto sempre a portata di pollice */
    .mobile-cta {
        display: inline-flex;
        align-items: center;
        gap: .5rem;
        position: fixed;
        right: 1rem;
        bottom: calc(1rem + var(--safe-bottom));
        z-index: 900;
        background: var(--color-primary);
        color: #fff;
        font-family: var(--font-heading);
        font-weight: 500;
        padding: .85rem 1.25rem;
        min-height: 50px;
        border-radius: 999px;
        box-shadow: 0 6px 20px rgba(12,113,195,.4);
        transition: transform .25s ease, opacity .25s ease;
    }
    .mobile-cta:hover { opacity: 1; }
    .mobile-cta.is-hidden, body.has-cookie-banner .mobile-cta, body.nav-open .mobile-cta { transform: translateY(150%); opacity: 0; pointer-events: none; }
}

@media (max-width: 600px) {
    body { font-size: 1rem; }
    .form-row { grid-template-columns: 1fr; }
    .hero-actions .btn { flex: 1 1 100%; }
    .cta-band .btn, .col-text .btn { width: 100%; }
    .btn + .btn { margin-left: 0; margin-top: .6rem; }
    .gallery-preview { gap: .75rem; }
    .gallery-grid { grid-template-columns: 1fr; gap: 1rem; }
    .footer-inner { flex-direction: column; gap: 1.25rem; }
    .cookie-banner { left: .5rem; right: .5rem; bottom: calc(.5rem + var(--safe-bottom)); padding: 1.1rem 1rem; font-size: .9rem; max-height: 85vh; overflow-y: auto; }
    .cookie-actions .btn { flex: 1 1 calc(50% - .25rem); }
}
