/* Import Font */
@import url('https://fonts.googleapis.com/css2?family=Roboto+Condensed:wght@700&family=Roboto:wght@400;500&display=swap');

/* Variabili */
:root {
    --primary-color: #0033cc; /* Il blu del tuo logo! */
    --dark-bg: #1a1a1a;
    --medium-bg: #2c2c2c;
    --text-color: #e0e0e0;
    --text-dark: #111;
    --white: #ffffff;
    --shadow: 0 5px 15px rgba(0,0,0,0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

body {
    font-family: 'Roboto', sans-serif;
    line-height: 1.7;
    color: var(--text-color);
    background-color: var(--dark-bg);
}

body.no-scroll {
    height: 100vh;
    overflow: hidden;
    position: relative;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

h1, h2, h3 {
    font-family: 'Roboto Condensed', sans-serif;
    text-transform: uppercase;
    letter-spacing: 1px;
}

h2 {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 40px;
    color: var(--white); /* Ora in blu */
}

section {
    padding: 80px 0;
}

/* Header & Navigazione con Glassmorphism */
header {
    background: rgba(18, 18, 24, 0.65);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: sticky;
    top: 0;
    z-index: 1000;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    gap: 30px;
    position: relative;
}

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

.logo img {
    height: 56px;
    display: block;
}

.nav-links {
    display: flex;
    list-style: none;
}

.nav-links li {
    margin-left: 35px;
}

.nav-links a {
    text-decoration: none;
    color: var(--white);
    font-weight: 700;
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 1.1rem;
    padding: 8px 16px;
    border-radius: 999px;
    transition: color 0.3s ease, background 0.3s ease;
}

.nav-links a:hover {
    color: var(--primary-color); /* Ora in blu */
    background: rgba(255, 255, 255, 0.08);
}

.hamburger {
    display: none;
    width: 50px;
    height: 50px;
    border: none;
    background: transparent;
    cursor: pointer;
    justify-content: center;
    align-items: center;
    padding: 6px;
    position: relative;
    flex-direction: column;
    gap: 8px;
}

.hamburger:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.65);
    outline-offset: 4px;
    border-radius: 14px;
}

.hamburger-line {
    display: block;
    width: 28px;
    height: 2px;
    background: var(--white);
    margin: 0;
    border-radius: 999px;
    transition: transform 0.4s cubic-bezier(0.76, 0, 0.24, 1), opacity 0.3s ease;
    transform-origin: center;
}

.hamburger.active .line-1 {
    transform: translateY(9px) rotate(45deg);
}

.hamburger.active .line-2 {
    opacity: 0;
}

.hamburger.active .line-3 {
    transform: translateY(-9px) rotate(-45deg);
}

/* Hero Section CON LA TUA FOTO */
.hero {
    height: 85vh;
    background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url('images/cancello5.jpeg') center center/cover no-repeat;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: var(--white);
}

.hero-content {
    max-width: 800px;
}

.hero h1 {
    font-size: 4rem;
    margin-bottom: 10px;
    color: var(--white);
}

.hero .subtitle {
    font-size: 1.3rem;
    margin-bottom: 30px;
    color: var(--text-color);
}

.btn {
    display: inline-block;
    background: var(--primary-color); /* Ora in blu */
    color: var(--white);
    padding: 15px 30px;
    text-decoration: none;
    font-weight: 700;
    font-family: 'Roboto Condensed', sans-serif;
    text-transform: uppercase;
    transition: all 0.3s ease;
    border: 2px solid var(--primary-color); /* Ora in blu */
}

.btn:hover {
    background: transparent;
    color: var(--primary-color); /* Ora in blu */
    transform: scale(1.05);
}

.cta-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 30px;
    flex-wrap: wrap;
}

.btn.secondary {
    background: transparent;
    color: var(--white);
    border: 2px solid var(--white);
}

.btn.secondary:hover {
    background: var(--primary-color);
    color: var(--white);
}

/* Sezioni */
.about {
    background-color: var(--dark-bg);
    text-align: center;
}
.about p {
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.1rem;
}

.services {
    background-color: var(--dark-bg);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.card {
    background: var(--medium-bg);
    padding: 35px 30px;
    border: 1px solid #444;
    text-align: center;
    transition: background-color 0.3s ease, transform 0.3s ease;
}
.card:hover {
    background-color: #3a3a3a;
    transform: translateY(-5px);
}
.card i {
    font-size: 40px;
    color: var(--primary-color); /* Ora in blu */
    margin-bottom: 20px;
}
.card h3 {
    margin-bottom: 15px;
    font-size: 1.4rem;
    color: var(--white);
}

/* Stili Galleria */
.gallery {
    background: linear-gradient(125deg, #0f0f15 0%, #171c28 50%, #08101e 100%);
    position: relative;
}

.gallery-head {
    text-align: center;
    max-width: 720px;
    margin: 0 auto 50px;
}

.gallery-kicker {
    font-size: 0.85rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 12px;
}

.gallery-subtitle {
    color: rgba(255, 255, 255, 0.75);
    margin-top: 15px;
}

.gallery-slider {
    position: relative;
    display: flex;
    align-items: center;
    gap: 20px;
    justify-content: center;
}

.gallery-slider::before,
.gallery-slider::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 120px;
    pointer-events: none;
    z-index: 5;
}

.gallery-slider::before {
    left: 10px;
    background: linear-gradient(90deg, rgba(8, 16, 30, 1) 0%, rgba(8, 16, 30, 0) 100%);
}

.gallery-slider::after {
    right: 10px;
    background: linear-gradient(270deg, rgba(8, 16, 30, 1) 0%, rgba(8, 16, 30, 0) 100%);
}

.gallery-viewport {
    flex: 1;
    overflow: hidden;
    position: relative;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    min-height: 400px;
}

.gallery-viewport::-webkit-scrollbar {
    display: none;
}

.gallery-track {
    display: flex;
    gap: 40px;
    padding: 30px 40px 60px;
    align-items: center;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 28px;
    cursor: pointer;
    box-shadow: 0 25px 45px rgba(0, 0, 0, 0.45);
    transform: translateZ(0);
    opacity: 0.45;
    filter: saturate(0.65);
    transform: perspective(1000px) translateZ(-65px) scale(0.78);
    transition: transform 0.45s cubic-bezier(0.19, 1, 0.22, 1), box-shadow 0.35s ease, opacity 0.35s ease, filter 0.35s ease;
    min-width: clamp(260px, 45vw, 420px);
    height: clamp(320px, 55vh, 460px);
    scroll-snap-align: center;
    background: #05070b;
}

.gallery-item::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(4, 4, 4, 0) 20%, rgba(1, 7, 15, 0.85) 100%);
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.gallery-item.is-active {
    opacity: 1;
    filter: saturate(1) brightness(1.05);
    transform: perspective(1000px) translateZ(0) scale(1) translateY(-12px);
    z-index: 3;
    box-shadow: 0 45px 80px rgba(0, 0, 0, 0.65);
}

.gallery-item.is-active::after {
    opacity: 1;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s ease;
}

.gallery-item figcaption {
    position: absolute;
    inset: 0;
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    z-index: 2;
    transform: translateY(20px);
    opacity: 0;
    transition: transform 0.35s ease, opacity 0.35s ease;
}

.gallery-item.is-active figcaption {
    transform: translateY(0);
    opacity: 1;
}

.gallery-tag {
    align-self: flex-start;
    font-size: 0.78rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    background: linear-gradient(120deg, rgba(0, 102, 255, 0.9), rgba(0, 51, 204, 0.75));
    color: var(--white);
    padding: 6px 15px;
    border-radius: 999px;
    margin-bottom: 14px;
    box-shadow: 0 8px 20px rgba(0, 102, 255, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.gallery-item strong {
    font-size: 1.3rem;
    color: var(--white);
}

.gallery-item p {
    margin-top: 6px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.95rem;
}

.gallery-item:not(.is-active):hover {
    opacity: 0.7;
    filter: saturate(0.85);
    transform: perspective(1000px) translateZ(-20px) scale(0.88);
}

.gallery-item.tall {
    height: clamp(360px, 60vh, 520px);
}

.gallery-item.wide {
    min-width: clamp(320px, 60vw, 540px);
}

.gallery-item.highlight {
    border: 1px solid rgba(0, 102, 255, 0.35);
    box-shadow: 0 35px 65px rgba(0, 51, 204, 0.35);
}

.gallery-item:hover {
    transform: translateY(-6px);
    box-shadow: 0 35px 55px rgba(0, 0, 0, 0.6);
}

.gallery-item:hover img {
    transform: scale(1.12);
}

.gallery-item:hover::after {
    opacity: 1;
}

.gallery-item:hover figcaption {
    transform: translateY(0);
    opacity: 1;
}

.gallery-nav {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(5, 8, 18, 0.75);
    color: var(--white);
    font-size: 1.4rem;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 6;
    transition: border-color 0.3s ease, transform 0.3s ease, background 0.3s ease;
    backdrop-filter: blur(8px);
}

.gallery-nav i {
    font-size: 1.1rem;
}

.gallery-nav .mobile-icon {
    display: none;
}

.gallery-nav:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-3px);
}

.gallery-nav:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    border-color: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.4);
    transform: none;
}

.gallery-progress {
    margin-top: 15px;
    height: 4px;
    width: 100%;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    overflow: hidden;
}

.gallery-progress .progress-bar {
    display: block;
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, rgba(0, 136, 255, 1) 0%, rgba(0, 51, 204, 1) 100%);
    transform-origin: left;
    transform: scaleX(0);
    transition: transform 0.25s ease;
}

/* Stili Lightbox */
.lightbox {
    display: none;
    position: fixed;
    z-index: 2000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    justify-content: center;
    align-items: center;
}

.lightbox.active {
    display: flex;
}

.lightbox-content {
    max-width: 90%;
    max-height: 80%;
    object-fit: contain;
}

.lightbox-close, .lightbox-prev, .lightbox-next {
    position: absolute;
    color: var(--white);
    font-size: 40px;
    cursor: pointer;
    user-select: none;
    transition: color 0.3s;
}

.lightbox-close:hover, .lightbox-prev:hover, .lightbox-next:hover {
    color: var(--primary-color); /* Ora in blu */
}

.lightbox-close {
    top: 20px;
    right: 35px;
}

.lightbox-prev, .lightbox-next {
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }


/* Contatti */
.contact {
    background-color: var(--dark-bg);
}
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
    margin-top: 40px;
}
.contact-info p {
    font-size: 1.1rem;
    margin-bottom: 15px;
}
.contact-info i {
    color: var(--primary-color); /* Ora in blu */
    margin-right: 15px;
    width: 20px;
    text-align: center;
}
.contact-info a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s ease;
}
.contact-info a:hover {
    color: var(--primary-color); /* Ora in blu */
}

/* Footer */
footer {
    background: #000;
    text-align: center;
    padding: 30px 0;
    font-size: 0.9rem;
    color: #aaa;
}
footer p {
    margin-bottom: 5px;
}

/* Pulsante Fluttuante CTA (FAB) */
.fab-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1500;
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
}

.fab-main {
    width: 60px;
    height: 60px;
    background-color: var(--primary-color); /* Ora in blu */
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--white);
    font-size: 28px;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease;
}

.fab-main:hover {
    transform: rotate(15deg);
}

.fab-options {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 15px;
    transition: all 0.3s ease;
    transform: scaleY(0);
    transform-origin: bottom;
}

.fab-container.active .fab-options {
    transform: scaleY(1);
}

.fab-option {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--medium-bg);
    color: var(--white);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    margin-bottom: 10px;
    text-decoration: none;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease;
}

.fab-option:hover {
    background-color: var(--primary-color); /* Ora in blu */
    transform: scale(1.1);
}

/* Responsive */
@media(max-width: 768px) {
    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }
    
    .nav-links {
        position: fixed; top: 0; right: -100%; width: 100%; height: 100vh; 
        background: linear-gradient(165deg, rgba(5, 9, 18, 0.98) 0%, rgba(10, 22, 45, 0.95) 70%);
        border: none;
        backdrop-filter: blur(28px);
        flex-direction: column; align-items: center; justify-content: flex-start;
        padding-top: 110px; transition: right 0.4s ease-in-out;
        box-shadow: inset 0 20px 35px rgba(0, 0, 0, 0.35);
    }
    .nav-links.active { right: 0; }
    .nav-links li { margin: 20px 0; }
    .hamburger { display: flex; }
    .contact-grid { grid-template-columns: 1fr; }
    .hero {
        height: auto;
        min-height: calc(100vh - 80px);
        padding: 120px 18px 90px;
        margin-top: 0;
        justify-content: flex-start;
        text-align: left;
        background-position: top center;
    }
    .hero-content {
        width: 100%;
        max-width: 520px;
    }
    .hero h1 {
        font-size: 2.4rem;
        line-height: 1.2;
    }
    .hero .subtitle {
        font-size: 1.05rem;
        line-height: 1.6;
        margin-top: 10px;
        margin-bottom: 24px;
        color: rgba(255, 255, 255, 0.85);
    }
    .hero .btn {
        width: 100%;
        text-align: center;
        letter-spacing: 0.1em;
    }
    .gallery-slider {
        flex-direction: column;
        gap: 15px;
    }
    .gallery-slider::before,
    .gallery-slider::after {
        width: 100%;
        height: 120px;
        left: 0;
        right: 0;
    }
    .gallery-slider::after {
        top: auto;
        bottom: 0;
        background: linear-gradient(0deg, rgba(8, 16, 30, 1) 0%, rgba(8, 16, 30, 0) 100%);
    }
    .gallery-slider::before {
        top: 0;
        bottom: auto;
        left: 0;
        background: linear-gradient(180deg, rgba(8, 16, 30, 1) 0%, rgba(8, 16, 30, 0) 100%);
    }
    .gallery-nav {
        width: 52px;
        height: 52px;
        align-self: center;
    }
    .gallery-nav.next { order: 1; }
    .gallery-viewport { order: 2; }
    .gallery-nav.prev { order: 3; }
    .gallery-nav .desktop-icon { display: none; }
    .gallery-nav .mobile-icon { display: inline-block; }
    .gallery-viewport {
        min-height: unset;
        max-height: 560px;
        overflow-x: hidden;
        overflow-y: auto;
        scroll-snap-type: y proximity;
    }
    .gallery-track {
        flex-direction: column;
        padding: 20px 20px 30px;
        gap: 24px;
    }
    .gallery-item {
        min-width: 100%;
        width: 100%;
        height: clamp(260px, 60vh, 420px);
    }
    .gallery-item.tall {
        height: clamp(320px, 70vh, 480px);
    }
}

*/
.certs {
    background-color: var(--dark-bg);
}

.certs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.cert-card {
    background: var(--medium-bg);
    border: 1px solid #444;
    padding: 30px;
    text-align: center;
    /* Aggiunta la transizione per rendere l'animazione fluida */
    transition: background-color 0.3s ease, transform 0.3s ease;
}

/* Aggiunto l'effetto al passaggio del mouse */
.cert-card:hover {
    background-color: #3a3a3a;
    transform: translateY(-5px);
}

.cert-card i {
    font-size: 40px;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.cert-card h3 {
    margin-bottom: 15px;
    font-size: 1.4rem;
    color: var(--white);
}

/* --- LEGAL MODAL (Privacy + Termini) --- */

.legal-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    padding: 20px;
}

.legal-modal.active {
    display: flex;
    animation: fadeIn 0.25s ease;
}

.legal-modal-content {
    background: #1c1c1c;
    width: 95%;
    max-width: 760px;
    max-height: 85vh;
    border-radius: 16px;
    padding: 30px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 28px rgba(0,0,0,0.5);
}

.legal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    color: #fff;
    font-size: 32px;
    cursor: pointer;
}

.legal-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.tab-btn {
    padding: 10px 20px;
    background: #2c2c2c;
    border: 1px solid #444;
    border-radius: 8px;
    cursor: pointer;
    color: #ddd;
    font-weight: 600;
    transition: 0.2s;
}

.tab-btn.active,
.tab-btn:hover {
    background: var(--primary-color);
    color: #fff;
}

.legal-tabs-content {
    overflow-y: auto;
    padding-right: 10px;
    max-height: 70vh;
}

.legal-tab {
    display: none;
    color: #ddd;
    line-height: 1.6;
    font-size: 1rem;
}

.legal-tab.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(.95); }
    to   { opacity: 1; transform: scale(1); }
}

/* --- STYLE CONTENUTI PRIVACY + TERMINI --- */
.legal-tab {
    padding: 20px 10px 30px;
    max-width: 800px;        /* larghezza massima del contenuto */
    margin: 0 auto;          /* centrato */
    text-align: left;        /* testo leggibile */
    line-height: 1.6;
    color: #e0e0e0;
}

.legal-tab h1,
.legal-tab h2 {
    text-align: center;      /* titoli centrati */
    color: var(--primary-color);
    margin-bottom: 18px;
}

.legal-tab ul {
    margin: 15px 0 20px 20px;
    padding-left: 15px;
}

.legal-tab li {
    margin-bottom: 8px;
}

/* Migliora scorrimento modale */
.legal-modal-content {
    max-height: 85vh;
    overflow-y: auto;
    padding-right: 15px; /* evita che la scrollbar tocchi il testo */
}

/* Migliora leggibilità dei paragrafi */
.legal-tab p {
    margin-bottom: 18px;
}

/* Titoli interni (solo nel popup), più piccoli */
.legal-tab h2 {
    font-size: 1.1rem !important;
    margin-top: 20px;
    margin-bottom: 10px;
    text-align: center;
    color: var(--wh);
}

.legal-tab h3 {
    font-size: 1rem !important;
    margin-top: 16px;
    margin-bottom: 8px;
    text-align: center;
    color: var(--white);
}

/* Mantieni gli H1 belli grandi */
.legal-tab h1 {
    font-size: 1.6rem !important;
    margin-bottom: 20px;
    text-align: center;
    color: var(--white);
}
