:root {
    --blu: #1F4E79;
    --grigio-chiaro: #F2F2F2;
    --grigio: #B3B3B3;
    --verde: linear-gradient(135deg, #0B3D2E 0%, #257256 80%);
    --nero: #1A1A1A;
    --header-height: 82px;
    --gap: 20px;
    --radius: 8px;
    --font-base: "Montserrat", sans-serif;
    --surface: #ffffff;
    --ink-soft: #4e5963;
    --shadow-soft: 0 18px 45px rgba(20, 34, 48, 0.12);
}
@font-face {
    font-family: 'Montserrat';
    src: url(./fonts/montserrat-v31-latin-regular.woff2) format('woff2');
    font-weight: 400;
}

@font-face {
    font-family: 'Montserrat';
    src: url(./fonts/montserrat-v31-latin-500.woff2) format('woff2');
    font-weight: 500;
}

@font-face {
    font-family: 'Montserrat';
    src: url(./fonts/montserrat-v31-latin-700.woff2) format('woff2');
    font-weight: 700;
}

body {
    font-family: 'Montserrat', sans-serif;
}

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

html, body {
    max-width: 100%;
    overflow-x: hidden;
}

img,
svg {
    max-width: 100%;
}

body {
    margin: 0;
    font-family: var(--font-base);
    background: #eef1f3;
    color: var(--nero);
    line-height: 1.6;
    overflow-x: hidden;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

p,
li,
address,
label,
button,
input,
textarea,
select {
    font-weight: 400;
}

strong,
b {
    font-weight: 700;
}

/* HEADER */
header {
    position: fixed;
    top: 14px;
    left: 50%;
    width: min(calc(100% - 28px), 1180px);
    transform: translateX(-50%);
    background: rgba(27, 38, 48, 0.9);
    color: #ededed;
    z-index: 1000;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(14px);
    transition: top 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
}

header.scrolled {
    top: 8px;
    background: rgba(27, 38, 48, 0.96);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.26);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo-block {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.logo-img {
    width: 165px;
    height: auto;
    margin-top: -0.9rem;
    margin-bottom: -0.9rem;
}

/* NAVBAR */
.navbar {
    position: relative;
    display: flex;
    align-items: center;
    gap: 30px;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 8px;
    margin: 0;
    padding: 0;
}

.nav-links a {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    color: #f2f2f2;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.94rem;
    transition: background-color 0.25s ease, color 0.25s ease;
}

.nav-links a:hover,
.nav-links a:focus {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
}

/* Hamburger */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
}

.hamburger span {
    width: 24px;
    height: 3px;
    background: #f2f2f2;
    transition: 0.3s ease;
}

/* MAIN */
main {
    padding-top: 0;
}

.block.active {
    outline: 2px solid rgba(0, 0, 0, 0.2);
    outline-offset: 6px;
    transition: outline 0.25s ease;
}

/* HERO */
.hero {
    position: relative;
    min-height: 92vh;
    padding: 130px 22px 72px;
    overflow: hidden;
    background:
        linear-gradient(135deg, rgba(18, 27, 35, 0.93) 0%, rgba(31, 78, 121, 0.86) 52%, rgba(37, 114, 86, 0.8) 100%),
        url("./immagini/sitebw.webp") center / cover no-repeat;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-size: 1.1rem;
    opacity: 0;
    transform: translateY(20px);
    animation: heroFade 0.8s ease-out forwards;
}

.hero::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 34%;
    background: linear-gradient(180deg, transparent 0%, #eef1f3 100%);
}

.hero > * {
    position: relative;
    z-index: 1;
}

.hero .logo {
    width: min(420px, 74vw);
    padding: 26px 34px;
    margin-bottom: 34px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

.hero .logo img {
    display: block;
    width: 100%;
    height: auto;
}

.hero h1 {
    max-width: 900px;
    margin: 0 0 18px;
    font-size: clamp(2.45rem, 5vw, 4.8rem);
    line-height: 1.08;
}

.hero p {
    max-width: 680px;
    margin: 0 0 34px;
    color: #e9eef2;
    font-size: clamp(1.18rem, 2vw, 1.5rem);
}

@keyframes heroFade {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.evento {
    padding: 80px 20px;
    background: #eef1f3;
    text-align: center;
    color: var(--nero);
}

.evento-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 30px;
    border-radius: var(--radius);
    border: 1px solid rgba(31, 78, 121, 0.1);
    background: var(--surface);
    box-shadow: var(--shadow-soft);
}

.evento h2 {
    font-size: clamp(2rem, 3.4vw, 3rem);
    color: var(--blu);
    margin-bottom: 20px;
}
.evento h3 {
    font-size: 1.5rem;
    color: rgb(200, 36, 36);
    margin-bottom: 20px;
}

.evento p {
    max-width: 760px;
    margin: 0 auto 30px;
    font-size: 1.05rem;
    line-height: 1.8;
}

.evento-info {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    list-style: none;
    padding: 0;
    margin: 0 auto 30px;
    max-width: 800px;
}

.evento-info-card {
    position: relative;
    min-height: 168px;
    padding: 20px 18px;
    overflow: hidden;
    border-radius: var(--radius);
    border: 1px solid rgba(31, 78, 121, 0.18);
    background: linear-gradient(180deg, #ffffff 0%, #f7fafc 100%);
    box-shadow: 0 10px 24px rgba(31, 78, 121, 0.08);
    transform: translateY(0);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.evento-info-card::after {
    content: "";
    position: absolute;
    inset: auto 18px 0;
    height: 3px;
    border-radius: 999px 999px 0 0;
    background: var(--verde);
    transform: scaleX(0.36);
    transform-origin: center;
    transition: transform 0.25s ease;
}

.evento-info-card:hover,
.evento-info-card:focus-visible {
    border-color: rgba(37, 114, 86, 0.45);
    box-shadow: 0 18px 32px rgba(31, 78, 121, 0.14);
    outline: none;
    transform: translateY(-6px);
}

.evento-info-card:hover::after,
.evento-info-card:focus-visible::after {
    transform: scaleX(1);
}

.evento-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    margin-bottom: 12px;
    border-radius: 50%;
    background: rgba(31, 78, 121, 0.1);
    color: var(--blu);
}

.evento-icon svg {
    width: 18px;
    height: 18px;
}

.evento-info-card > strong {
    display: block;
    margin-bottom: 8px;
    color: var(--blu);
}

.evento-info-card span:last-child {
    display: block;
}

.btn {
    display: inline-block;
    padding: 14px 28px;
    border-radius: 8px;
    background: var(--blu);
    color: #ffffff;
    text-decoration: none;
    font-weight: 700;
    box-shadow: 0 14px 28px rgba(31, 78, 121, 0.2);
    transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
}

.btn:hover,
.btn:focus {
    transform: translateY(-2px);
    box-shadow: 0 18px 34px rgba(31, 78, 121, 0.28);
}

.btn.secondary {
    background: rgba(31, 78, 121, 0.1);
    color: var(--blu);
    border: 2px solid var(--blu);
}

.btn.secondary:hover,
.btn.secondary:focus {
    background: rgba(31, 78, 121, 0.16);
}

/* SEZIONI */
section {
    scroll-margin-top: 140px;
}

/* Reveal animation */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: 0.6s ease-out;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* CHI SIAMO */
.chi-siamo {
    padding: 90px 20px;
    background: #ffffff;
    text-align: center;
}

.chi-siamo h2 {
    font-size: clamp(2.1rem, 3.5vw, 3.2rem);
    color: var(--blu);
    margin-bottom: 34px;
    text-shadow: none;
}

.chi-siamo p {
    max-width: 900px;
    margin: 0 auto;
    color: var(--ink-soft);
    font-size: 1.16rem;
    line-height: 1.85;
}

/* SERVIZI */
.servizi {
    color: var(--blu);
    text-align: center;
    padding: 90px 20px;
    background: #eef1f3;
}

.servizi h2 {
    font-size: clamp(2.1rem, 3.5vw, 3.2rem);
    margin-bottom: 46px;
    text-shadow: none;
}

/* Cards */
.cards {
    display: flex;
    gap: var(--gap);
    margin-top: 30px;
    flex-wrap: wrap;
    max-width: 1120px;
    margin-inline: auto;
}

.card {
    flex: 1 1 260px;
    min-width: 220px;
    padding: 28px;
    border: 1px solid rgba(31, 78, 121, 0.12);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: 0 12px 28px rgba(20, 34, 48, 0.08);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.card h3,
.card p,
.evento-info-card,
.contatti p,
address {
    overflow-wrap: anywhere;
}

.card:hover {
    border-color: rgba(37, 114, 86, 0.45);
    transform: translateY(-6px);
    box-shadow: 0 20px 38px rgba(20, 34, 48, 0.14);
}

/* MACCHINARI */
.macchinari {
    padding: 60px 20px;
    background: #33383d;
    text-align: center;
}

.macchinari h2 {
    font-size: clamp(2.4rem, 4vw, 3.6rem);
    margin-bottom: 32px;
    color: #ffffff;
    text-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
}

.macchinari > p {
    max-width: 850px;
    margin: 0 auto 70px;
    color: #e6edf2;
    font-size: clamp(1.25rem, 2vw, 1.65rem);
    font-weight: 500;
    line-height: 1.55;
}

.macchinari .cards {
    flex-direction: column;
    align-items: stretch;
    max-width: 980px;
    margin: 30px auto 0;
}

.macchinari .card {
    flex: none;
    width: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 28px;
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.92);
}

.macchinari .card h3 {
    font-size: clamp(1.7rem, 3vw, 2.35rem);
    font-weight: 700;
    color: #1A1A1A;
    text-shadow: 0 8px 18px rgba(20, 34, 48, 0.22);
}

.macchinari .card p {
    margin-bottom: 24px;
}

.macchinari-brand {
    display: inline-block;
    align-self: center;
    margin: 0 auto 20px;
    text-align: center;
    color: #16324f;
    font-size: clamp(1.25rem, 2.4vw, 1.75rem);
    line-height: 1.05;
    letter-spacing: 0;
    text-shadow: 0 6px 14px rgba(22, 50, 79, 0.2);
}

.macchinari .card p:last-of-type {
    margin-bottom: 28px;
}

.macchinari-img-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 28px;
    margin-top: auto;
    padding: 28px 18px;
    border: 0;
    border-radius: 8px;
    background:
        radial-gradient(circle at 50% 100%, rgba(37, 114, 86, 0.16), transparent 48%),
        linear-gradient(180deg, #ffffff 0%, #f7f9fb 56%, #dfe7ec 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        0 14px 34px rgba(31, 78, 121, 0.13);
}

.macchinari-img {
    display: block;
    width: min(100%, 680px);
    height: 420px;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    object-fit: contain;
    filter: drop-shadow(0 16px 16px rgba(26, 26, 26, 0.24));
    transition: transform 0.3s ease, filter 0.3s ease, background-color 0.3s ease;
}

.macchinari-img:only-child {
    width: min(100%, 720px);
    height: 460px;
}

.macchinari .card:hover .macchinari-img {
    transform: translateY(-4px) scale(1.02);
    filter: drop-shadow(0 20px 18px rgba(26, 26, 26, 0.28));
}

.macchinari .card:hover {
    border-color: #257256;
}

/* CONTATTI */
.contatti {
    background-color: #eef1f3;
    text-align: center;
    padding: 90px 20px;
}

.contatti h2 {
    font-size: clamp(2.1rem, 3.5vw, 3.2rem);
    margin-bottom: 40px;
    color: var(--blu);
    text-shadow: none;
}

.contatti-rapidi {
    margin-top: 44px;
    font-size: 1.2rem;
}

.social-icons {
    margin-top: 45px;
    display: flex;
    gap: 30px;
    justify-content: center;
}

.social-icons .icon svg {
    width: 38px;
    height: 38px;
    color: #33383d;
    transition: transform 0.25s ease, color 0.25s ease;
}

.social-icons .icon:hover svg {
    transform: translateY(-3px);
}

.social-icons .phone:hover svg { color: #4CAF50; }
.social-icons .email:hover svg { color: #d44638; }
.social-icons .whatsapp:hover svg { color: #25D366; }

/* MODAL */
.modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border: 1px solid #281919;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    z-index: 999;
}

.modal.open {
    display: block;
}

.modal img {
    width: 200px;
}

.close-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: #e63946;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
}

/* FOOTER */
footer {
    background: #252a2f;
    color: #e9eef2;
    padding: 28px 20px;
    text-align: center;
}

footer h4 {
    margin-top: 20px;
    font-size: 0.8rem;
}

/* PARTNERS */
.partners {
    overflow: hidden;
    width: 100%;
}

.partners-track {
    display: flex;
    gap: 50px;
    width: max-content;
    animation: scroll 25s linear infinite;
    will-change: transform;
}

.partners-track:hover {
    animation-play-state: paused;
}
.gradient-link {
  text-decoration: none;
  color: #d9e1e6;
  position: relative;
  transition: color 0.3s ease;
}

.gradient-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 100%;
  height: 2px;
  background: linear-gradient(to right, transparent, #d9e1e6, transparent);
  transition: background 0.3s ease;
}

/* 🔥 HOVER */
.gradient-link:hover {
  color: #4fce8a;
}

.gradient-link:hover::after {
  background: linear-gradient(to right, transparent, #4fce8a, transparent);
}

.privacy-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin-top: 12px;
    padding: 7px 10px;
    border: 1px solid rgba(31, 78, 121, 0.18);
    border-radius: 6px;
    background: var(--grigio-chiaro);
    color: var(--blu);
    box-shadow: none;
    cursor: pointer;
    font-family: var(--font-base);
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.privacy-toggle:hover,
.privacy-toggle:focus-visible {
    color: #257256;
    background-color: #fff;
}

.privacy-toggle:focus-visible {
    outline: 2px solid rgba(37, 114, 86, 0.35);
    outline-offset: 2px;
}

.privacy-toggle__icon {
    display: inline-grid;
    place-items: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid currentColor;
    background: transparent;
    color: currentColor;
    font-size: 0.68rem;
    font-weight: 700;
}

.privacy-toggle__chevron {
    width: 6px;
    height: 6px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
    transition: transform 0.2s ease;
}

.privacy-toggle[aria-expanded="true"] .privacy-toggle__chevron {
    transform: rotate(225deg) translate(-1px, -1px);
}

.slide {
    display: flex;
    gap: 50px;
}

.slide a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 180px;
    height: 118px;
    padding: 10px;
    border: 1px solid rgba(217, 225, 230, 0.26);
    border-radius: 8px;
    background: rgba(245, 248, 250, 0.92);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
    transition: background-color 0.25s ease, border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.slide a:hover,
.slide a:focus-visible {
    border-color: #4fce8a;
    background: #ffffff;
    box-shadow: 0 14px 30px rgba(79, 206, 138, 0.22);
    transform: translateY(-2px);
}

.slide a:focus-visible {
    outline: 2px solid rgba(79, 206, 138, 0.55);
    outline-offset: 3px;
}

.slide img {
    height: 100px;
    width: 160px;
    object-fit: contain;
    filter: grayscale(100%);
    transition: filter 0.3s ease;
}

.slide a:hover img,
.slide a:focus-visible img,
.slide img:hover {
    filter: grayscale(40%);
}

@keyframes scroll {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

/* PRIVACY BOX */
.privacy-box {
    max-height: 0;
    overflow: hidden;
    background: var(--grigio-chiaro);
    color: var(--blu);
    padding: 10px 30px;
    border-top: 4px solid var(--grigio);
    border-radius: 4px;
    transition: max-height 0.4s ease, padding 0.3s ease;

}

.privacy-box[aria-hidden="false"] {
    max-height: 90vh;
    overflow-y: auto;
    padding: 30px 22px;
}

/* BACK TO TOP */
.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 10px 14px;
    background-color: #257256;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    header {
        top: 8px;
        width: min(calc(100% - 16px), 1180px);
    }

    .header-inner {
        padding: 8px 12px;
    }

    .nav-links {
        position: absolute;
        top: calc(100% + 10px);
        right: 0;
        width: min(260px, calc(100vw - 28px));
        background: rgba(27, 38, 48, 0.98);
        flex-direction: column;
        padding: 12px;
        gap: 6px;
        border: 1px solid rgba(255, 255, 255, 0.12);
        border-radius: 8px;
        box-shadow: 0 18px 34px rgba(0, 0, 0, 0.24);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-8px);
        transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
    }

    .nav-links a {
        width: 100%;
        min-height: 44px;
        justify-content: center;
    }

    .logo-img {
        width: 145px;
        margin-top: 0;
        margin-bottom: 0;
    }

    .nav-links.open {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .hamburger {
        display: flex;
    }

    .cards {
        flex-direction: column;
    }

    .hero {
        min-height: 64vh;
        padding: 100px 18px 50px;
    }

    .hero .logo {
        width: min(240px, 50vw);
        padding: 12px 18px;
        margin-bottom: 20px;

    }

    .hero h1 {
        font-size: clamp(2.05rem, 9vw, 3.5rem);
    }

    .hero p {
        font-size: 1.08rem;
    }

    .servizi,
    .chi-siamo,
    .contatti {
        padding: 68px 16px;
    }

    .macchinari {
        padding: 68px 14px;
    }

    .card,
    .macchinari .card {
        min-width: 0;
        padding: 22px 16px;
    }

    .card:hover,
    .macchinari .card:hover {
        transform: none;
    }

    .macchinari .card:hover .macchinari-img {
        transform: none;
    }

    .macchinari > p {
        margin-bottom: 40px;
        font-size: 1.2rem;
    }

    .macchinari-img-wrapper {
        gap: 22px;
        padding: 22px 12px;
    }

    .macchinari-img,
    .macchinari-img:only-child {
        width: min(100%, 460px);
        height: clamp(230px, 64vw, 320px);
    }

    .partners-track,
    .slide {
        gap: 24px;
    }

    .slide a {
        width: 150px;
        height: 96px;
        padding: 8px;
    }

    .slide img {
        width: 132px;
        height: 78px;
    }

    .evento {
        padding: 60px 14px;
    }

    .evento-content {
        padding: 24px 16px;
    }

    .evento h2 {
        font-size: 1.7rem;
    }

    .evento p {
        font-size: 1rem;
    }

    .evento-info {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .evento-info-card {
        min-height: auto;
        width: 100%;
    }
}

@media (max-width: 480px) {
    header {
        width: calc(100% - 12px);
    }

    .header-inner {
        padding: 7px 10px;
    }

    .logo-img {
        width: 128px;
    }

    .hamburger {
        padding: 8px;
    }

    .hero {
        padding: 112px 16px 52px;
        min-height: 78vh;
    }

    .hero .logo {
        width: min(330px, 86vw);
        padding: 16px;
        margin-bottom: 22px;
    }

    .hero h1 {
        font-size: clamp(1.85rem, 10vw, 2.8rem);
    }

    .hero p {
        font-size: 1rem;
        margin-bottom: 26px;
    }

    .servizi h2,
    .chi-siamo h2,
    .contatti h2 {
        font-size: 1.9rem;
        margin-bottom: 28px;
    }

    .chi-siamo p,
    .card p {
        font-size: 1rem;
        line-height: 1.7;
    }

    .macchinari h2 {
        font-size: 2rem;
    }

    .macchinari-img,
    .macchinari-img:only-child {
        height: clamp(210px, 72vw, 280px);
    }

    .evento {
        padding: 50px 12px;
    }

    .evento-content {
        padding: 20px 14px;
    }

    .evento h2 {
        font-size: 1.45rem;
    }

    .btn {
        display: block;
        width: 100%;
        text-align: center;
        margin-bottom: 10px;
    }

    .privacy-toggle {
        width: auto;
        max-width: 100%;
        padding: 7px 10px;
        font-size: 0.8rem;
    }
}
html, body {
    overflow-x: hidden;
}
