/* ============================================================
   Sito pubblico — palette "Blu fiducia" (ibrido)
   Header/footer e sezioni d'impatto scure, pagine di testo chiare.
   Font: Fraunces (display) + Outfit (testo)
   ============================================================ */
:root {
    --ink: #142433;
    --ink-soft: #4a5a6b;
    --paper: #f4f7fb;
    --paper-2: #e9eef5;
    --line: #d4dde7;
    --white: #ffffff;

    --brand: #2a9df4;
    --brand-dark: #1366a8;
    --brand-soft: #9cc9ee;

    --dark: #0b1a28;
    --dark-2: #13283c;
    --dark-line: rgba(255,255,255,.08);
    --on-dark: #ffffff;
    --on-dark-soft: #9bb3c7;

    --accent: #17b486;
    --shadow: 0 18px 40px -22px rgba(10, 26, 40, .5);
    --radius: 14px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: "Outfit", system-ui, sans-serif;
    color: var(--ink);
    background: var(--paper);
    font-size: 17px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 {
    font-family: "Fraunces", Georgia, serif;
    font-weight: 600;
    line-height: 1.08;
    letter-spacing: -.01em;
    color: var(--ink);
}
a { color: var(--brand-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

.container { width: min(1140px, 92vw); margin-inline: auto; }
.section { padding: clamp(3.5rem, 8vw, 6.5rem) 0; }
.eyebrow {
    font-family: "Outfit", sans-serif;
    text-transform: uppercase;
    letter-spacing: .18em;
    font-size: .78rem;
    font-weight: 600;
    color: var(--brand-dark);
    margin-bottom: .9rem;
    display: inline-block;
}

.btn {
    display: inline-flex; align-items: center; gap: .5rem;
    font-family: "Outfit", sans-serif; font-weight: 600;
    padding: .8rem 1.5rem; border-radius: 999px;
    border: 2px solid transparent; cursor: pointer;
    font-size: 1rem; transition: transform .15s ease, box-shadow .2s ease, background .2s;
    text-decoration: none;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn-primary { background: var(--brand); color: #04243b; box-shadow: var(--shadow); }
.btn-primary:hover { background: #4cb1f7; color: #04243b; }
.btn-ghost { border-color: var(--ink); color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--white); }
.btn-light { background: var(--white); color: var(--ink); }

.site-nav {
    position: sticky; top: 0; z-index: 50;
    background: color-mix(in srgb, var(--dark) 92%, transparent);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--dark-line);
}
.site-nav .container { display: flex; align-items: center; justify-content: space-between; padding: 1rem 0; }
.brand { font-family: "Fraunces", serif; font-weight: 700; font-size: 1.45rem; color: var(--on-dark); }
.brand span { color: var(--brand); }
.nav-links { display: flex; gap: 1.8rem; align-items: center; list-style: none; margin: 0; padding: 0; }
.nav-links a { color: var(--on-dark-soft); font-weight: 500; }
.nav-links a:hover, .nav-links a.active { color: var(--brand); text-decoration: none; }
.nav-toggle { display: none; background: none; border: 0; font-size: 1.7rem; color: var(--on-dark); cursor: pointer; }

@media (max-width: 860px) {
    .nav-toggle { display: block; }
    .nav-links {
        position: absolute; top: 100%; left: 0; right: 0;
        flex-direction: column; background: var(--dark);
        padding: 1rem 6vw 1.5rem; gap: 1rem; border-bottom: 1px solid var(--dark-line);
        display: none;
    }
    .nav-links.open { display: flex; }
}

.hero {
    position: relative; overflow: hidden;
    padding: clamp(3.5rem, 9vw, 7rem) 0 clamp(3rem,7vw,5.5rem);
    background: var(--dark);
}
.hero::before {
    content: ""; position: absolute; inset: 0;
    background:
        radial-gradient(60% 80% at 85% 10%, rgba(42,157,244,.18), transparent 60%),
        radial-gradient(50% 60% at 5% 90%, rgba(42,157,244,.08), transparent 60%);
    pointer-events: none;
}
.hero .container { position: relative; display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(2rem,5vw,4rem); align-items: center; }
.hero h1 { font-size: clamp(2.6rem, 6vw, 4.3rem); color: var(--on-dark); }
.hero h1 em { font-style: normal; color: var(--brand); }
.hero p.lead { font-size: 1.2rem; color: var(--on-dark-soft); max-width: 46ch; margin: 1.4rem 0 2rem; }
.hero-cta { display: flex; gap: 1rem; flex-wrap: wrap; }
.hero .btn-ghost { border-color: rgba(255,255,255,.5); color: var(--on-dark); }
.hero .btn-ghost:hover { background: var(--on-dark); color: var(--dark); }
.hero-visual {
    border-radius: 22px; overflow: hidden; box-shadow: var(--shadow);
    aspect-ratio: 4/5; background: var(--dark-2);
    border: 1px solid var(--dark-line);
}
.hero-visual img { width: 100%; height: 100%; object-fit: cover; }
.hero-badge {
    display: inline-flex; align-items: center; gap: .5rem;
    background: rgba(42,157,244,.15); border: 1px solid rgba(42,157,244,.3); border-radius: 999px;
    padding: .4rem 1rem; font-size: .85rem; font-weight: 600; color: var(--brand-soft); margin-bottom: 1.5rem;
}
@media (max-width: 860px) {
    .hero .container { grid-template-columns: 1fr; }
    .hero-visual { aspect-ratio: 16/11; order: -1; }
}

.section.section-dark,
.section[style*="--paper-2"] {
    background: var(--dark) !important;
}
.section-dark .section-head h2,
.section[style*="--paper-2"] .section-head h2 { color: var(--on-dark); }
.section-dark .eyebrow,
.section[style*="--paper-2"] .eyebrow { color: var(--brand-soft); }
.section-dark .btn-ghost,
.section[style*="--paper-2"] .btn-ghost { border-color: rgba(255,255,255,.5); color: var(--on-dark); }
.section-dark .btn-ghost:hover,
.section[style*="--paper-2"] .btn-ghost:hover { background: var(--on-dark); color: var(--dark); }

.section-head { max-width: 60ch; margin-bottom: 3rem; }
.section-head h2 { font-size: clamp(2rem, 4vw, 2.9rem); }
.grid { display: grid; gap: 1.4rem; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 860px) { .grid-3 { grid-template-columns: 1fr; } .grid-2 { grid-template-columns: 1fr; } }

.svc-card {
    background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 1.8rem; transition: transform .2s ease, box-shadow .2s ease, border-color .2s;
    display: flex; flex-direction: column; gap: .6rem; height: 100%;
}
.svc-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--brand); text-decoration: none; }
.svc-icon {
    width: 56px; height: 56px; border-radius: 14px;
    display: grid; place-items: center; font-size: 1.7rem;
    background: rgba(42,157,244,.12); color: var(--brand-dark);
    margin-bottom: .6rem;
}
.svc-card h3 { font-size: 1.35rem; }
.svc-card p { color: var(--ink-soft); margin: 0; font-size: .98rem; }
.svc-card .more { margin-top: auto; color: var(--brand-dark); font-weight: 600; padding-top: .8rem; }

.section-dark .svc-card,
.section[style*="--paper-2"] .svc-card { background: var(--dark-2); border-color: var(--dark-line); }
.section-dark .svc-card h3,
.section[style*="--paper-2"] .svc-card h3 { color: var(--on-dark); }
.section-dark .svc-card p,
.section[style*="--paper-2"] .svc-card p { color: var(--on-dark-soft); }
.section-dark .svc-icon,
.section[style*="--paper-2"] .svc-icon { color: var(--brand); }

.ba-card {
    background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
    overflow: hidden; box-shadow: var(--shadow);
}
.ba-imgs { display: grid; grid-template-columns: 1fr 1fr; position: relative; }
.ba-imgs figure { margin: 0; position: relative; }
.ba-imgs img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.ba-imgs figure::after {
    position: absolute; top: .7rem; left: .7rem;
    background: rgba(11,26,40,.8); color: #fff; font-size: .72rem; font-weight: 600;
    letter-spacing: .12em; text-transform: uppercase; padding: .25rem .7rem; border-radius: 999px;
}
.ba-imgs figure.before::after { content: "Prima"; }
.ba-imgs figure.after::after { content: "Dopo"; background: var(--brand); color: #04243b; }
.ba-body { padding: 1.2rem 1.4rem 1.5rem; }
.ba-body h3 { font-size: 1.25rem; margin: 0 0 .25rem; }
.ba-body .meta { color: var(--ink-soft); font-size: .9rem; }

.section-dark .ba-card,
.section[style*="--paper-2"] .ba-card { background: var(--dark-2); border-color: var(--dark-line); }
.section-dark .ba-body h3,
.section[style*="--paper-2"] .ba-body h3 { color: var(--on-dark); }
.section-dark .ba-body .meta,
.section[style*="--paper-2"] .ba-body .meta { color: var(--on-dark-soft); }

.cta-band { background: var(--dark); color: var(--on-dark); border-radius: 24px; padding: clamp(2.5rem,5vw,4rem); text-align: center; border: 1px solid var(--dark-line); }
.cta-band h2 { color: var(--on-dark); font-size: clamp(1.8rem,4vw,2.8rem); }
.cta-band p { color: var(--on-dark-soft); max-width: 50ch; margin: 1rem auto 2rem; }

.form-wrap { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(1.5rem,4vw,2.5rem); box-shadow: var(--shadow); }
.field { margin-bottom: 1.1rem; }
.field label { display: block; font-weight: 600; margin-bottom: .4rem; font-size: .95rem; }
.field input, .field select, .field textarea {
    width: 100%; padding: .8rem 1rem; border: 1px solid var(--line); border-radius: 10px;
    font-family: inherit; font-size: 1rem; background: var(--paper); color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--brand); border-color: var(--brand); }
.field .err { color: #c0392b; font-size: .85rem; margin-top: .3rem; }
.hp { position: absolute; left: -9999px; }
.alert-ok { background: rgba(23,180,134,.12); border: 1px solid var(--accent); color: #0d7a59; padding: 1rem 1.2rem; border-radius: 10px; margin-bottom: 1.2rem; font-weight: 500; }

.site-footer { background: var(--dark); color: var(--on-dark-soft); padding: 3.5rem 0 2rem; margin-top: 2rem; }
.site-footer a { color: rgba(255,255,255,.85); }
.site-footer a:hover { color: var(--brand); }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 2rem; margin-bottom: 2.5rem; }
.footer-grid h4 { color: var(--on-dark); font-size: 1.05rem; margin: 0 0 1rem; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.footer-brand { font-family: "Fraunces", serif; font-size: 1.5rem; color: var(--on-dark); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding-top: 1.5rem; font-size: .85rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr; } }

.wa-float {
    position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 60;
    width: 58px; height: 58px; border-radius: 50%;
    background: #25d366; color: #fff; display: grid; place-items: center;
    font-size: 1.8rem; box-shadow: 0 10px 25px -8px rgba(0,0,0,.4);
    transition: transform .2s;
}
.wa-float:hover { transform: scale(1.08); text-decoration: none; color: #fff; }

.page-hero { background: var(--paper-2); border-bottom: 1px solid var(--line); padding: clamp(2.5rem,6vw,4.5rem) 0; }
.page-hero h1 { font-size: clamp(2.2rem,5vw,3.4rem); }
.page-hero p { color: var(--ink-soft); max-width: 55ch; margin-top: .8rem; }
.breadcrumb-mini { font-size: .85rem; color: var(--ink-soft); margin-bottom: .8rem; }

.prose p { margin: 0 0 1.1rem; color: var(--ink-soft); }
.list-check { list-style: none; padding: 0; display: grid; gap: .7rem; }
.list-check li { padding-left: 1.8rem; position: relative; }
.list-check li::before { content: "\ea5e"; font-family: "tabler-icons"; position: absolute; left: 0; color: var(--accent); font-size: 1.1rem; }

/* ============================================================
   Slider prima/dopo interattivo (metodo clip-path)
   ============================================================ */
.ba-slider {
    position: relative;
    width: 100%;
    aspect-ratio: 4/3;
    overflow: hidden;
    cursor: ew-resize;
    user-select: none;
    -webkit-user-select: none;
    background: var(--dark-2);
    touch-action: none; /* evita scroll mentre si trascina su mobile */
}
.ba-slider img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}
/* Entrambe le immagini occupano TUTTO il contenitore, perfettamente sovrapposte */
.ba-slider__after { position: absolute; inset: 0; }
.ba-slider__before {
    position: absolute; inset: 0;
    /* il ritaglio orizzontale si fa con clip-path, controllato da --ba-pos (0–100) */
    clip-path: inset(0 calc(100% - var(--ba-pos, 50%)) 0 0);
}
.ba-slider__before img { position: absolute; inset: 0; }

/* Linea divisoria verticale alla posizione corrente */
.ba-slider__before::after {
    content: "";
    position: absolute; top: 0; bottom: 0; right: 0;
    width: 2px; background: #fff;
}

/* Etichette */
.ba-slider__tag {
    position: absolute; top: .7rem; z-index: 3;
    font-size: .72rem; font-weight: 600; letter-spacing: .12em;
    text-transform: uppercase; padding: .25rem .7rem; border-radius: 999px;
}
.ba-slider__tag--before { left: .7rem; background: rgba(11,26,40,.8); color: #fff; }
.ba-slider__tag--after { right: .7rem; background: var(--brand); color: #04243b; }

/* Maniglia (segue --ba-pos) */
.ba-slider__handle {
    position: absolute; top: 0; bottom: 0;
    left: var(--ba-pos, 50%);
    width: 3px; background: #fff; transform: translateX(-50%);
    z-index: 4; pointer-events: none;
    box-shadow: 0 0 12px rgba(0,0,0,.4);
}
.ba-slider__grip {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 44px; height: 44px; border-radius: 50%;
    background: #fff; color: var(--brand-dark);
    display: grid; place-items: center; font-size: 1.3rem;
    box-shadow: 0 4px 14px rgba(0,0,0,.35);
}

/* Range nativo invisibile sopra tutto (tastiera/accessibilità) */
.ba-slider__range {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    margin: 0; opacity: 0; cursor: ew-resize;
    z-index: 5;
    -webkit-appearance: none; appearance: none; background: transparent;
}
.ba-slider:focus-within .ba-slider__grip { box-shadow: 0 0 0 3px var(--brand), 0 4px 14px rgba(0,0,0,.35); }

/* Visualizzazione singola (quando manca una delle due foto) */
.ba-imgs--single figure { margin: 0; }
.ba-imgs--single img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }

/* ============================================================
   Hero "full" — foto piena, testo centrato, numeri in basso
   ============================================================ */
.hero-full {
    position: relative;
    min-height: clamp(440px, 78vh, 680px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    background-size: cover;
    background-position: center;
    background-color: var(--dark);
    overflow: hidden;
}
.hero-full--noimg {
    background-image:
        radial-gradient(60% 80% at 85% 10%, rgba(42,157,244,.18), transparent 60%),
        radial-gradient(50% 60% at 5% 90%, rgba(42,157,244,.08), transparent 60%);
}
/* Velatura scura per leggibilità del testo sopra la foto */
.hero-full__overlay {
    position: absolute; inset: 0;
    background: linear-gradient(180deg,
        rgba(11,26,40,.62) 0%,
        rgba(11,26,40,.42) 42%,
        rgba(11,26,40,.92) 100%);
    z-index: 1;
}
.hero-full__content {
    position: relative;
    z-index: 2;
    width: min(760px, 90vw);
    margin: 0 auto;
    text-align: center;
    padding: clamp(2.5rem, 6vw, 4.5rem) 1rem clamp(5.5rem, 10vw, 7rem);
}
.hero-full__content h1 {
    font-size: clamp(2.4rem, 6vw, 4rem);
    color: var(--on-dark);
}
.hero-full__content h1 em { font-style: normal; color: var(--brand); }
.hero-full__content .lead {
    font-size: 1.15rem;
    color: #cdd9e4;
    max-width: 46ch;
    margin: 1.2rem auto 2rem;
}
.hero-full .hero-cta { justify-content: center; }
.hero-full .btn-ghost { border-color: rgba(255,255,255,.6); color: var(--on-dark); }
.hero-full .btn-ghost:hover { background: var(--on-dark); color: var(--dark); }
.hero-full .hero-badge {
    background: rgba(42,157,244,.2);
    border-color: rgba(42,157,244,.35);
    color: var(--brand-soft);
}

/* Fascia numeri ancorata in basso, sopra la foto */
.hero-full__stats {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    z-index: 2;
    display: flex;
    border-top: 1px solid rgba(255,255,255,.14);
    background: rgba(11,26,40,.35);
    backdrop-filter: blur(3px);
}
.hero-stat {
    flex: 1;
    text-align: center;
    padding: 1.1rem .6rem;
}
.hero-stat + .hero-stat { border-left: 1px solid rgba(255,255,255,.14); }
.hero-stat__value {
    font-family: "Fraunces", Georgia, serif;
    font-weight: 600;
    font-size: clamp(1.6rem, 3.5vw, 2.3rem);
    color: var(--on-dark);
    line-height: 1;
}
.hero-stat__label {
    font-size: .8rem;
    color: var(--brand-soft);
    margin-top: .35rem;
}
@media (max-width: 560px) {
    .hero-stat__label { font-size: .72rem; }
    .hero-stat { padding: .9rem .4rem; }
}
