/* --- FONT LOCALE: INTER --- */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('inter-regular.woff2') format('woff2');
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('inter-semibold.woff2') format('woff2');
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 800;
    font-display: swap;
    src: url('inter-extrabold.woff2') format('woff2');
}

/* --- RESET E VARIABILI GLOBALI --- */
:root {
    --primary-blue: #004d99;
    --secondary-blue: #007bff;
    --accent-red: #e63946;
    --bg-light: #f4f7f6;
    --text-dark: #1d3557;
    --text-body: #4a5568;
    --white: #ffffff;
    --success-green: #2ecc71;
    --success-hover: #27ae60;
    --whatsapp-green: #25d366;
    
    --shadow-sm: 0 2px 10px rgba(0,0,0,0.05);
    --shadow-md: 0 10px 30px rgba(0,0,0,0.08);
    --shadow-lg: 0 20px 40px rgba(0,0,0,0.12);
    
    --radius-md: 12px;
    --radius-lg: 20px;
    
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.7;
    color: var(--text-body);
    background-color: var(--white);
    padding-top: 80px; /* Spazio per la navbar fixed */
    overflow-x: hidden;
}

h1, h2, h3, h4 {
    color: var(--text-dark);
    line-height: 1.3;
    font-weight: 800;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* --- NAVIGAZIONE (GLASSMORPHISM) --- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 80px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: var(--shadow-sm);
    z-index: 1000;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    transition: var(--transition);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary-blue);
    gap: 15px;
}

.logo img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: var(--shadow-sm);
}

.nav-menu {
    display: flex;
    list-style: none;
    align-items: center;
    gap: 30px;
}

.nav-link {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    cursor: pointer;
    position: relative;
    padding: 8px 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--secondary-blue);
    transition: var(--transition);
}

.nav-link:hover::after {
    width: 100%;
}
.nav-link:hover { color: var(--secondary-blue); }

.arrow {
    width: 16px;
    height: 16px;
    margin-left: 6px;
    transition: transform 0.3s ease;
}

/* Dropdown Desktop */
.dropdown-container { position: relative; }

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--white);
    box-shadow: var(--shadow-md);
    min-width: 220px;
    border-radius: var(--radius-md);
    padding: 10px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(15px);
    transition: all 0.3s ease;
    border: 1px solid rgba(0,0,0,0.05);
}

@media (min-width: 992px) {
    .dropdown-container:hover .dropdown-menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
    .dropdown-container:hover .arrow {
        transform: rotate(180deg);
    }
}

.dropdown-menu a {
    display: block;
    padding: 12px 25px;
    text-decoration: none;
    color: var(--text-body);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
}

.dropdown-menu a:hover {
    background-color: var(--bg-light);
    color: var(--secondary-blue);
    padding-left: 30px;
}

/* Hamburger Animato */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    width: 32px;
    height: 22px;
    justify-content: space-between;
    z-index: 1100;
}

.hamburger span {
    display: block;
    height: 3px;
    width: 100%;
    background: var(--text-dark);
    border-radius: 3px;
    transition: var(--transition);
}

.hamburger.open span:nth-child(1) { transform: translateY(9.5px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; transform: translateX(-20px); }
.hamburger.open span:nth-child(3) { transform: translateY(-9.5px) rotate(-45deg); }

/* --- HERO SECTION --- */
.hero {
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
    color: var(--white);
    padding: 60px 20px 0;
    text-align: center;
    border-bottom-left-radius: 50px;
    border-bottom-right-radius: 50px;
    margin-bottom: 60px;
}

.hero-content h1 {
    font-size: clamp(1.8rem, 4vw, 3rem);
    max-width: 900px;
    margin: 0 auto 40px;
    color: var(--white);
    letter-spacing: -0.5px;
}

.hero-image-wrapper {
    max-width: 1000px;
    margin: 0 auto;
    transform: translateY(40px); /* Crea sovrapposizione col main */
}

.hero-img {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

/* --- CONTENUTI MAIN --- */
.main-content {
    max-width: 950px;
    margin: 80px auto 40px;
    padding: 0 20px;
}

section { margin-bottom: 60px; }

h2 {
    color: var(--primary-blue);
    margin: 50px 0 25px;
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    position: relative;
    padding-left: 20px;
}

h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 5px;
    bottom: 5px;
    width: 6px;
    background: var(--accent-red);
    border-radius: 10px;
}

p { margin-bottom: 1.2rem; font-size: 1.1rem; text-align: left; }

/* Liste custom */
.custom-list {
    background-color: var(--bg-light);
    padding: 35px 35px 35px 50px;
    border-radius: var(--radius-md);
    list-style: none;
    margin: 30px 0;
    box-shadow: var(--shadow-sm);
}

.custom-list li {
    margin-bottom: 18px;
    position: relative;
    font-size: 1.05rem;
}

.custom-list li::before {
    content: '💧';
    position: absolute;
    left: -30px;
    top: 2px;
}

/* --- CTA SECTION --- */
.cta-section {
    background: linear-gradient(135deg, var(--text-dark), #112240);
    color: var(--white);
    padding: 60px 40px;
    border-radius: var(--radius-lg);
    text-align: center;
    margin: 80px 0;
    box-shadow: var(--shadow-md);
}

.cta-section h2 { color: var(--white); border: none; padding: 0; text-align: center; }
.cta-section h2::before { display: none; }

.btn-call {
    display: inline-block;
    background-color: var(--success-green);
    color: var(--white);
    padding: 18px 40px;
    margin-top: 20px;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 800;
    font-size: 1.2rem;
    transition: var(--transition);
    box-shadow: 0 8px 25px rgba(46, 204, 113, 0.4);
}

.btn-call:hover {
    background-color: var(--success-hover);
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(46, 204, 113, 0.5);
}

/* --- GRID CARDS (Soluzioni) --- */
.solutions-container { max-width: 1200px; margin: 0 auto 80px; padding: 0 20px; }
.text-center { text-align: center; padding: 0; }
.text-center::before { display: none; }

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

.card {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 40px 30px;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0,0,0,0.04);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-md);
}

.card-tag {
    display: inline-block;
    background: rgba(0, 123, 255, 0.1);
    color: var(--secondary-blue);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card h3 { color: var(--primary-blue); font-size: 1.5rem; margin-bottom: 20px; }
.card p { font-size: 1rem; color: var(--text-body); text-align: left; margin-bottom: 20px; }

.card-link, .tech-link {
    color: var(--accent-red);
    font-weight: 700;
    text-decoration: none;
    text-transform: uppercase;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    transition: var(--transition);
}

.card-link:hover, .tech-link:hover { gap: 10px; color: #b00320; }

/* --- TECH GRID --- */
.tech-overview {
    background-color: var(--bg-light);
    padding: 100px 20px;
    margin-top: 60px;
}

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

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

.tech-card {
    background: var(--white);
    padding: 35px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 1px solid transparent;
}

.tech-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.tech-card h3 { color: var(--primary-blue); margin-bottom: 15px; font-size: 1.3rem; }
.tech-card p { font-size: 0.95rem; text-align: left; margin-bottom: 25px; }

.tech-card-highlight {
    background: linear-gradient(to bottom right, #ffffff, #f0f7ff);
    border-color: rgba(0, 123, 255, 0.3);
}

/* --- FOOTER --- */
footer {
    background-color: #0a192f;
    color: #a8b2d1;
    padding: 80px 20px 30px;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 50px;
}

.footer-col h4 {
    color: var(--white);
    margin-bottom: 25px;
    font-size: 1.1rem;
    position: relative;
    padding-bottom: 10px;
}

.footer-col h4::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 40px;
    height: 2px;
    background: var(--accent-red);
}

.footer-col p { font-size: 0.95rem; text-align: left; }
.footer-col a { color: #a8b2d1; text-decoration: none; display: block; margin-bottom: 12px; transition: var(--transition); font-size: 0.95rem; }
.footer-col a:hover { color: var(--secondary-blue); padding-left: 5px; }

.province-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }

.footer-bottom {
    text-align: center;
    padding-top: 40px;
    margin-top: 60px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.85rem;
    color: #8892b0;
}

/* --- STICKY BUTTON MOBILE --- */
.btn-sticky-call-green {
    display: none;
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 65px;
    height: 65px;
    background-color: var(--whatsapp-green);
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
    z-index: 9999;
    transition: var(--transition);
    animation: pulse-green 2s infinite;
}

.btn-sticky-call-green:hover { transform: scale(1.1); background-color: #128c7e; }

@keyframes pulse-green {
    0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.6); }
    70% { box-shadow: 0 0 0 15px rgba(37, 211, 102, 0); }
    100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

/* --- ANIMAZIONI SCROLL --- */
.fade-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- RESPONSIVE MEDIA QUERIES --- */
@media (max-width: 991px) {
    .btn-sticky-call-green { display: flex; }
    .hamburger { display: flex; }
    
    .nav-menu {
        position: fixed;
        top: 80px;
        right: -100%;
        width: 100%;
        max-width: 350px;
        height: calc(100vh - 80px);
        background: var(--white);
        flex-direction: column;
        align-items: flex-start;
        padding: 40px 30px;
        transition: 0.4s cubic-bezier(0.77, 0, 0.175, 1);
        box-shadow: -10px 0 30px rgba(0,0,0,0.1);
        overflow-y: auto;
    }
    
    .nav-menu.active { right: 0; }
    .nav-item { width: 100%; margin-bottom: 5px; }
    .nav-link { font-size: 1.2rem; padding: 15px 0; border-bottom: 1px solid #eee; width: 100%; justify-content: space-between;}
    .nav-link::after { display: none; }
    
    .dropdown-menu {
        position: static;
        display: none;
        box-shadow: none;
        padding-left: 15px;
        border: none;
        opacity: 1;
        visibility: visible;
        transform: none;
        background: var(--bg-light);
        margin-top: 10px;
    }
    
    .dropdown-menu.show { display: block; }
    
    .hero { padding: 40px 20px 0; border-bottom-left-radius: 30px; border-bottom-right-radius: 30px; }
    .main-content { margin-top: 50px; }
    .hero-image-wrapper { transform: translateY(25px); }
    .cta-section { padding: 40px 20px; }
}

/* --- OVERLAY COOKIE PRIVACY (Schermo intero con sfocatura) --- */

/* Il contenitore principale che copre l'intero schermo */
.cookie-banner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(255, 255, 255, 0.4); /* Sfondo bianco semi-trasparente */
    backdrop-filter: blur(10px); /* Sfoca il sito sottostante */
    -webkit-backdrop-filter: blur(10px); /* Per Safari */
    z-index: 999999; /* Sopra tutto il resto */
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0; /* Nascosto di default */
    visibility: hidden; /* Nasconde l'elemento per i click */
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.cookie-banner.show {
    opacity: 1;
    visibility: visible;
}

/* Il vero e proprio riquadro bianco centrale */
.cookie-content {
    background-color: var(--white);
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 500px;
    width: 90%; /* Adattabile su mobile */
    text-align: center;
    transform: scale(0.9); /* Leggermente rimpicciolito in partenza */
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* Effetto rimbalzo */
}

.cookie-banner.show .cookie-content {
    transform: scale(1); /* Torna a dimensione normale quando mostrato */
}

.cookie-content p {
    font-size: 1.05rem;
    color: var(--text-dark);
    margin-bottom: 25px;
    line-height: 1.6;
}

.cookie-buttons {
    display: flex;
    flex-direction: column; /* Impilati verticalmente di default */
    gap: 15px;
    align-items: center;
}

.btn-cookie {
    width: 100%; /* I bottoni prendono tutta la larghezza */
    padding: 15px 20px;
    border-radius: 50px; /* Bordi arrotondati come gli altri pulsanti del sito */
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
}

.btn-accept {
    background-color: var(--primary-blue);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(0, 77, 153, 0.3);
}

.btn-accept:hover {
    background-color: var(--secondary-blue);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 77, 153, 0.4);
}

.btn-policy {
    background-color: transparent;
    color: var(--text-body);
    border: 2px solid #e2e8f0;
}

.btn-policy:hover {
    background-color: var(--bg-light);
    color: var(--text-dark);
}

/* Layout orizzontale per schermi più grandi */
@media (min-width: 600px) {
    .cookie-buttons {
        flex-direction: row;
    }
    .btn-cookie {
        width: 50%; /* Metà larghezza ciascuno */
    }
}

/* --- STILI FORM DI CONTATTO --- */
.modern-form .form-group {
    margin-bottom: 20px;
}

.modern-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
    color: var(--primary-blue);
    font-size: 0.95rem;
}

.modern-form input[type="text"],
.modern-form input[type="tel"],
.modern-form select,
.modern-form textarea {
    width: 100%;
    padding: 14px 15px;
    border: 1px solid #d1d5db;
    border-radius: var(--radius-md);
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    color: var(--text-dark);
    background-color: var(--bg-light);
    transition: var(--transition);
}

.modern-form input:focus, 
.modern-form select:focus, 
.modern-form textarea:focus {
    outline: none;
    border-color: var(--secondary-blue);
    background-color: var(--white);
    box-shadow: 0 0 0 4px rgba(0, 123, 255, 0.15);
}

.modern-form textarea {
    resize: vertical;
    min-height: 120px;
}

/* Messaggi di conferma del modulo */
#response-message {
    margin-top: 20px;
    padding: 15px;
    border-radius: var(--radius-md);
    display: none;
    text-align: center;
    font-weight: 700;
}

.form-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.form-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* --- STILI PER MEDIA GRID (Galleria Foto e Video) --- */
.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.media-card {
    background: var(--white);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0,0,0,0.04);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.media-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-md);
}

.media-card img, 
.media-card video {
    width: 100%;
    height: 240px;
    object-fit: cover;
    display: block;
    background: #000;
}

.media-info {
    padding: 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.media-info h4 {
    color: var(--primary-blue);
    margin-bottom: 12px;
    font-size: 1.2rem;
}

.media-info p {
    font-size: 0.95rem;
    color: var(--text-body);
    margin-bottom: 0;
}