:root {
    --fondo: #121c2c;
    --pannello: #1a2638;
    --pannello-2: #203049;
    --navy: #f2f6fc;
    --blu: #7eb0e8;
    --blu-vivo: #3d7cc4;
    --testo: #f4f7fb;
    --muto: #c5d2e4;
    --linea: rgba(190, 210, 235, 0.28);
    --ok: #9ad9b4;
    --errore: #efb0b0;
    --serif: "Newsreader", "Georgia", serif;
    --sans: "Manrope", "Segoe UI", sans-serif;
    --misura: 1120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background:
        radial-gradient(900px 420px at 90% -15%, rgba(61, 124, 196, 0.22), transparent 55%),
        radial-gradient(700px 420px at 0% 30%, rgba(26, 48, 78, 0.55), transparent 55%),
        var(--fondo);
    color: var(--testo);
    font-family: var(--sans);
    font-size: 1.08rem;
    font-weight: 400;
    line-height: 1.7;
    text-align: justify;
    hyphens: none;
    -webkit-hyphens: none;
    -ms-hyphens: none;
    word-break: normal;
    overflow-wrap: normal;
}

img { max-width: 100%; display: block; }

a { color: var(--blu); }

p,
li,
dd {
    text-align: justify;
    hyphens: none;
    -webkit-hyphens: none;
    -ms-hyphens: none;
}

.sr,
.salta {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.salta:focus {
    position: fixed;
    top: 0.6rem;
    left: 0.6rem;
    z-index: 40;
    width: auto;
    height: auto;
    margin: 0;
    clip: auto;
    padding: 0.55rem 0.85rem;
    background: var(--blu-vivo);
    color: #fff;
}

.testata,
main,
.piede {
    width: min(var(--misura), calc(100% - 7vw));
    margin-inline: auto;
}

.testata { padding-top: 2rem; }

.marca { text-align: center; }

h1, h2, h3 {
    font-family: var(--serif);
    font-weight: 500;
    letter-spacing: -0.02em;
    text-align: justify;
    hyphens: none;
}

h1 {
    margin: 0;
    color: #ffffff;
    font-size: clamp(2.2rem, 4.6vw, 3.4rem);
    line-height: 1.1;
    text-align: center;
}

.marca p {
    margin: 0.45rem 0 0;
    color: #a8c8ef;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-align: center;
}

.barra {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.2rem;
    margin-top: 1.5rem;
    padding: 0.8rem 1.1rem;
    background: rgba(26, 38, 56, 0.94);
    border: 1px solid var(--linea);
    border-radius: 999px;
    backdrop-filter: blur(12px);
}

#navigazione {
    display: flex;
    gap: 1.4rem;
}

#navigazione a {
    color: var(--testo);
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.25s ease;
}

#navigazione a:hover { color: var(--blu); }

.contatti-rapidi {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.email {
    color: var(--testo);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.25s ease;
}

.email:hover { color: var(--blu); }

.telefono {
    display: inline-flex;
    align-items: center;
    min-height: 2.4rem;
    padding: 0.35rem 0.95rem;
    border-radius: 999px;
    background: var(--blu-vivo);
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.telefono:hover {
    background: var(--blu);
    color: #102038;
    transform: translateY(-1px);
}

.menu {
    display: none;
    width: 2.4rem;
    height: 2.4rem;
    padding: 0;
    border: 1px solid var(--linea);
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
}

.menu span {
    display: block;
    width: 0.95rem;
    height: 1.5px;
    margin: 0.28rem auto;
    background: var(--testo);
}

.apertura {
    padding: 3rem 0 1.2rem;
}

.tesi {
    margin: 0 0 1.4rem;
    color: #ffffff;
    font-family: var(--serif);
    font-size: clamp(1.55rem, 2.5vw, 2rem);
    line-height: 1.3;
    text-align: justify;
    hyphens: none;
}

.apertura-corpo {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 2.8rem;
    align-items: stretch;
}

.apertura-testo {
    display: flex;
    flex-direction: column;
}

.apertura-testo p {
    margin: 0 0 1rem;
    color: var(--muto);
}

.apertura-testo p:last-child {
    margin-bottom: 0;
}

.apertura-foto {
    margin: 0;
    display: flex;
    align-items: stretch;
    justify-content: center;
    min-height: 100%;
    overflow: hidden;
    border-radius: 1rem;
}

.apertura-foto img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 1rem;
    transition: transform 0.8s ease;
}

.apertura-foto:hover img {
    transform: scale(1.02);
}

.blocco { padding: 2.8rem 0 0.5rem; }

.sezione-testa { max-width: 44rem; }

#attivita .sezione-testa,
#metodo .sezione-testa,
#contatti .sezione-testa { max-width: none; }

h2 {
    margin: 0 0 0.7rem;
    color: #ffffff;
    font-size: clamp(1.8rem, 3vw, 2.35rem);
    line-height: 1.15;
}

.sezione-testa p {
    margin: 0;
    color: var(--muto);
}

.sezione-testa p + p {
    margin-top: 0.75rem;
}

.griglia {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    list-style: none;
    margin: 1.6rem 0 0;
    padding: 0;
}

.griglia li {
    padding: 1.35rem 1.3rem;
    background: var(--pannello);
    border: 1px solid var(--linea);
    border-radius: 1rem;
    transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

.griglia li:hover {
    background: #243552;
    border-color: rgba(126, 176, 232, 0.55);
    box-shadow: 0 0 0 1px rgba(126, 176, 232, 0.2), 0 10px 28px rgba(61, 124, 196, 0.18);
    transform: translateY(-3px);
}

h3 {
    margin: 0 0 0.55rem;
    color: #ffffff;
    font-size: 1.25rem;
    line-height: 1.25;
}

.griglia p,
.metodo-elenco p {
    margin: 0;
    color: var(--muto);
    font-size: 1rem;
}

.metodo { padding-top: 3.2rem; }

.metodo-elenco {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    list-style: none;
    margin: 1.6rem 0 0;
    padding: 0;
}

.metodo-elenco li {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
    background: var(--pannello-2);
    border: 1px solid var(--linea);
    border-radius: 1rem;
    transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

.metodo-elenco li:hover {
    background: #2a3d5a;
    border-color: rgba(126, 176, 232, 0.55);
    box-shadow: 0 0 0 1px rgba(126, 176, 232, 0.2), 0 10px 28px rgba(61, 124, 196, 0.18);
    transform: translateY(-3px);
}

.metodo-elenco figure {
    margin: 0;
    overflow: hidden;
}

.metodo-elenco img {
    width: 100%;
    height: 9.5rem;
    object-fit: cover;
    opacity: 0.9;
    transition: transform 0.7s ease, opacity 0.3s ease;
}

.metodo-elenco li:hover img {
    transform: scale(1.05);
    opacity: 1;
}

.metodo-elenco div {
    padding: 1.15rem 1.2rem 1.3rem;
}

.scheda {
    display: grid;
    grid-template-columns: 0.85fr 1.15fr;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

dl {
    margin: 0;
    padding: 1.2rem 1.3rem;
    background: var(--pannello);
    border: 1px solid var(--linea);
    border-radius: 1rem;
}

dl div + div {
    margin-top: 0.95rem;
    padding-top: 0.95rem;
    border-top: 1px solid var(--linea);
}

dt {
    margin-bottom: 0.2rem;
    color: var(--muto);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-align: justify;
}

dd {
    margin: 0;
    color: var(--navy);
    font-size: 1.08rem;
    font-weight: 600;
    text-align: justify;
}

.mappa iframe {
    width: 100%;
    height: 280px;
    border: 0;
    border-radius: 1rem;
    background: var(--pannello);
    filter: grayscale(0.15) contrast(1.05);
}

.mappa a {
    display: inline-block;
    margin-top: 0.55rem;
    font-weight: 600;
}

.modulo {
    margin-top: 1.5rem;
    padding: 1.4rem 1.4rem 1.5rem;
    background: var(--pannello);
    border: 1px solid var(--linea);
    border-radius: 1rem;
}

.modulo h3 { margin-bottom: 1rem; }

.campi {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.9rem;
}

form p { margin: 0 0 0.9rem; }

label {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--muto);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-align: justify;
}

label span {
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
}

input,
textarea,
input[type="file"] {
    width: 100%;
    padding: 0.8rem 0.9rem;
    border: 1px solid var(--linea);
    border-radius: 0.7rem;
    background: #101926;
    color: var(--testo);
    font: inherit;
    text-align: left;
}

textarea {
    min-height: 9rem;
    resize: vertical;
}

input[type="file"]::file-selector-button {
    margin-right: 0.8rem;
    border: 0;
    border-radius: 999px;
    padding: 0.45rem 0.85rem;
    background: var(--blu-vivo);
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

input:focus,
textarea:focus,
input[type="file"]:focus {
    outline: none;
    border-color: var(--blu);
    box-shadow: 0 0 0 3px rgba(126, 176, 232, 0.22);
}

input[aria-invalid="true"],
textarea[aria-invalid="true"] {
    border-color: var(--errore);
}

.trappola {
    position: absolute;
    left: -9999px;
}

.invia {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.9rem;
    padding: 0.7rem 1.3rem;
    border: 0;
    border-radius: 999px;
    background: var(--blu-vivo);
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.invia:hover {
    background: var(--blu);
    color: #102038;
    transform: translateY(-1px);
}

.entra {
    opacity: 0;
    transform: translateY(1.1rem);
    transition: opacity 0.7s ease, transform 0.7s ease;
    will-change: opacity, transform;
}

.entra.visibile {
    opacity: 1;
    transform: none;
}

.entra-ritardo-1 { transition-delay: 0.08s; }
.entra-ritardo-2 { transition-delay: 0.16s; }
.entra-ritardo-3 { transition-delay: 0.24s; }
.entra-ritardo-4 { transition-delay: 0.32s; }

.esito,
.errori {
    margin: 0 0 1rem;
    padding: 0.85rem 1rem;
    border-radius: 0.7rem;
    text-align: justify;
}

.esito {
    background: rgba(154, 217, 180, 0.12);
    border: 1px solid rgba(154, 217, 180, 0.35);
    color: var(--ok);
}

.errori {
    background: rgba(239, 176, 176, 0.1);
    border: 1px solid rgba(239, 176, 176, 0.35);
    color: var(--errore);
}

.errori ul {
    margin: 0;
    padding-left: 1.1rem;
}

.piede {
    margin-top: 3rem;
    padding: 1.5rem 0 2.2rem;
    border-top: 1px solid var(--linea);
    color: var(--muto);
    font-size: 0.78rem;
    line-height: 1.55;
    text-align: center;
}

.piede p {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.55rem 1.35rem;
    margin: 0;
    width: 100%;
    text-align: center;
}

.piede span {
    display: inline-block;
    white-space: nowrap;
}

.piede a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

:focus-visible {
    outline: 2px solid var(--blu);
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }

    .griglia li,
    .metodo-elenco li,
    .telefono,
    .invia,
    .apertura-foto img,
    .metodo-elenco img,
    .entra {
        transition: none;
        transform: none;
    }

    .entra {
        opacity: 1;
    }

    .telefono:hover,
    .invia:hover,
    .griglia li:hover,
    .metodo-elenco li:hover,
    .apertura-foto:hover img,
    .metodo-elenco li:hover img {
        transform: none;
    }
}

@media (max-width: 900px) {
    .menu { display: inline-block; }

    .barra {
        position: relative;
        border-radius: 1rem;
    }

    #navigazione {
        display: none;
        position: absolute;
        top: calc(100% + 0.45rem);
        left: 0;
        right: 0;
        z-index: 5;
        flex-direction: column;
        gap: 0;
        padding: 0.5rem 1rem 0.85rem;
        background: var(--pannello);
        border: 1px solid var(--linea);
        border-radius: 0.9rem;
    }

    #navigazione.aperto { display: flex; }

    #navigazione a { padding: 0.6rem 0; }

    .apertura-corpo,
    .griglia,
    .metodo-elenco,
    .scheda,
    .campi {
        grid-template-columns: 1fr;
    }

    .apertura-foto {
        min-height: 0;
        aspect-ratio: 4 / 3;
    }

    .piede span {
        white-space: normal;
    }

    .piede p {
        gap: 0.45rem 1rem;
    }
}

@media print {
    .menu, .mappa, #navigazione, .modulo { display: none !important; }
    body { background: #fff; color: #000; text-align: left; }
}
