/* --- WEBLOW OS UI SYSTEM v8.0 [SPACE EDITION] --- */

:root {
    --neon: #00f3ff;
    --neon-dim: rgba(0, 243, 255, 0.1);
    /* NUOVO SFONDO: Non più nero puro, ma un blu notte molto scuro e ricco */
    --bg-dark: #080a14; 
    --glass: rgba(15, 20, 30, 0.85); /* Vetro leggermente bluato */
    --border: rgba(100, 200, 255, 0.15); /* Bordi più freddi */
    --text-main: #ffffff;
    --text-dim: #a0a5b0;
}

/* 1. SETUP ATMOSFERICO */
html, body {
    margin: 0 !important; padding: 0 !important; width: 100vw !important; height: 100vh !important;
    overflow: hidden !important;
    /* Gradiente radiale: luce soffusa dall'alto al centro, che sfuma nel blu scuro ai bordi */
    background: radial-gradient(circle at 50% 0%, #1a2340 0%, var(--bg-dark) 80%) !important;
}

/* Nascondi WP standard */
#page, #masthead, #colophon, .elementor, .site-header, .site-footer, article, .entry-content { display: none !important; }

/* Contenitore Principale */
#weblow-os-root {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: transparent; /* Lo sfondo lo fa il body ora */
    z-index: 999999; display: flex; flex-direction: column;
}

/* --- LAYER SFONDO 3D & EFFETTI --- */
#weblow-3d-scene {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    z-index: 0; 
    opacity: 1; /* Piena opacità per vedere bene le stelle */
    pointer-events: none !important; /* Fondamentale per lo scroll */
}
/* --- FIX SCROLL (Parte Mancante) --- */
#os-interface { 
    flex: 1; 
    display: flex; 
    flex-direction: column; 
    height: 100%; 
    overflow: hidden; 
    position: relative; 
    z-index: 10; 
}

/* QUESTO È IL MOTORE DELLO SCROLL */
.os-main-stage {
    flex: 1;
    overflow-y: auto !important; /* Riattiva la barra di scorrimento verticale */
    overflow-x: hidden;
    scroll-behavior: smooth;
    padding-bottom: 150px; /* Spazio per non coprire il footer col dock */
    width: 100%;
}

/* Scrollbar Personalizzata */
.os-main-stage::-webkit-scrollbar { width: 6px; }
.os-main-stage::-webkit-scrollbar-track { background: transparent; }
.os-main-stage::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }
.os-main-stage::-webkit-scrollbar-thumb:hover { background: var(--neon); }

/* Scanlines più leggere */
.scanlines {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to bottom, transparent 50%, rgba(0, 100, 255, 0.03) 50%);
    background-size: 100% 4px;
    z-index: 1; pointer-events: none; opacity: 0.5;
}

/* Vignettatura più morbida e bluastra */
.vignette {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    box-shadow: inset 0 0 200px rgba(0, 5, 20, 0.8);
    z-index: 2; pointer-events: none;
}

/* 2. HEADER & DOCK */
.hud-top {
    height: 80px; width: 100%; display: flex; justify-content: space-between; align-items: center;
    padding: 0 40px; border-bottom: 1px solid var(--border); background: rgba(5,5,5,0.95);
    flex-shrink: 0; z-index: 50; position: sticky; top: 0;
}
.hud-left, .hud-right { display: flex; align-items: center; gap: 15px; font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--neon); }
.logo-bold { font-family: 'Rajdhani', sans-serif; font-size: 22px; font-weight: 800; color: white; letter-spacing: 2px; }

/* --- 5. DOCK (BOTTOM BAR - BRIGHT & FLOATING) --- */
.dock-wrapper { 
    position: fixed; 
    bottom: 30px; 
    width: 100%; 
    display: flex; 
    justify-content: center; 
    z-index: 9999999 !important; /* Sempre sopra a tutto */
    pointer-events: none; 
}

.dock-glass {
    pointer-events: auto; 
    display: flex; 
    align-items: center; 
    gap: 15px; 
    padding: 12px 35px;
    
    /* MODIFICA LUMINOSITÀ: Sfondo più chiaro e vetroso */
    background: rgba(30, 45, 60, 0.75); 
    border: 1px solid rgba(0, 243, 255, 0.5); /* Bordo Neon ben visibile */
    border-radius: 24px;
    backdrop-filter: blur(20px); 
    
    /* ILLUMINAZIONE: Glow esterno forte */
    box-shadow: 
        0 10px 30px rgba(0,0,0,0.5), 
        0 0 25px rgba(0, 243, 255, 0.2), /* Alone blu */
        inset 0 0 15px rgba(255, 255, 255, 0.1); /* Luce interna */
    transition: 0.3s;
}

/* Hover sul Dock */
.dock-glass:hover {
    background: rgba(40, 55, 80, 0.85); /* Diventa ancora più chiaro */
    border-color: #ffffff; /* Bordo bianco */
    box-shadow: 0 0 40px rgba(0, 243, 255, 0.4); /* Esplosione di luce */
}

.dock-icon {
    width: 50px; height: 50px; 
    display: flex; align-items: center; justify-content: center;
    border-radius: 12px; 
    
    /* Icone più visibili di default */
    color: #c0e0ff; 
    background: rgba(255,255,255,0.08); 
    border: 1px solid transparent;
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    text-decoration: none; 
}

.dock-icon:hover { 
    transform: translateY(-8px) scale(1.1); 
    color: #fff; 
    background: var(--neon); /* Sfondo neon pieno al passaggio */
    color: #000; /* Icona nera su sfondo neon */
    box-shadow: 0 0 20px var(--neon);
}

.dock-icon.active { 
    background: var(--neon); /* Sfondo Neon Acceso */
    color: #000; /* Icona Nera per contrasto */
    box-shadow: 0 0 20px var(--neon); /* Bagliore */
    transform: translateY(-5px); /* Leggermente sollevata */
    border-color: #fff;
}

.dock-icon svg { width: 24px !important; height: 24px !important; }
.dock-separator { width: 1px; height: 30px; background: rgba(255,255,255,0.3); margin: 0 5px; }
/* 3. HERO SECTION */
.home-hero { padding: 100px 20px 60px; text-align: center; }
.mega-title { font-size: clamp(4rem, 10vw, 9rem); line-height: 0.85; margin-bottom: 30px; font-weight: 800; color: white; text-transform: uppercase; letter-spacing: -2px; }
.hero-tagline { font-size: 1.5rem; color: var(--text-dim); max-width: 700px; margin: 0 auto 50px; font-family: 'Rajdhani', sans-serif; }

/* 4. INFINITE MARQUEE (Full Width System Strip) */
.marquee-container {
    position: relative;
    width: 100vw; /* Larghezza totale schermo */
    left: 50%;
    right: 50%;
    margin-left: -50vw; /* Trucco per centrare full-width */
    margin-right: -50vw;
    
    background: rgba(5, 15, 25, 0.8); /* Sfondo scuro che stacca */
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    
    padding: 18px 0;
    margin-bottom: 100px;
    margin-top: 50px;
    
    overflow: hidden;
    display: flex;
    align-items: center; /* Centratura verticale perfetta */
    white-space: nowrap;
    
    /* Ombra interna per effetto profondità */
    box-shadow: inset 0 0 20px rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
}

/* Il binario che scorre */
.marquee-track {
    display: flex;
    gap: 0;
    width: max-content;
    /* Animazione fluida infinita */
    animation: scrollInfinite 40s linear infinite;
}

.marquee-item {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.1rem;
    color: var(--neon);
    text-transform: uppercase;
    letter-spacing: 3px;
    font-weight: 700;
    
    /* Spaziatura tra le parole */
    padding: 0 60px;
    
    /* Separatore visivo opzionale (slash) */
    position: relative;
}

/* Slash separatore tra le voci */
.marquee-item::after {
    content: '//';
    position: absolute;
    right: 0;
    color: #333;
    font-weight: 300;
}

@keyframes scrollInfinite {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* 5. TEXT BLOCKS (Filosofia) */
.text-section { max-width: 900px; margin: 0 auto 100px; padding: 0 30px; text-align: center; }
.big-statement { font-size: clamp(2rem, 4vw, 3.5rem); font-weight: 700; line-height: 1.2; color: white; margin-bottom: 30px; }
.big-statement span { color: var(--neon); }
.body-text { font-size: 1.1rem; color: var(--text-dim); line-height: 1.8; margin-bottom: 20px; }

/* 6. BENTO GRID */
.bento-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
    max-width: 1200px; margin: 0 auto 100px; padding: 0 20px;
}
.bento-box {
    background: rgba(20,20,20,0.6); border: 1px solid var(--border); border-radius: 20px;
    padding: 30px; position: relative; overflow: hidden; transition: 0.3s;
    display: flex; flex-direction: column; justify-content: space-between; min-height: 280px;
    text-decoration: none;
}
.bento-box:hover { border-color: var(--neon); background: rgba(20,20,20,0.9); transform: translateY(-5px); }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }

.b-icon { color: var(--neon); margin-bottom: 20px; width: 50px; height: 50px; display: flex; align-items: center; }
.b-icon svg { width: 40px !important; height: 40px !important; }
.b-title { font-size: 1.6rem; font-weight: 700; color: white; margin: 0 0 10px 0; }
.b-desc { color: var(--text-dim); font-size: 1rem; line-height: 1.5; margin: 0; }
.b-tag { 
    position: absolute; top: 20px; right: 20px; 
    font-family: 'JetBrains Mono', monospace; font-size: 10px; color: white;
    background: rgba(255,255,255,0.1); padding: 5px 10px; border-radius: 4px; 
}

/* 7. CTA TERMINAL */
.terminal-cta {
    max-width: 800px; margin: 0 auto 50px; background: black; border: 1px solid var(--neon);
    padding: 50px; font-family: 'JetBrains Mono', monospace; position: relative; text-align: left;
}
.cmd-line { color: white; margin-bottom: 15px; font-size: 1.1rem; }
.blink { animation: blink 1s infinite; }
.cta-btn-large { 
    display: block; width: 100%; text-align: center; margin-top: 30px; 
    background: var(--neon); color: black; padding: 20px 0; 
    font-weight: 800; text-decoration: none; text-transform: uppercase; letter-spacing: 2px;
    transition: 0.3s;
}
.cta-btn-large:hover { background: white; box-shadow: 0 0 40px var(--neon); }

@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
/* ============================================================ */
/* === MOBILE OPTIMIZATION SYSTEM v2.0 (FIX TESTO) === */
/* ============================================================ */

@media (max-width: 900px) {

    /* --- 1. HEADER & LINGUA --- */
    .hud-top {
        padding: 0 15px;
        justify-content: space-between;
    }
    .hud-left { display: none; }
    .hud-right { 
        display: flex !important; 
        gap: 10px;
        width: auto; /* Lascia lo spazio necessario */
    }
    .status-badge, .status-dot { display: none; }
    .hud-right > div[style*="width: 1px"] { display: none; }
    .logo-bold { font-size: 1.1rem; letter-spacing: 0.5px; }


    /* --- 2. TITOLO HERO (FIX "INFRASTRUTTURE" SPEZZATO) --- */
    .home-hero {
        padding-top: 110px; 
        padding-bottom: 30px;
        padding-left: 10px; /* Riduci padding laterale per dare più spazio al testo */
        padding-right: 10px;
    }
    
    .mega-title {
        /* CLAMP: Minimo 1.8rem, Ideale 10% larghezza schermo, Massimo 3rem */
        font-size: clamp(1.8rem, 10vw, 3rem); 
        
        line-height: 1.1;
        letter-spacing: -1px; /* Avvicina le lettere per risparmiare spazio */
        
        /* COMANDI ANTI-SPEZZATURA */
        word-break: keep-all; /* Non spezzare mai le parole */
        white-space: normal;  /* Vai a capo solo tra una parola e l'altra */
        hyphens: none;        /* Niente trattini */
    }
    
    .hero-tagline {
        font-size: 1rem;
        padding: 0 10px;
        margin-bottom: 40px;
    }


    /* --- 3. TABELLA DI CONFRONTO (FIX STACK) --- */
    .comp-grid {
        grid-template-columns: 1fr;
        margin-bottom: 50px;
        transform: none !important; /* Rimuove tilt 3D su mobile */
    }

    .col-bad {
        border-bottom: 1px solid var(--border);
        padding: 30px 20px;
    }

    .col-good {
        border-top: 1px solid var(--neon);
        padding: 30px 20px;
        background: rgba(0, 243, 255, 0.05); /* Sfondo leggero per evidenziare */
    }
    
    .comp-header { font-size: 1.3rem; margin-bottom: 20px; text-align: center; }


    /* --- 4. ALTRI AGGIUSTAMENTI MOBILE --- */
    
    /* Bento Grid */
    .bento-grid { grid-template-columns: 1fr; gap: 20px; padding: 0 20px; }
    .span-2, .span-3 { grid-column: span 1; }
    
    /* Protocollo */
    .protocol-section { padding-left: 40px; padding-right: 10px; }
    .section-title { font-size: 1.8rem; word-wrap: break-word; }
    
    /* Marquee */
    .marquee-item { font-size: 0.8rem; padding: 0 20px; }
    
    /* Footer */
    .footer-container { 
        grid-template-columns: 1fr; 
        text-align: center; 
        gap: 30px; 
    }
    .social-grid { justify-content: center; }
    
    /* Spazio per Dock */
    .os-footer { padding-bottom: 160px; }
    
    /* Dock Mobile */
    .dock-glass { padding: 8px 15px; gap: 8px; border-radius: 20px; }
    .dock-icon { width: 38px; height: 38px; }
    .dock-icon svg { width: 18px !important; height: 18px !important; }
}
/* --- AGGIUNTA 3D BACKGROUND (FIX SCROLL) --- */
#weblow-3d-scene {
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100vw; 
    height: 100vh;
    z-index: 0; /* Dietro a tutto */
    opacity: 0.5; /* Trasparenza per non disturbare la lettura */
    pointer-events: none !important; /* <--- QUESTA RIGA SALVA LO SCROLL */
}

/* Scanlines (Effetto Monitor) */
.scanlines {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,0) 50%, rgba(0,0,0,0.1) 50%, rgba(0,0,0,0.1));
    background-size: 100% 4px;
    z-index: 1; pointer-events: none; opacity: 0.4;
}

.vignette {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    box-shadow: inset 0 0 150px rgba(0,0,0,0.9);
    z-index: 2; pointer-events: none;
}
/* --- LANGUAGE SWITCHER (HEADER) --- */
.lang-switch-container {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'JetBrains Mono', monospace;
    font-weight: bold;
}

.lang-switch-btn {
    text-decoration: none;
    padding: 5px 12px;
    border: 1px solid #333;
    border-radius: 4px;
    color: #666;
    font-size: 11px;
    transition: 0.3s;
    background: rgba(0,0,0,0.5);
}

.lang-switch-btn:hover {
    color: white;
    border-color: #666;
}

.lang-switch-btn.active-lang {
    background: var(--neon-dim);
    color: var(--neon);
    border-color: var(--neon);
    box-shadow: 0 0 10px var(--neon-dim);
}
/* --- NUOVI EFFETTI "SBIZZARRITI" --- */

/* 1. SCROLL REVEAL ANIMATION */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}
.reveal-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* 2. TECH STACK (Scorrimento Loghi) */
.tech-stack-section { padding: 50px 0; border-bottom: 1px solid var(--border); background: rgba(0,0,0,0.3); }
.tech-track { display: flex; gap: 50px; justify-content: center; flex-wrap: wrap; opacity: 0.5; }
.tech-item { font-family: 'Rajdhani'; font-weight: 800; font-size: 1.5rem; color: #555; text-transform: uppercase; transition: 0.3s; cursor: default; }
.tech-item:hover { color: var(--neon); text-shadow: 0 0 10px var(--neon); transform: scale(1.1); }

/* 3. COMPARISON TABLE (Interactive Cyberpunk Version) */
.comparison-section { 
    max-width: 1000px; 
    margin: 0 auto 150px; 
    padding: 0 20px; 
}

/* FIX TITOLO SCURO */
.comparison-section .section-title {
    color: #ffffff !important; /* FORZA BIANCO */
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 50px;
    text-transform: uppercase;
}

.comp-grid { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 2px; 
    background: var(--border); 
    border: 1px solid var(--border); 
    border-radius: 16px; 
    overflow: hidden; 
    box-shadow: 0 0 50px rgba(0,0,0,0.5);
    /* Prepariamo per il 3D */
    transform-style: preserve-3d;
}

.comp-col { padding: 40px; background: rgba(10,10,10,0.95); transition: background 0.3s; }

.comp-header { font-size: 1.5rem; font-weight: 800; margin-bottom: 30px; text-transform: uppercase; letter-spacing: 1px; }

.comp-list { list-style: none; padding: 0; margin: 0; }

.comp-item { 
    padding: 18px 15px; 
    border-bottom: 1px solid rgba(255,255,255,0.05); 
    display: flex; align-items: center; gap: 15px; 
    font-size: 1rem; color: var(--text-dim); 
    transition: all 0.2s ease-out;
    border-radius: 8px; /* Arrotondamento per hover */
    margin-bottom: 2px;
}
.comp-item:last-child { border-bottom: none; }

/* --- EFFETTI INTERATTIVI --- */

/* COLONNA CATTIVA (Altre Agenzie) */
.col-bad .comp-header { color: #ff4444; }
.col-bad .icon-x { color: #ff4444; font-weight: bold; font-size: 1.2rem; transition: 0.2s; }

/* Hover sulla riga cattiva: diventa rossa e trema */
.col-bad .comp-item:hover {
    background: rgba(255, 68, 68, 0.08);
    color: #ffaaaa;
    transform: translateX(5px); /* Sposta leggermente */
}
.col-bad .comp-item:hover .icon-x {
    animation: glitch-shake 0.3s cubic-bezier(.36,.07,.19,.97) both;
}

/* COLONNA BUONA (Weblow OS) */
.col-good { background: rgba(0, 243, 255, 0.02); position: relative; }
.col-good .comp-header { color: var(--neon); text-shadow: 0 0 15px var(--neon-dim); }
.col-good .icon-check { color: var(--neon); font-weight: bold; font-size: 1.2rem; transition: 0.2s; }

/* Hover sulla riga buona: si accende di neon */
.col-good .comp-item:hover {
    background: rgba(0, 243, 255, 0.1);
    color: white;
    padding-left: 25px; /* Scatto in avanti */
    box-shadow: -3px 0 0 var(--neon); /* Barra laterale */
}
.col-good .comp-item:hover .icon-check {
    filter: drop-shadow(0 0 8px var(--neon));
    transform: scale(1.3);
}

.col-good::before { content:''; position: absolute; top:0; left:0; width:100%; height:3px; background: var(--neon); box-shadow: 0 0 25px var(--neon); }

/* ANIMAZIONE GLITCH (Tremolio) */
@keyframes glitch-shake {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-3px, 0, 0); }
  40%, 60% { transform: translate3d(3px, 0, 0); }
}

/* 4. EXECUTION PROTOCOL (Fix Allineamento e Colore) */
.protocol-section { 
    max-width: 800px; 
    margin: 0 auto 150px; 
    position: relative; 
    padding-left: 60px; /* Spazio per la linea a sinistra */
}

/* Titolo della sezione */
.protocol-section .section-title {
    text-align: left !important;
    margin-left: 0 !important; /* Rimuove lo spostamento errato */
    margin-bottom: 50px;
    color: #ffffff !important; /* FORZA BIANCO PURO */
    font-size: 2rem;
    font-weight: 800;
}

/* La Linea Verticale */
.protocol-line { 
    position: absolute; 
    left: 24px; /* Centrata perfettamente con i pallini */
    top: 80px; /* Inizia SOTTO il titolo */
    width: 2px; 
    height: calc(100% - 80px); 
    background: var(--border); 
}

/* La parte colorata che scende */
.protocol-line-progress { 
    position: absolute; 
    left: 24px; 
    top: 80px; 
    width: 2px; 
    height: 0%; 
    background: var(--neon); 
    box-shadow: 0 0 15px var(--neon); 
    transition: height 0.1s linear; 
}

/* Il Singolo Step */
.protocol-step { 
    position: relative; 
    margin-bottom: 60px; 
    opacity: 0.3; 
    transition: 0.5s; 
}
.protocol-step.active { 
    opacity: 1; 
    transform: translateX(10px); 
}

/* Il Pallino */
.step-dot { 
    position: absolute; 
    left: -41px; /* Calcolato per centrare sulla linea: 60px padding - 41px = 19px (circa centro linea) */
    top: 5px; 
    width: 12px; 
    height: 12px; 
    background: #000; 
    border: 2px solid var(--text-dim); 
    border-radius: 50%; 
    z-index: 2; 
    transition: 0.3s; 
}
.protocol-step.active .step-dot { 
    background: var(--neon); 
    border-color: var(--neon); 
    box-shadow: 0 0 15px var(--neon); 
}

.step-title { font-size: 1.4rem; color: white; margin-bottom: 10px; font-weight: 700; }
.step-desc { font-size: 1rem; color: var(--text-dim); line-height: 1.6; }

/* --- 5. FAQ SECTION (Restyling Minimal Cyber) --- */
.faq-section { max-width: 900px; margin: 0 auto 100px; padding: 0 20px; }

/* Fix Titolo Scuro */
.faq-section .section-title { 
    color: #ffffff !important; 
    text-align: center; 
    margin-bottom: 40px; 
}

.faq-item { 
    border-bottom: 1px solid var(--border); 
    margin-bottom: 0; 
    background: transparent; 
    transition: 0.3s; 
}
.faq-item:first-child { border-top: 1px solid var(--border); }

.faq-question { 
    padding: 30px 10px; 
    cursor: pointer; 
    display: flex; justify-content: space-between; align-items: center; 
    font-weight: 700; color: white; font-size: 1.1rem;
    transition: 0.3s; 
}
.faq-question:hover { color: var(--neon); padding-left: 20px; /* Scatto laterale */ }

.faq-answer { 
    max-height: 0; overflow: hidden; transition: max-height 0.4s cubic-bezier(0.33, 1, 0.68, 1); 
    padding: 0 10px; color: var(--text-dim); line-height: 1.7; 
    opacity: 0;
}

/* Stato Aperto */
.faq-item.open { background: rgba(0, 243, 255, 0.03); border-bottom: 1px solid var(--neon); }
.faq-item.open .faq-answer { padding: 0 10px 30px 10px; max-height: 500px; opacity: 1; }
.plus-icon { font-family: 'JetBrains Mono'; font-size: 1.5rem; transition: 0.3s; color: var(--text-dim); }
.faq-item.open .plus-icon { transform: rotate(45deg); color: var(--neon); }


/* --- 6. W-CORE AI TERMINAL (La Figata) --- */
.ai-section { 
    max-width: 900px; margin: 0 auto 150px; padding: 0 20px; 
}

.ai-console-wrapper {
    background: #000;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 0 50px rgba(0,0,0,0.8);
    transition: 0.3s;
}
.ai-console-wrapper:focus-within {
    border-color: var(--neon);
    box-shadow: 0 0 30px var(--neon-dim);
}

/* Header del Terminale */
.console-header {
    background: rgba(20,20,20,0.9);
    padding: 10px 20px;
    border-bottom: 1px solid var(--border);
    display: flex; justify-content: space-between; align-items: center;
    font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--text-dim);
}
.status-indicator { display: flex; align-items: center; gap: 6px; color: var(--neon); }
.status-dot-blink { width: 6px; height: 6px; background: var(--neon); border-radius: 50%; animation: blink 2s infinite; }

/* Area Messaggi */
.console-screen {
    height: 350px;
    overflow-y: auto;
    padding: 20px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.95rem;
    display: flex; flex-direction: column; gap: 15px;
    scroll-behavior: smooth;
}
/* Scrollbar custom per la chat */
.console-screen::-webkit-scrollbar { width: 4px; }
.console-screen::-webkit-scrollbar-thumb { background: #333; }

/* Bolle Messaggi */
.msg-row { display: flex; width: 100%; }
.msg-row.user { justify-content: flex-end; }
.msg-row.ai { justify-content: flex-start; }

.msg-bubble {
    padding: 12px 18px;
    border-radius: 8px;
    max-width: 80%;
    line-height: 1.5;
}
.msg-bubble.user {
    background: rgba(255,255,255,0.1);
    color: white;
    border: 1px solid rgba(255,255,255,0.2);
    border-bottom-right-radius: 0;
}
.msg-bubble.ai {
    background: rgba(0, 243, 255, 0.05);
    color: var(--neon);
    border: 1px solid var(--neon-dim);
    border-bottom-left-radius: 0;
}

/* Input Area */
.console-input-area {
    display: flex;
    border-top: 1px solid var(--border);
    padding: 0;
    background: #050505;
}
.input-prompt { padding: 15px 0 15px 20px; color: var(--neon); font-family: 'JetBrains Mono'; font-weight: bold; }
#ai-user-input {
    flex: 1;
    background: transparent;
    border: none;
    color: white;
    padding: 15px;
    font-family: 'JetBrains Mono';
    font-size: 1rem;
    outline: none;
}
.send-btn {
    background: transparent;
    border: none;
    border-left: 1px solid var(--border);
    color: var(--neon);
    padding: 0 25px;
    cursor: pointer;
    font-family: 'Rajdhani'; font-weight: bold; font-size: 1.1rem;
    transition: 0.2s;
}
.send-btn:hover { background: var(--neon); color: black; }

/* --- FOOTER MODULE (FIX SCROLL) --- */
.os-footer {
    width: 100%;
    background: rgba(5, 7, 12, 0.98); /* Sfondo scuro solido */
    border-top: 1px solid var(--border);
    
    /* QUI LA MAGIA: Il padding sotto è enorme (160px) per ospitare il Dock */
    /* Ma essendo padding, fa parte del footer, quindi è colorato di scuro */
    padding: 80px 0 160px 0; 
    
    margin-top: 100px;
    font-family: 'JetBrains Mono', monospace;
    position: relative;
    z-index: 10;
}

.footer-container {
    max-width: 1200px; margin: 0 auto; padding: 0 20px;
    display: grid; grid-template-columns: 1.5fr 1fr 1.5fr 1fr; 
    gap: 40px;
}

/* Icone SVG Footer */
.f-icon { 
    display: inline-flex; 
    align-items: center; 
    justify-content: center;
    color: var(--neon); 
    margin-right: 10px; 
    vertical-align: middle;
}
.f-icon svg { width: 18px; height: 18px; }

/* Resto dello stile footer uguale a prima... */
.footer-logo { font-size: 1.5rem; margin-bottom: 20px; }
.footer-desc { color: var(--text-dim); font-size: 0.9rem; line-height: 1.6; margin-bottom: 20px; }
.footer-heading { color: white; font-size: 1rem; margin-bottom: 25px; text-transform: uppercase; letter-spacing: 1px; font-family: 'Rajdhani', sans-serif; font-weight: 700; }
.footer-links, .footer-contact-list { list-style: none; padding: 0; margin: 0; }
.footer-links li, .footer-contact-list li { margin-bottom: 12px; }
.footer-links a, .footer-contact-list a { color: var(--text-dim); text-decoration: none; font-size: 0.9rem; transition: 0.3s; display: inline-block; }
.footer-links a:hover, .footer-contact-list a:hover { color: var(--neon); transform: translateX(5px); }

/* Social */
.social-grid { display: flex; gap: 15px; }
.social-btn { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: 8px; color: var(--text-dim); transition: 0.3s; background: rgba(255,255,255,0.02); }
.social-btn svg { width: 20px; height: 20px; }
.social-btn:hover { border-color: var(--neon); color: var(--neon); background: rgba(0, 243, 255, 0.1); box-shadow: 0 0 15px var(--neon-dim); transform: translateY(-3px); }

.footer-bottom-bar { text-align: center; margin-top: 60px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,0.05); color: #444; font-size: 0.8rem; }
/* ============================================================ */
/* === MOBILE OPTIMIZATION SYSTEM v2.0 (FIX TESTO) === */
/* ============================================================ */

@media (max-width: 900px) {

    /* --- 1. HEADER & LINGUA --- */
    .hud-top {
        padding: 0 15px;
        justify-content: space-between;
    }
    .hud-left { display: none; }
    .hud-right { 
        display: flex !important; 
        gap: 10px;
        width: auto; /* Lascia lo spazio necessario */
    }
    .status-badge, .status-dot { display: none; }
    .hud-right > div[style*="width: 1px"] { display: none; }
    .logo-bold { font-size: 1.1rem; letter-spacing: 0.5px; }


    /* --- 2. TITOLO HERO (FIX "INFRASTRUTTURE" SPEZZATO) --- */
    .home-hero {
        padding-top: 110px; 
        padding-bottom: 30px;
        padding-left: 10px; /* Riduci padding laterale per dare più spazio al testo */
        padding-right: 10px;
    }
    
    .mega-title {
        /* CLAMP: Minimo 1.8rem, Ideale 10% larghezza schermo, Massimo 3rem */
        font-size: clamp(1.8rem, 10vw, 3rem); 
        
        line-height: 1.1;
        letter-spacing: -1px; /* Avvicina le lettere per risparmiare spazio */
        
        /* COMANDI ANTI-SPEZZATURA */
        word-break: keep-all; /* Non spezzare mai le parole */
        white-space: normal;  /* Vai a capo solo tra una parola e l'altra */
        hyphens: none;        /* Niente trattini */
    }
    
    .hero-tagline {
        font-size: 1rem;
        padding: 0 10px;
        margin-bottom: 40px;
    }


    /* --- 3. TABELLA DI CONFRONTO (FIX STACK) --- */
    .comp-grid {
        grid-template-columns: 1fr;
        margin-bottom: 50px;
        transform: none !important; /* Rimuove tilt 3D su mobile */
    }

    .col-bad {
        border-bottom: 1px solid var(--border);
        padding: 30px 20px;
    }

    .col-good {
        border-top: 1px solid var(--neon);
        padding: 30px 20px;
        background: rgba(0, 243, 255, 0.05); /* Sfondo leggero per evidenziare */
    }
    
    .comp-header { font-size: 1.3rem; margin-bottom: 20px; text-align: center; }


    /* --- 4. ALTRI AGGIUSTAMENTI MOBILE --- */
    
    /* Bento Grid */
    .bento-grid { grid-template-columns: 1fr; gap: 20px; padding: 0 20px; }
    .span-2, .span-3 { grid-column: span 1; }
    
    /* Protocollo */
    .protocol-section { padding-left: 40px; padding-right: 10px; }
    .section-title { font-size: 1.8rem; word-wrap: break-word; }
    
    /* Marquee */
    .marquee-item { font-size: 0.8rem; padding: 0 20px; }
    
    /* Footer */
    .footer-container { 
        grid-template-columns: 1fr; 
        text-align: center; 
        gap: 30px; 
    }
    .social-grid { justify-content: center; }
    
    /* Spazio per Dock */
    .os-footer { padding-bottom: 160px; }
    
    /* Dock Mobile */
    .dock-glass { padding: 8px 15px; gap: 8px; border-radius: 20px; }
    .dock-icon { width: 38px; height: 38px; }
    .dock-icon svg { width: 18px !important; height: 18px !important; }
}
/* --- OS MODAL SYSTEM (Finestre Legali) --- */

/* 1. Sfondo Oscurante */
.os-modal-overlay {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0, 5, 10, 0.85); /* Molto scuro */
    backdrop-filter: blur(8px);
    z-index: 99999999; /* Sopra anche al dock */
    display: none; /* Nascosto di default */
    align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.3s ease;
}

/* Quando è attiva */
.os-modal-overlay.active { display: flex; opacity: 1; }

/* 2. La Finestra */
.os-window {
    width: 90%; max-width: 800px; height: 80vh;
    background: #080a0f;
    border: 1px solid var(--neon);
    box-shadow: 0 0 50px rgba(0, 243, 255, 0.15);
    border-radius: 8px;
    display: flex; flex-direction: column;
    transform: scale(0.95); transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.os-modal-overlay.active .os-window { transform: scale(1); }

/* 3. Header Finestra (Barra Titolo) */
.os-window-header {
    height: 50px;
    background: rgba(20, 30, 40, 0.95);
    border-bottom: 1px solid var(--border);
    display: flex; justify-content: space-between; align-items: center;
    padding: 0 20px;
    flex-shrink: 0;
}

.win-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem; color: var(--neon);
    text-transform: uppercase;
}
.win-title span { color: white; font-weight: bold; }

.win-close-btn {
    background: transparent; border: none;
    color: var(--text-dim); font-size: 1.2rem; cursor: pointer;
    transition: 0.2s;
}
.win-close-btn:hover { color: #ff4444; transform: scale(1.1); }

/* 4. Contenuto Finestra (Scrollabile) */
.os-window-content {
    flex: 1;
    overflow-y: auto;
    padding: 40px;
    font-family: 'Inter', sans-serif; /* Più leggibile per testi lunghi */
    color: #ccc;
    line-height: 1.7;
}

/* Scrollbar interna */
.os-window-content::-webkit-scrollbar { width: 6px; }
.os-window-content::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }
.os-window-content::-webkit-scrollbar-thumb:hover { background: var(--neon); }

/* Blocchi di testo */
.legal-text-block { display: none; } /* Nascosti tutti di base */
.legal-text-block.active { display: block; animation: fadeIn 0.4s; }

/* Fix Colore Titoli Legali */
.legal-text-block h2 { 
    color: var(--neon); /* Titolo principale neon */
    font-size: 1.5rem;
    border-bottom: 1px solid var(--border); 
    padding-bottom: 15px; 
    margin-bottom: 30px; 
}

/* QUESTO È IL CODICE CHE RISOLVE IL PROBLEMA */
.legal-text-block h3 {
    color: #ffffff; /* Bianco puro */
    font-size: 1.2rem;
    font-weight: 700;
    margin-top: 30px;
    margin-bottom: 15px;
}

.legal-text-block strong { color: var(--neon); } /* Grassetto neon */

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* --- FOOTER BOTTOM BAR (COPYRIGHT) --- */
.footer-bottom-bar {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 60px;
    padding-top: 30px;
    padding-bottom: 20px; /* Spazio extra */
    
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    
    color: #555;
    font-size: 0.75rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.copyright-text strong { color: white; }

.powered-by {
    font-size: 0.7rem;
    opacity: 0.7;
}

/* ============================================================ */
/* === MOBILE OPTIMIZATION SYSTEM v2.0 (FIX TESTO) === */
/* ============================================================ */

@media (max-width: 900px) {

    /* --- 1. HEADER & LINGUA --- */
    .hud-top {
        padding: 0 15px;
        justify-content: space-between;
    }
    .hud-left { display: none; }
    .hud-right { 
        display: flex !important; 
        gap: 10px;
        width: auto; /* Lascia lo spazio necessario */
    }
    .status-badge, .status-dot { display: none; }
    .hud-right > div[style*="width: 1px"] { display: none; }
    .logo-bold { font-size: 1.1rem; letter-spacing: 0.5px; }


    /* --- 2. TITOLO HERO (FIX "INFRASTRUTTURE" SPEZZATO) --- */
    .home-hero {
        padding-top: 110px; 
        padding-bottom: 30px;
        padding-left: 10px; /* Riduci padding laterale per dare più spazio al testo */
        padding-right: 10px;
    }
    
    .mega-title {
        /* CLAMP: Minimo 1.8rem, Ideale 10% larghezza schermo, Massimo 3rem */
        font-size: clamp(1.8rem, 10vw, 3rem); 
        
        line-height: 1.1;
        letter-spacing: -1px; /* Avvicina le lettere per risparmiare spazio */
        
        /* COMANDI ANTI-SPEZZATURA */
        word-break: keep-all; /* Non spezzare mai le parole */
        white-space: normal;  /* Vai a capo solo tra una parola e l'altra */
        hyphens: none;        /* Niente trattini */
    }
    
    .hero-tagline {
        font-size: 1rem;
        padding: 0 10px;
        margin-bottom: 40px;
    }


    /* --- 3. TABELLA DI CONFRONTO (FIX STACK) --- */
    .comp-grid {
        grid-template-columns: 1fr;
        margin-bottom: 50px;
        transform: none !important; /* Rimuove tilt 3D su mobile */
    }

    .col-bad {
        border-bottom: 1px solid var(--border);
        padding: 30px 20px;
    }

    .col-good {
        border-top: 1px solid var(--neon);
        padding: 30px 20px;
        background: rgba(0, 243, 255, 0.05); /* Sfondo leggero per evidenziare */
    }
    
    .comp-header { font-size: 1.3rem; margin-bottom: 20px; text-align: center; }


    /* --- 4. ALTRI AGGIUSTAMENTI MOBILE --- */
    
    /* Bento Grid */
    .bento-grid { grid-template-columns: 1fr; gap: 20px; padding: 0 20px; }
    .span-2, .span-3 { grid-column: span 1; }
    
    /* Protocollo */
    .protocol-section { padding-left: 40px; padding-right: 10px; }
    .section-title { font-size: 1.8rem; word-wrap: break-word; }
    
    /* Marquee */
    .marquee-item { font-size: 0.8rem; padding: 0 20px; }
    
    /* Footer */
    .footer-container { 
        grid-template-columns: 1fr; 
        text-align: center; 
        gap: 30px; 
    }
    .social-grid { justify-content: center; }
    
    /* Spazio per Dock */
    .os-footer { padding-bottom: 160px; }
    
    /* Dock Mobile */
    .dock-glass { padding: 8px 15px; gap: 8px; border-radius: 20px; }
    .dock-icon { width: 38px; height: 38px; }
    .dock-icon svg { width: 18px !important; height: 18px !important; }
}
/* --- FIX CHAT BUTTON: DA "PALLINO" A "ETICHETTA PARLANTE" --- */
    .chat-trigger-btn {
        /* 1. Posizionamento (Sopra il Dock) */
        bottom: 120px !important; 
        right: 20px !important;
        
        /* 2. Trasformazione Forma (Pillola allungata) */
        width: auto !important; /* Larghezza automatica in base al testo */
        height: 48px !important;
        border-radius: 30px !important; /* Bordi molto rotondi */
        padding: 0 20px !important; /* Spazio ai lati */
        
        /* 3. Layout Interno */
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 12px !important; /* Spazio tra icona e testo */
        
        /* 4. Stile Visivo */
        background: var(--neon) !important; /* Colore acceso */
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6) !important; /* Ombra forte per staccare dallo sfondo */
        border: 2px solid white !important; /* Bordo bianco per visibilità massima */
        
        /* Animazione ingresso */
        animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) 1s backwards;
    }

    /* Icona (Il robot/fumetto) */
    .chat-trigger-btn svg {
        width: 20px !important;
        height: 20px !important;
        fill: black !important; /* Icona nera per contrasto */
        color: black !important;
    }

    /* 5. IL TRUCCO: TESTO AGGIUNTO VIA CSS */
    .chat-trigger-btn::after {
        content: "AI ASSIST"; /* <--- CAMBIA QUESTO TESTO SE VUOI (Es. "SUPPORTO") */
        font-family: 'Rajdhani', sans-serif;
        font-weight: 800;
        font-size: 0.9rem;
        color: black; /* Testo nero su sfondo neon */
        letter-spacing: 1px;
        text-transform: uppercase;
    }

    /* Quando la chat è aperta, nascondiamo l'etichetta per pulizia (opzionale) o la spostiamo */
    .erp-chat-widget.active ~ .chat-trigger-btn {
        display: none !important; /* Nasconde il bottone se la chat è aperta */
    }
    
/* ============================================================ */
/* === WEBLOW PRIVACY SHIELD (PRO VERSION) === */
/* ============================================================ */

/* --- 1. BANNER PRINCIPALE (Basso, Largo) --- */
.cookie-hud-panel {
    position: fixed;
    bottom: -300px;
    left: 20px; right: 20px;
    margin: 0 auto;
    max-width: 900px; /* Molto più largo */
    
    background: #050505 !important;
    border: 1px solid #333 !important;
    border-top: 2px solid #00f3ff !important; /* Linea Neon sopra */
    box-shadow: 0 -10px 40px rgba(0,0,0,0.8) !important;
    border-radius: 8px 8px 0 0; /* Arrotondato solo sopra */
    
    padding: 25px;
    display: flex;
    flex-direction: row; /* Layout orizzontale */
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    
    z-index: 2147483647 !important;
    transition: bottom 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.cookie-hud-panel.visible { bottom: 0 !important; }

.chk-head { display: flex; align-items: center; gap: 15px; flex: 1; }
.chk-ico { font-size: 2rem; }
.chk-title h4 { margin: 0; color: #fff; font-family: 'Rajdhani'; font-size: 1.2rem; letter-spacing: 1px; }
.chk-title p { margin: 5px 0 0 0; color: #aaa; font-size: 0.9rem; line-height: 1.3; }

.chk-actions { display: flex; align-items: center; gap: 15px; flex-shrink: 0; }
.chk-group { display: flex; gap: 10px; }

/* Bottoni */
.btn-cookie { padding: 12px 20px; border-radius: 4px; font-weight: bold; font-size: 0.8rem; cursor: pointer; border: none; font-family: 'Inter'; text-transform: uppercase; transition: 0.2s; }
.btn-cookie.prim { background: #00f3ff; color: #000; box-shadow: 0 0 15px rgba(0,243,255,0.3); }
.btn-cookie.prim:hover { transform: scale(1.05); }
.btn-cookie.sec { background: transparent; border: 1px solid #444; color: #fff; }
.btn-cookie.sec:hover { border-color: #fff; }
.btn-cookie.ghost { background: transparent; color: #00f3ff; text-decoration: underline; padding: 0; margin-right: 10px; }

/* --- 2. MODALE PREFERENZE (Centro Schermo) --- */
.cookie-modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.85); backdrop-filter: blur(5px);
    z-index: 2147483648; /* Sopra al banner */
    display: none; align-items: center; justify-content: center;
}
.cookie-modal-overlay.active { display: flex; animation: fadeIn 0.3s; }

.cookie-modal-box {
    width: 600px; max-width: 90%;
    background: #0a0a0a; border: 1px solid #333;
    border-radius: 12px; overflow: hidden;
    box-shadow: 0 0 50px rgba(0, 243, 255, 0.15);
}

.mod-header {
    background: #111; padding: 20px; border-bottom: 1px solid #333;
    display: flex; justify-content: space-between; align-items: center;
}
.mod-header h3 { margin: 0; color: #00f3ff; font-family: 'Rajdhani'; }
.close-btn { background: none; border: none; color: #fff; font-size: 1.5rem; cursor: pointer; }

.mod-body { padding: 20px; max-height: 60vh; overflow-y: auto; }
.mod-desc { color: #888; font-size: 0.9rem; margin-bottom: 20px; }

.pref-row {
    display: flex; justify-content: space-between; align-items: center;
    background: #111; padding: 15px; border-radius: 8px; border: 1px solid #222;
    margin-bottom: 10px;
}
.pref-info strong { display: block; color: #fff; margin-bottom: 4px; }
.pref-info span { display: block; color: #666; font-size: 0.8rem; }

/* SWITCHES (LEVETTE) */
.switch { position: relative; display: inline-block; width: 50px; height: 26px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #333; transition: .4s; border-radius: 34px; }
.slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 4px; bottom: 4px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: #00f3ff; }
input:checked + .slider:before { transform: translateX(24px); }

.pref-toggle.locked { color: #00ff88; font-weight: bold; font-size: 0.9rem; }

.mod-footer { padding: 20px; border-top: 1px solid #333; text-align: right; background: #0a0a0a; }
.btn-cookie.full { width: 100%; text-align: center; }

/* --- 3. PALLINO MINIMIZZATO --- */
.cookie-minimized {
    position: fixed; bottom: 30px; left: 30px; /* Sinistra per non disturbare la chat */
    width: 45px; height: 45px;
    background: #000; border: 1px solid #333; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; cursor: pointer; z-index: 99990;
    opacity: 0; transform: scale(0); transition: 0.3s;
    box-shadow: 0 0 20px rgba(0,243,255,0.1);
}
.cookie-minimized.visible { opacity: 1; transform: scale(1); }
.cookie-minimized:hover { border-color: #00f3ff; transform: scale(1.1); }

/* MOBILE */
@media (max-width: 768px) {
    .cookie-hud-panel { 
        flex-direction: column; align-items: flex-start; 
        padding: 20px; border-radius: 0;
    }
    .chk-actions { width: 100%; flex-direction: column; gap: 15px; margin-top: 15px; }
    .chk-group { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
    .btn-cookie { width: 100%; text-align: center; padding: 15px; }
    .btn-cookie.ghost { margin: 0; order: 2; font-size: 0.8rem; }
}