:root {
    --primary: #000;
    --primary-alt: #232629;
    --gray-detail: #bbbbbb;
    --gray-hover: #27292d;
    --white: #fff;
    --border: #e0e0e0;
    --accent: #8B9AAE;
    --accent-deep: #55677d;
    --ink: #0b0d10;
    --neon-glow: 0 0 18px 2px rgba(139, 154, 174, 0.7);
    --soft-lift: 0 14px 34px rgba(35, 38, 41, 0.14);
}

/* ============ BASE ============ */
html, body {
    width: 100%;
}
html {
    overflow-x: hidden;
}
body {
    overflow-x: clip;
}

:focus-visible {
    outline: 2px solid var(--accent-deep);
    outline-offset: 3px;
}
nav :focus-visible,
footer :focus-visible,
.section-alt :focus-visible,
.lightbox :focus-visible,
#introduzione :focus-visible {
    outline-color: var(--accent);
}

.skip-link {
    position: absolute;
    top: -100px;
    left: 16px;
    z-index: 100000;
    padding: 12px 20px;
    background: var(--accent);
    color: var(--ink);
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
}
.skip-link:focus {
    top: 12px;
}
body {
    font-family: 'Inter', 'SF Pro Display', -apple-system, BlinkMacSystemFont, sans-serif;
    margin: 0;
    background: var(--white);
    color: #212325;
    line-height: 1.7;
    font-size: 18px;
}

/* ============ TITOLI ============ */
h1, h2, h3 {
    font-family: 'Montserrat', 'Inter', 'Arial', sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
}
h1 {
    font-size: 2.4em;
    margin: 30px 0 10px;
    color: var(--white);
    text-align: center;
}
h2 {
    font-size: 2em;
    color: var(--primary);
    text-align: center;
    margin: 70px 0 35px;
    position: relative;
}
h2::after {
    content: '';
    display: block;
    margin: 18px auto 0;
    width: 0; 
    height: 3px;
    background: var(--gray-detail);
    border-radius: 2px;
    transition: width 0.7s cubic-bezier(0.25, 1, 0.5, 1); 
}
.fade-in.show h2::after {
    width: 55px; 
}

h3 {
    font-size: 1.25em;
    margin: 0 0 12px;
    color: var(--primary-alt);
}
.section-intro-p {
    text-align: center;
    color: #3e3e3e;
    max-width: 600px;
    margin: -18px auto 38px;
    font-size: 1.06em;
}

.video-subtitle {
    margin: 10px auto 38px;
}


/* ============ [NUOVA REGOLA] CONTENITORE SEZIONI BIANCHE ============ */
#tecnica, #servizi, #contattami {
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
    padding: 40px 24px 70px 24px; 
    box-sizing: border-box;
}

#chi-sono {
    background: var(--white);
    max-width: none;
    padding: 40px 0 70px 0; 
    box-sizing: border-box;
}

#preventivo {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

#chi-sono > h2,
#chi-sono > .chi-sono-grid {
     max-width: 1100px;
     margin-left: auto;
     margin-right: auto;
     padding-left: 24px;
     padding-right: 24px;
     box-sizing: border-box;
}
#chi-sono > h2 {
    padding-bottom: 0;
}


/* ============ SEZIONE CHI SONO (MODIFICATA) ============ */
.chi-sono-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* 50% e 50% per dare più larghezza alla foto */
    gap: 50px; 
    align-items: stretch; /* Pareggia le altezze */
    margin-top: 30px;
}

.chi-sono-testo > p {
    text-align: left; 
    margin: 0 0 15px 0;
    max-width: none;
}

.chi-sono-testo > .section-intro-p {
    text-align: left;
    margin: 0 0 20px 0;
    max-width: none;
    color: #3e3e3e;
    font-size: 1.06em;
}

.chi-sono-immagini {
    position: relative !important;
    overflow: hidden;
    border-radius: 12px;
    border: 1px solid var(--gray-detail);
    box-shadow: 0 4px 18px rgba(0,0,0,0.08);
    cursor: pointer;
    display: block;
    width: 100%;
    margin: 0;
    height: 100%;
}
.chi-sono-immagini img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    transform-origin: center top;
    display: block;
    transition: transform 0.55s cubic-bezier(0.25, 1, 0.5, 1);
    will-change: transform;
}
.chi-sono-immagini:hover img,
.chi-sono-immagini.touch-active img {
    transform: scale(1.04);
}

/* Overlay foto profilo */
.foto-overlay {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    padding: 36px 22px 24px 22px;
    background: linear-gradient(to top, rgba(0,0,0,0.92) 0%, rgba(0,0,0,0.55) 55%, transparent 100%);
    transform: translateY(100%);
    -webkit-transform: translateY(100%);
    transition: transform 0.45s cubic-bezier(0.25, 1, 0.5, 1), -webkit-transform 0.45s cubic-bezier(0.25, 1, 0.5, 1);
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-radius: 0 0 12px 12px;
    z-index: 2;
    pointer-events: none;
}
.chi-sono-immagini:hover .foto-overlay,
.chi-sono-immagini.touch-active .foto-overlay {
    transform: translateY(0) !important;
    -webkit-transform: translateY(0) !important;
}

.foto-overlay-location {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 0.72em;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--accent);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.35s 0.12s ease, transform 0.35s 0.12s ease;
}
.foto-overlay-location svg {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
    stroke: var(--accent);
}
.foto-overlay-motto {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 1.08em;
    color: #fff;
    line-height: 1.45;
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.4s 0.22s ease, transform 0.4s 0.22s ease;
}
.chi-sono-immagini:hover .foto-overlay-location,
.chi-sono-immagini.touch-active .foto-overlay-location,
.chi-sono-immagini:hover .foto-overlay-motto,
.chi-sono-immagini.touch-active .foto-overlay-motto {
    opacity: 1;
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    .foto-overlay,
    .chi-sono-immagini img,
    .foto-overlay-location,
    .foto-overlay-motto {
        transition: none;
    }
    .chi-sono-immagini:hover .foto-overlay,
    .chi-sono-immagini.touch-active .foto-overlay {
        transform: translateY(0);
    }
}


/* ============ NAVBAR NERA + LOGO M ============ */
header {
    position: sticky;
    top: 0;
    z-index: 100;
}
nav {
    background: #000;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 82px;
    position: relative;
    padding: 0 48px;
    border-bottom: none;
    box-shadow: none;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}
nav.scrolled {
    background: rgba(0, 0, 0, 0.96);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}
.logo-img {
    height: 52px;
    width: auto;
    filter: drop-shadow(0 1px 7px #222a);
    background: none !important;
    margin: 0 auto;
}
@media (max-width: 600px) {
    .logo-img { height: 38px; max-width: 120px;}
}
.nav-links {
    display: flex;
    gap: 0;
    list-style: none;
    margin: 0; padding: 0;
}
.nav-links li { margin: 0; }
.nav-links a {
    color: var(--white);
    padding: 12px 20px;
    text-decoration: none;
    font-size: 1.06em;
    font-weight: 500;
    display: block;
    position: relative;
    transition: color 0.25s ease;
}
.nav-links a:not(.nav-whatsapp)::after {
    content: "";
    position: absolute;
    left: 20px;
    right: 20px;
    bottom: 4px;
    height: 2px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.nav-links a:not(.nav-whatsapp):hover::after,
.nav-links a:not(.nav-whatsapp):focus-visible::after,
.nav-links a.is-active::after {
    transform: scaleX(1);
}
.nav-links a.is-active { color: var(--accent); }
.nav-links a:not(.nav-whatsapp):focus-visible { outline: none; }
.menu-toggle { display: none; }

.nav-whatsapp { display: flex; align-items: center; gap: 9px; }
.wa-icon {
    width: 24px;
    height: 24px;
    fill: #25D366;
    flex-shrink: 0;
    transition: transform 0.22s cubic-bezier(0.2, 1, 0.3, 1);
}
.nav-whatsapp:hover .wa-icon,
.nav-whatsapp:focus-visible .wa-icon { transform: scale(1.14); }
.nav-whatsapp:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 10px; }
.nav-whatsapp-text { display: none; }

/* ============ HERO (INTRODUZIONE) CON VIDEO (ASPECT-RATIO) ============ */
#introduzione {
    position: relative; 
    background: #000; 
    color: var(--white);
    
    /* CORREZIONE FINALE: Rimuoviamo il padding fisso per aspect-ratio */
    padding: 60px 24px; 
    
    text-align: center;
    overflow: hidden; 
    
    height: calc(100vh - 82px);
    height: calc(100svh - 82px);
    min-height: 520px;
    max-height: 960px;
    
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
}

/* 1. Stile del Video (Luminosità finale) */
.hero-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; 
    z-index: 1; 
    opacity: 0.85; 
}

/* 2. Velo Scuro (Leggerezza finale) */
.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.45) 0%, rgba(0, 0, 0, 0.2) 45%, rgba(0, 0, 0, 0.6) 100%);
    z-index: 2;
}

/* 3. Contenitore per Logo e Testi */
.hero-content {
    position: relative;
    z-index: 3; 
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#introduzione h1 { 
    margin: 0; 
    line-height: 1.1; 
}

.hero-logo {
    display: block; 
    margin: 10px auto 25px auto; 
    max-width: 450px; 
    width: 90%; 
    height: auto;
    position: relative;
    z-index: 2;
}

/* ============ DRONE ANIMATO (POSIZIONE CORRETTA FINALE) ============ */
.hero-drone-container {
    position: absolute; 
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); 
    width: 100%; 
    height: 100%; 
    pointer-events: none; 
    z-index: 1; 
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-drone-wrapper {
    width: 160px; 
    height: auto;
    position: absolute;
    
    /* CORREZIONE FINALE: Alzato a 10% */
    top: 10%; 
    
    left: calc(50% + 250px); 
    transform: translate(-50%, -50%); 
    
    animation: float 5s ease-in-out infinite; 
    filter: drop-shadow(0 0 10px rgba(139, 154, 174, 0.4)); 
}

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

/* Luce di stato pulsante */
.hero-drone-wrapper::after {
    content: '';
    position: absolute;
    top: 60%; 
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background-color: #E63946; 
    border-radius: 50%;
    box-shadow: 0 0 7px 2px rgba(230, 57, 70, 0.8);
    animation: pulse-light 2.5s infinite linear;
    z-index: 10;
}

/* Keyframes */
@keyframes float {
    0% { transform: translate(-50%, -50%) translateY(0) rotateZ(0deg); }
    50% { transform: translate(-50%, -50%) translateY(-25px) rotateZ(1.5deg); }
    100% { transform: translate(-50%, -50%) translateY(0) rotateZ(0deg); }
}

@keyframes pulse-light {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* MEDIA QUERIES DRONE (Regolati per le nuove posizioni) */
@media (max-width: 1150px) {
    .hero-drone-wrapper {
        left: calc(50% + 200px); 
        width: 140px;
    }
}
@media (max-width: 950px) {
    .hero-drone-wrapper {
        left: calc(50% + 275px);
        top: 10%;
        width: 110px;
    }
}
@media (max-width: 700px) {
    .hero-drone-wrapper {
        display: none;
    }
    #introduzione h1 {
        font-size: 2.2em;
    }

    .cta-button {
        padding: 12px 24px;
        font-size: 1em;
        min-height: 48px;
    }
    .hero-cta {
        margin-top: 28px;
    }
}

/* ============ SCROLL INDICATOR HERO ============ */
.hero-scroll-indicator {
    position: absolute;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: rgba(255,255,255,0.6);
    font-size: 0.78em;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    animation: hero-bounce 2.2s ease-in-out infinite;
    pointer-events: none;
}
.hero-scroll-indicator svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: rgba(255,255,255,0.6);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
@keyframes hero-bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); opacity: 0.6; }
    50% { transform: translateX(-50%) translateY(8px); opacity: 1; }
}
@media (max-width: 700px) {
    .hero-scroll-indicator { display: none; }
}

/* ============ CTA BUTTON ============ */
.cta-button {
    background: var(--accent);
    color: var(--ink);
    border: 1.5px solid var(--gray-detail);
    box-sizing: border-box;
    border-radius: 8px;
    padding: 14px 32px;
    min-height: 48px;
    font-family: inherit;
    font-size: 1.09em;
    font-weight: 600;
    cursor: pointer;
    transition: background .22s, box-shadow .22s, border-color .22s, transform 0.22s cubic-bezier(0.2, 1, 0.3, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    box-shadow: 0 4px 24px 0 rgba(80, 100, 120, .08);
}
.cta-button:active {
    transform: scale(0.98);
}
.hero-cta {
    margin-top: 50px;
}
@media (hover: hover) {
    .cta-button:hover {
        background: #7289a0;
        color: var(--ink);
        border-color: var(--accent);
        transform: translateY(-3px);
        box-shadow: var(--neon-glow);
    }
}
.cta-arrow { font-size: 1.23em; }

.cta-button.outline {
    background: transparent;
    color: var(--white);
    border: 2px solid var(--accent);
}
@media (hover: hover) {
    .cta-button.outline:hover {
        background: var(--accent);
        color: var(--ink);
        border-color: var(--accent);
        transform: translateY(-3px);
        box-shadow: var(--neon-glow);
    }
}


/* ============ TRUST BANNER (MODIFICATO) ============ */
.trust-banner {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 28px;
    text-align: center;
    margin: 40px auto 10px auto;
    max-width: 1100px;
    font-size: 1.04em;
    padding: 0 24px;
    box-sizing: border-box;
}
.trust-banner > div {
    /* MODIFICA "V": Aggiunto flexbox per allineare icona e testo */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;

    padding: 28px 20px;
    font-weight: 500;
    color: var(--primary-alt);
    background: var(--white);
    border-radius: 16px;
    border: 1.5px solid var(--gray-detail);
    box-shadow: 0 4px 18px rgba(0,0,0,0.06);
    transition: border 0.22s, background 0.23s; 
}
.trust-banner > div:hover {
    border: 1.5px solid var(--accent);
    background: #f8f9fb;
    color: var(--primary);
}

/* MODIFICA "V": Nuova regola per l'icona SVG */
.trust-icon {
    width: 24px;
    height: 24px;
    fill: var(--accent); 
    flex-shrink: 0; 
}


/* ============ SEZIONI ALTERNATE ============ */
.section-alt {
    background: var(--primary); 
    color: var(--white);
    max-width: none;
    padding: 40px 0 70px 0;
}
.section-alt h2,
.section-alt .section-intro-p,
.section-alt h3,
.section-alt p {
    color: var(--white);
}
.section-alt h2::after {
    background: var(--gray-detail);
}

/* ============ [NUOVA REGOLA] CONTENITORE SEZIONI ALTERNATE ============ */
.section-alt > .video-gallery,
.section-alt > .gallery-wrapper,
.section-alt > .strumento-card,
.section-alt > #form-messages,
.section-alt > div {
     max-width: 1100px;
     margin-left: auto;
     margin-right: auto;
     padding-left: 24px;
     padding-right: 24px;
     box-sizing: border-box;
}
.section-alt > #form-messages {
     width: calc(100% - 32px);
     max-width: 650px;
     padding: 16px 22px;
     border-radius: 10px;
     text-align: center;
     font-weight: 500;
     line-height: 1.55;
     opacity: 0;
     transition: opacity 0.3s ease;
}
.section-alt > h2,
.section-alt > .section-intro-p,
.section-alt > .gallery-subtitle {
     max-width: 1100px;
     margin-left: auto;
     margin-right: auto;
    padding-left: 24px;
    padding-right: 24px;
    box-sizing: border-box;
}


/* MODIFICA PERFORMANCE: 
    Stili per la nuova "Video Facade"
*/
.video-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 250px;
    gap: 24px;
    margin-bottom: 40px;
}
@media (max-width: 900px) {
    .video-gallery {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 600px) {
    .video-gallery {
        grid-template-columns: 1fr;
        grid-auto-rows: 220px;
    }
}

.video-item {
    position: relative;
    background: var(--primary);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
    border: 1.5px solid var(--gray-detail);
    transition: transform 0.3s cubic-bezier(0.2, 1, 0.3, 1), box-shadow 0.3s ease, border 0.3s ease;
    cursor: pointer;
}
.video-item.is-playing {
    cursor: default;
}
.video-item:focus-visible {
    border-color: var(--accent);
    box-shadow: var(--neon-glow);
}
.video-item.feature-video {
    grid-column: span 2;
    grid-row: span 2;
}
@media (max-width: 900px) {
    .video-item.feature-video {
        grid-column: span 2;
        grid-row: span 1; 
    }
}
@media (max-width: 600px) {
    .video-item.feature-video {
        grid-column: span 1;
        grid-row: span 1;
    }
}
.video-item.format-vertical {
    grid-row: span 2;
}
@media (max-width: 600px) {
    .video-item.format-vertical {
        grid-row: span 2; 
        order: -1;
    }
}
.video-item.wide-video {
    grid-column: span 3;
}
@media (max-width: 900px) {
    .video-item.wide-video {
        grid-column: span 2;
    }
}
@media (max-width: 600px) {
    .video-item.wide-video {
        grid-column: span 1;
    }
}

@media (hover: hover) {
    .video-item:not(.is-playing):hover {
        border: 1.5px solid var(--accent);
        transform: translateY(-6px);
        box-shadow: var(--neon-glow);
    }
}

.video-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border: none;
    transition: transform 0.5s ease;
}
.video-item:hover img {
    transform: scale(1.05);
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0) 50%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    pointer-events: none;
    transition: opacity 0.3s;
}

.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 68px;
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    border: 1.5px solid rgba(255, 255, 255, 0.75);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    transition: transform 0.25s cubic-bezier(0.2, 1, 0.3, 1), background 0.25s, border-color 0.25s;
}
.play-button svg {
    width: 30px;
    height: 30px;
    margin-left: 3px;
    fill: var(--white);
    transition: fill 0.25s;
}
.video-item:hover .play-button,
.video-item:focus-visible .play-button {
    transform: translate(-50%, -50%) scale(1.1);
    background: var(--accent);
    border-color: var(--accent);
}
.video-item:hover .play-button svg,
.video-item:focus-visible .play-button svg {
    fill: var(--ink);
}

.video-info {
    padding: 20px;
    text-align: left;
    transform: translateY(0); /* partenza visibile */
    transition: transform 0.3s ease;
}
.video-item:hover .video-info {
    transform: translateY(0);
}
/* Su desktop mantieni il piccolo slide-up al hover */
@media (hover: hover) {
    .video-info {
        transform: translateY(10px);
    }
    .video-item:hover .video-info {
        transform: translateY(0);
    }
}
.video-info h4 {
    margin: 0;
    color: var(--white);
    font-size: 1.2rem;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    font-family: 'Montserrat', sans-serif;
}

/* Quando l'utente clicca e parte l'iframe, nascondiamo overlay e immagine per mostrare i controlli youtube */
.video-item.is-playing .video-overlay,
.video-item.is-playing img {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.video-item iframe {
    width: 100%; 
    height: 100%;
    border: none; 
    display: block;
    position: absolute;
    top: 0;
    left: 0;
}


/* ============ GALLERIA FOTO ============ */
h3.gallery-subtitle {
    color: var(--white);
    text-align: center;
    font-size: 1.4em;
    margin: 50px 0 25px 0;
}
h3.gallery-subtitle::after { 
    content: '';
    display: block;
    margin: 12px auto 0;
    width: 40px;
    height: 2px;
    background: var(--gray-detail);
    border-radius: 2px;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 30px;
    padding: 10px 0;
}
@media (max-width: 600px) {
    .photo-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

.photo-item {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 12px;
    border: 1.5px solid transparent;
    background: var(--primary-alt);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    cursor: zoom-in;
    opacity: 0;
    transform: translateY(28px) scale(0.96);
    transition: border-color 0.35s ease, box-shadow 0.35s ease;
}
.photo-item.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    transition: opacity 0.55s cubic-bezier(0.2, 1, 0.3, 1), transform 0.55s cubic-bezier(0.2, 1, 0.3, 1), border-color 0.35s ease, box-shadow 0.35s ease;
}
.photo-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.2, 1, 0.3, 1);
}
.photo-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.45), transparent 55%);
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
}
@media (hover: hover) {
    .photo-item:hover {
        border-color: var(--accent);
        box-shadow: var(--neon-glow);
    }
    .photo-item:hover img {
        transform: scale(1.07);
    }
    .photo-item:hover::after {
        opacity: 1;
    }
}
.photo-item:focus-visible {
    border-color: var(--accent);
    box-shadow: var(--neon-glow);
}

/* ======== LIGHTBOX ======== */
.lightbox {
    display: none;
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    align-items: center;
    justify-content: center;
    flex-direction: column;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.lightbox.active {
    display: flex;
    opacity: 1;
}
.lightbox-controls {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    pointer-events: none;
}
.lightbox-controls > * {
    pointer-events: auto;
}
.lightbox-counter {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
    letter-spacing: 0.08em;
    font-variant-numeric: tabular-nums;
}
.lightbox-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin-left: auto;
    padding: 0;
    background: none;
    border: none;
    color: white;
    font-size: 45px;
    line-height: 1;
    cursor: pointer;
    transition: color 0.3s;
}
.lightbox-close:hover {
    color: var(--accent);
}
.lightbox-content {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    position: relative;
}
#lightbox-img {
    max-height: 85vh;
    max-width: 85vw;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 0 30px rgba(0,0,0,0.8);
    user-select: none;
    animation: zoomIn 0.3s ease;
}
@keyframes zoomIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.lightbox-prev, .lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    font-size: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

.lightbox-prev:hover, .lightbox-next:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.1);
}

@media (max-width: 700px) {
    .lightbox-prev, .lightbox-next {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    .lightbox-prev { left: 10px; }
    .lightbox-next { right: 10px; }
    #lightbox-img {
        max-width: 95vw;
        max-height: 70vh;
    }
}


/* ============ CARD SEZIONI & GRID 2 COLONNE ============ */
.servizi-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    align-items: stretch;
}
@media (max-width: 850px) {
    .servizi-grid { grid-template-columns: 1fr; }
}
.servizio-card-laterale.wide-servizio {
    grid-column: span 2;
}
@media (max-width: 850px) {
    .servizio-card-laterale.wide-servizio {
        grid-column: span 1;
    }
}
.servizio-card-laterale {
    background: var(--white);
    color: var(--primary);
    padding: 36px 26px;
    border-radius: 16px;
    border: 1.5px solid var(--gray-detail);
    box-shadow: 0 4px 18px rgba(0,0,0,0.06);
    transition: border 0.22s, box-shadow 0.22s, background 0.23s, transform 0.22s cubic-bezier(0.2, 1, 0.3, 1); 
    position: relative;
    margin-bottom: 0;
}
.servizio-card-laterale h3 {
    color: var(--primary-alt);
    margin-top: 0;
    font-size: 1.19em;
    padding-bottom: 10px;
    margin-bottom: 15px;
    border-bottom: 1.5px solid var(--gray-detail);
}
@media (hover: hover) {
    .servizio-card-laterale:hover {
        border: 1.5px solid var(--accent);
        background: #f8f9fb;
        transform: translateY(-4px);
        box-shadow: var(--soft-lift);
    }
}
.servizio-card-laterale p { color: #47484a; }

.section-alt > .strumento-card {
    width: calc(100% - 32px);
}

/* ============ STRUMENTAZIONE CARD ============ */
.strumento-card {
    display: flex;
    gap: 22px;
    align-items: flex-start;
    margin-bottom: 32px;
    background: #111; 
    color: var(--white);
    border-radius: 16px;
    border: 1.5px solid var(--gray-detail);
    padding: 32px 26px;
    box-shadow: 0 4px 18px rgba(0,0,0,0.06);
    transition: transform 0.22s cubic-bezier(0.2, 1, 0.3, 1), box-shadow 0.22s; 
}
@media (hover: hover) {
    .strumento-card:hover {
        transform: translateY(-4px);
        border-color: var(--accent);
        box-shadow: var(--neon-glow);
    }
}

.strumento-card img {
    width: 160px;
    height: 160px; 
    border-radius: 10px;
    object-fit: cover; 
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    margin: 0 0 0 0;
    flex-shrink: 0;
}
.strumento-card h3 {
    color: var(--white);
    font-size: 1.13em;
    margin-bottom: 10px;
}
.strumento-card p { color: var(--white); }

/* ============ CONTATTI E FOOTER ============ */
.contatti-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 28px;
    margin-bottom: 28px;
}
.contatto-card {
    background: var(--white);
    color: var(--primary);
    border-radius: 14px;
    box-shadow: 0 4px 18px rgba(0,0,0,0.06);
    border: 1.2px solid var(--gray-detail);
    padding: 34px 18px;
    text-align: center;
    min-width: 0; /* evita che testi lunghi non spezzabili (email) sballino la colonna grid */
    transition: box-shadow 0.2s, border 0.18s, transform 0.22s cubic-bezier(0.2, 1, 0.3, 1);
}
@media (hover: hover) {
    .contatto-card:hover {
        border: 1.2px solid var(--accent);
        background: #f8f9fb;
        transform: translateY(-4px);
        box-shadow: var(--soft-lift);
    }
}
.contatto-card h3 { color: var(--primary-alt); font-size: 1.09em; }
.contatto-info { color: #47484a; }

.contatto-link {
    text-decoration: none;
    color: var(--primary-alt);
    transition: color 0.2s;
    overflow-wrap: anywhere;
}
.contatto-link.email-link {
    font-size: 0.9em;
}
.contatto-link:hover {
    text-decoration: underline;
    color: var(--accent-deep);
}

/* NUOVO STILE PER LE ICONE SOCIAL */
.social-row {
    display: flex;
    justify-content: center; /* Allinea le icone al centro orizzontalmente */
    gap: 20px; /* Spazio tra un'icona e l'altra */
    margin-top: 10px;
    flex-wrap: wrap;
}

.social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px; /* Area cliccabile confortevole */
    height: 44px;
    color: var(--primary-alt); /* Colore iniziale (grigio scuro) */
    transition: transform 0.22s cubic-bezier(0.2, 1, 0.3, 1), color 0.22s;
}

.social-icon svg {
    width: 28px; /* Dimensione visiva dell'icona */
    height: 28px;
    fill: currentColor; /* L'icona prende il colore del testo definito sopra */
}

.social-icon:hover {
    color: var(--accent-deep);
    transform: translateY(-4px);
}

/* ============ FORM ============ */
#contact-form {
    background: var(--white);
    padding: 40px 25px 35px 25px;
    border-radius: 14px;
    width: calc(100% - 48px);
    max-width: 650px;
    margin: 36px auto 30px auto;
    box-shadow: 0 6px 24px rgba(0,0,0,0.07);
    border: 1.3px solid var(--gray-detail);
    box-sizing: border-box;
    overflow: hidden;
}
#contact-form label {
    display: block;
    margin: 17px 0 7px 0;
    font-size: 0.98em;
    color: var(--primary-alt);
    font-weight: 500;
}
#contact-form input, #contact-form select, #contact-form textarea {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 13px 15px;
    margin-bottom: 6px;
    border-radius: 8px;
    border: 1px solid var(--gray-detail);
    background: #f8fafd;
    color: var(--primary);
    font-size: 1em;
    font-family: inherit;
    transition: border 0.17s, background 0.19s;
}
#contact-form input:focus, #contact-form select:focus, #contact-form textarea:focus {
    border-color: var(--accent-deep);
    background: #fff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(85, 103, 125, 0.25);
}
#contact-form input:user-invalid,
#contact-form select:user-invalid,
#contact-form textarea:user-invalid {
    border-color: #c0392b;
}
.checkbox-group {
    display: flex; 
    align-items: flex-start; 
    gap: 8px; 
    margin: 24px auto 0 auto; 
    justify-content: center;
    max-width: 400px;
}
#contact-form .checkbox-group label {
    text-align: left;
    margin: 0; 
    font-size: 0.9em; 
    line-height: 1.4;
    display: inline; 
    width: auto; 
    font-weight: 400; 
}
#contact-form .checkbox-group input[type="checkbox"] {
    display: inline-block; 
    width: 19px; 
    height: 19px; 
    margin-bottom: 0; 
    margin-top: 2px;
    flex-shrink: 0; 
}
.privacy-link {
    color: var(--accent-deep);
    text-decoration: underline;
}
.privacy-link:hover { color: #3f4f62; } 
#contact-form button[type="submit"] {
    background: var(--accent);
    color: var(--ink);
    padding: 14px 0;
    min-height: 52px;
    border-radius: 8px;
    border: none;
    font-size: 1.08em;
    font-weight: 600;
    cursor: pointer;
    margin-top: 26px;
    width: 100%;
    transition: background 0.22s, transform 0.22s cubic-bezier(0.2, 1, 0.3, 1), box-shadow 0.22s;
}
#contact-form button[type="submit"]:disabled {
    cursor: wait;
    opacity: 0.75;
}
#contact-form .form-note {
    margin: 14px 0 0;
    text-align: center;
    font-size: 0.9em;
    color: #5a5d61;
}
@media (hover: hover) {
    #contact-form button[type="submit"]:hover:not(:disabled) {
        background: #7289a0;
        transform: translateY(-3px);
        box-shadow: var(--neon-glow);
    }
}
.loading-spinner {
    display: inline-block;
    width: 18px; height: 18px;
    border: 2px solid var(--ink); border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
    vertical-align: middle;
}
.form-new-request {
    display: block;
    margin: 12px auto 0;
    padding: 10px 16px;
    background: none;
    border: none;
    color: inherit;
    font: inherit;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ FOOTER LOGO COMPLETO ============ */
footer {
    background: #000;
    color: var(--white);
    padding: 52px 24px 20px 24px; 
    margin-top: 0;
    text-align: center; 
    position: relative;
    box-sizing: border-box; 
}
.footer-content {
    max-width: 1100px;
    margin: 0 auto 18px auto;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    gap: 0;
}
.logo-footer-container {
    display: flex;
    flex-direction: column;
    align-items: center; 
    text-align: center;
    margin: 0 auto; 
}
.logo-full {
    height: 80px; 
    width: auto;
    display: block;
    filter: drop-shadow(0 2px 10px #0008);
    margin-bottom: 10px;
}
.certificazioni p {
    color: #b5b6ba;
    margin: 2px 0;
    font-size: 0.98em;
}

footer > p {
    font-size: 0.93em;
    color: #b5b6ba;
    margin-top: 18px;
    letter-spacing: .01em;
    text-align: center; 
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
}

/* ============ MODAL CURIOSITÀ ============ */
.modal-overlay {
    display: none; 
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s;
    padding: 20px;
    backdrop-filter: blur(5px); 
}
.modal-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}
.modal-content {
    background: var(--white);
    color: var(--primary-alt);
    padding: 30px;
    border-radius: 16px;
    max-width: 600px;
    width: 100%;
    box-shadow: 0 5px 30px rgba(0,0,0,0.2);
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.2, 1, 0.3, 1);
}
.modal-overlay.active .modal-content {
    transform: scale(1);
}
.modal-content h3 {
    color: var(--primary);
    margin-top: 0;
    text-align: center;
}
.modal-content p {
    font-size: 1.05em;
    line-height: 1.6;
}
.modal-close {
    position: absolute;
    top: 8px;
    right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    background: none;
    border: none;
    font-size: 2em;
    font-weight: bold;
    line-height: 1;
    color: #5a5d61;
    cursor: pointer;
    transition: color 0.2s;
}
.modal-close:hover {
    color: var(--primary-alt);
}


@media (min-width: 1025px) and (max-width: 1200px) {
    .nav-links a {
        padding: 12px 14px;
        font-size: 1em;
    }
    .nav-links a:not(.nav-whatsapp)::after {
        left: 14px;
        right: 14px;
    }
}

@media (max-width: 1024px) {
    nav {
        height: 64px;
        padding: 0 16px;
    }
    .logo-img { height: 38px; }
    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        padding: 8px 0 16px;
        background: rgba(0, 0, 0, 0.97);
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        box-shadow: 0 20px 30px rgba(0, 0, 0, 0.4);
    }
    .nav-links.active { display: flex; }
    .nav-links a {
        display: flex;
        align-items: center;
        min-height: 48px;
        padding: 12px 24px;
        box-sizing: border-box;
    }
    .nav-links a:not(.nav-whatsapp)::after { display: none; }
    .nav-whatsapp-text { display: inline; }
    .menu-toggle {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 5px;
        width: 48px;
        height: 48px;
        margin: 0 -8px 0 auto;
        padding: 0;
        background: none;
        border: none;
        cursor: pointer;
    }
    .menu-toggle span {
        width: 26px;
        height: 2px;
        background: var(--white);
        border-radius: 2px;
        transition: transform 0.3s ease, opacity 0.2s ease;
    }
    .menu-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    .menu-toggle.active span:nth-child(2) { opacity: 0; }
    .menu-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
    .servizi-grid { grid-template-columns: 1fr; }
    .strumento-card { flex-direction: column; align-items: center; }
    
    .trust-banner {
        grid-template-columns: 1fr 1fr;
    }

    .chi-sono-grid { 
        grid-template-columns: 1fr; 
        gap: 30px; 
    }
    .chi-sono-testo {
        max-width: 680px;
        margin: 0 auto;
    }
    .chi-sono-immagini {
        height: auto;
        max-width: 480px;
        aspect-ratio: 4 / 5;
        margin: 0 auto;
    }
}

@media (max-width: 700px) {
    h1 { font-size: 1.7em; }
    #introduzione h1 {
        font-size: 2.2em;
    }
    .subtitle {
        font-size: 1.2em;
    }

    /* === CORREZIONE VIDEO HERO (ASPECT-RATIO) === */
    #introduzione {
        height: calc(100vh - 64px);
        height: calc(100svh - 64px);
        min-height: 480px;
        padding: 60px 24px;
    }
    /* ======================================= */

    
    .trust-banner { 
        font-size: .97em; 
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 0 24px;
    }
    
    /* Regola per l'allineamento a sinistra (TRUST BANNER) */
    .trust-banner > div {
        justify-content: flex-start;
        text-align: left; 
    }

    .servizi-grid, .contatti-grid { grid-template-columns: 1fr;}
    .strumento-card { padding: 19px 8px;}
    #contact-form { padding: 28px 20px; width: calc(100% - 32px); }
    
    .footer-content { 
        flex-direction: column; 
        align-items: center; 
        justify-content: center;
    }

    .logo-footer-container { 
        align-items: center; 
        text-align: center; 
    }
    .logo-full { 
        height: 55px; 
        width: auto;
        margin-left: auto; 
        margin-right: auto;
    }
    

    /* Regole Gallerie Foto (MANTENUTE) */
    .gallery-item.format-contain {
        height: auto !important; 
        aspect-ratio: 1 / 1; 
    }
    .gallery-item.format-contain img {
        object-fit: contain !important; 
        background: #000; 
    }
}

@media (max-width: 480px) {
    h2 { font-size: 1.18em; }
    .footer-content { flex-direction: column; }
    
    .trust-banner {
        grid-template-columns: 1fr;
    }
    
    .checkbox-group {
        max-width: 90%;
        padding: 0 10px;
        box-sizing: border-box;
    }
}

.fade-in { 
    opacity: 0; 
    transform: translateY(60px); 
    transition: opacity 0.9s, transform 0.9s; 
}
.fade-in.show { opacity: 1; transform: none; }

/* ============ COOKIE BANNER ============ */
.cookie-banner {
    position: fixed;
    bottom: 20px;
    bottom: calc(20px + env(safe-area-inset-bottom));
    left: 20px;
    right: 20px;
    max-width: 600px;
    background: #fff;
    color: #333;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.2);
    z-index: 9999;
    border: 1px solid var(--border);
    display: none;
    font-family: 'Inter', sans-serif;
}
.cookie-banner-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: #999;
    cursor: pointer;
    padding: 5px;
    transition: color 0.2s;
}
.cookie-banner-close:hover {
    color: var(--primary);
}
.cookie-banner.active {
    display: block;
    animation: slideUp 0.4s ease-out;
}
.cookie-banner h3 {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 1.25em;
    color: var(--primary);
    font-family: 'Montserrat', sans-serif;
}
.cookie-banner p {
    font-size: 0.95em;
    line-height: 1.5;
    margin-bottom: 20px;
}
.cookie-banner a {
    color: var(--accent-deep);
    text-decoration: underline;
    font-weight: 500;
}
.cookie-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.cookie-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.95em;
    transition: background 0.2s, transform 0.2s;
    flex: 1;
    text-align: center;
    font-family: inherit;
}
.cookie-btn-accept {
    background: var(--primary);
    color: #fff;
}
.cookie-btn-accept:hover {
    background: var(--gray-hover);
    transform: translateY(-2px);
}
.cookie-btn-reject {
    background: transparent;
    border: 1.5px solid var(--primary);
    color: var(--primary);
}
.cookie-btn-reject:hover {
    background: #f4f4f4;
    transform: translateY(-2px);
}

@keyframes slideUp {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
@media (max-width: 679px) {
    .cookie-banner {
        left: 12px;
        right: 12px;
        bottom: calc(12px + env(safe-area-inset-bottom));
        padding: 18px 16px 16px;
    }
    .cookie-banner h3 {
        margin-bottom: 8px;
        padding-right: 28px;
        font-size: 1.1em;
    }
    .cookie-banner p {
        margin-bottom: 14px;
        font-size: 0.85em;
        line-height: 1.45;
    }
    .cookie-btn {
        padding: 12px 10px;
        font-size: 0.88em;
    }
}
@media (min-width: 680px) {
    .cookie-banner {
        left: auto;
        right: 20px;
        width: 450px;
    }
}
.section-alt > .reviews-consent {
    width: calc(100% - 48px);
    max-width: 640px;
    padding: 32px 24px;
    text-align: center;
    border: 1.5px dashed rgba(187, 187, 187, 0.45);
    border-radius: 16px;
}
.reviews-consent p {
    margin: 0 0 20px;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
