:root {
    --bg-dark: #050505;
    --text-white: #ffffff;
    --text-gray: #d1d1d1;
    --primary-glow: #00c455; 
    --secondary-glow: #00ffd5; 
}

/* 1. RESET & STRUTTURA */
html, body {
    margin: 0 !important; padding: 0 !important; width: 100% !important; height: 100% !important;
    background-color: var(--bg-dark) !important; overflow: hidden !important; 
    font-family: 'Plus Jakarta Sans', sans-serif; 
}

.aff-page-container { 
    position: fixed !important; top: 0; left: 0; 
    width: 100vw; height: 100vh; background: var(--bg-dark);
    z-index: 999999; overflow-y: auto; display: block;
    scroll-behavior: smooth;
}

.aff-scroll-content { position: relative; width: 100%; display: flex; flex-direction: column; align-items: center; z-index: 10; }
.aff-page-container * { box-sizing: border-box; }

/* =========================================
   2. BACKGROUND E OVERLAY (Variante A)
   ========================================= */
.aff-hero-bg {
    position: absolute; top: 0; left: 0; width: 100%; height: 85vh;
    background-image: var(--aff-hero-bg, url('https://www.affittala.com/wp-content/uploads/2026/07/FOTO-PRINCIPALE-SITO-AFFITTALA-scaled-1.webp')); 
    background-size: cover; 
    background-position: center; 
    background-repeat: no-repeat;
    z-index: 0;
}

.aff-hero-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    /* Schiarito in alto (da 0.6 a 0.3) per far vedere la foto, 
       ma mantenuto scuro in basso per sfumare col nero del sito */
    background: linear-gradient(180deg, rgba(5,5,5,0.3) 0%, rgba(5,5,5,0.7) 70%, var(--bg-dark) 100%);
}

/* =========================================
   2.1 SFONDI DEDICATI (Sezione Caratteristiche)
   ========================================= */
.aff-features-bg {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-size: cover; background-position: center;
    z-index: 0; opacity: 0; transition: opacity 0.8s ease-in-out;
}
.aff-features-bg.active { opacity: 1; }

.aff-features-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    /* Gradient magico: sfuma nel nero del sito sopra e sotto, restando trasparente in mezzo! */
    background: linear-gradient(180deg, var(--bg-dark) 0%, rgba(15,15,15,0.75) 15%, rgba(15,15,15,0.75) 85%, var(--bg-dark) 100%);
    z-index: 1; pointer-events: none;
}

/* Pannello di vetro dietro ai testi per massima leggibilità */
.aff-glass-panel {
    background: rgba(20, 20, 20, 0.6);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 24px; padding: 40px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

/* =========================================
   2.5 BARRA DEI NUMERI (Social Proof)
   ========================================= */
.aff-stats-bar {
    position: relative; z-index: 10; width: 100%; max-width: 1000px; 
    margin: -30px auto 60px auto; padding: 0 20px;
}
.aff-stats-container {
    display: flex; justify-content: space-between; align-items: center;
    background: rgba(20,20,20,0.6); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.1); border-top: 1px solid var(--primary-glow);
    border-radius: 20px; padding: 30px 40px; box-shadow: 0 20px 50px rgba(0,0,0,0.6);
}
.aff-stat-item { text-align: center; width: 25%; }
.aff-stat-num { display: block; font-size: 2.8rem; font-weight: 800; color: #fff; line-height: 1; margin-bottom: 5px; }
.aff-stat-num span { color: var(--primary-glow); } /* Colora solo simboli come + o € */
.aff-stat-label { font-size: 0.85rem; color: #aaa; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; }

@media (max-width: 768px) {
    .aff-hero-bg { height: 75vh; }
    .aff-stats-container { flex-wrap: wrap; gap: 20px; padding: 25px 20px; }
    .aff-stat-item { width: 45%; }
    .aff-stat-num { font-size: 2rem; }
    .aff-glass-panel { padding: 25px; } /* Più stretto su mobile */
}

/* =========================================
   3. NAVBAR "FLOATING PILL" & HERO
   ========================================= */
.aff-navbar {
    width: 92% !important; max-width: 1100px !important; 
    padding: 12px 25px !important;
    margin: 25px auto 0 auto !important; /* La stacca dal tetto dello schermo */
    display: flex; justify-content: space-between; align-items: center;
    background: rgba(20, 20, 20, 0.6) !important; /* Vetro scuro leggero */
    backdrop-filter: blur(25px); -webkit-backdrop-filter: blur(25px);
    position: sticky; top: 20px; z-index: 1000;
    border: 1px solid rgba(255,255,255,0.08) !important; /* Bordino luce */
    border-radius: 50px !important; /* Arrotonda i lati (Pillola) */
    box-shadow: 0 15px 35px rgba(0,0,0,0.4) !important;
    transition: all 0.4s ease;
}
/* Stile del Logo Immagine */
.aff-logo-link { display: flex; align-items: center; }
.aff-logo-img { 
    height: 32px; /* Altezza perfetta ed elegante */
    width: auto; 
    display: block;
    transition: transform 0.3s;
}
.aff-logo-img:hover { transform: scale(1.05); }

.aff-nav-links { display: flex; gap: 20px; align-items: center; }

/* Adattamento per i Telefoni (Piccola pillola compatta) */
@media (max-width: 768px) {
    .aff-navbar { 
        width: 95% !important; padding: 10px 18px !important; 
        margin: 15px auto 0 auto !important; top: 15px; 
    }
    .aff-logo-img { height: 24px; } /* Rimpicciolisce il logo su mobile */
}

.aff-btn-outline { padding: 10px 20px; border: 2px solid rgba(255,255,255,0.2); border-radius: 50px; }
.aff-btn-outline:hover { border-color: var(--primary-glow); }
.aff-btn-fill { padding: 12px 25px; background: var(--text-white); color: #000 !important; border-radius: 50px; font-weight: 700; box-shadow: 0 4px 15px rgba(255,255,255,0.2); }
.aff-btn-fill:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(255,255,255,0.4); }

.aff-hero { width: 100%; padding: 80px 20px 40px 20px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.aff-content { max-width: 800px; position: relative; z-index: 2; }

/* Testo Gradient */
.text-gradient {
    background: linear-gradient(90deg, var(--primary-glow), var(--secondary-glow));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.aff-hero h1 { 
    font-size: 4rem; font-weight: 800; line-height: 1.1; margin: 30px 0 20px 0; color: var(--text-white); letter-spacing: -2px; 
}

.aff-hero p { 
    font-size: 1.3rem; color: var(--text-gray); line-height: 1.6; margin-bottom: 40px; font-weight: 500; 
    
}

/* =========================================
   4. SWITCHER (Cerco / Offro) - PREMIUM 3D
   ========================================= */
.aff-switch {
    display: inline-flex; 
    background: rgba(10, 10, 10, 0.7); /* Sfondo del binario più scuro */
    backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px);
    padding: 6px; 
    border-radius: 50px;
    position: relative; 
    border: 1px solid rgba(255,255,255,0.05); 
    box-shadow: inset 0 5px 15px rgba(0,0,0,0.6); /* Ombra interna profonda (Effetto scavato) */
    margin-bottom: 40px; /* Più respiro sotto */
}

.aff-switch-btn {
    width: 170px; /* Non toccare, serve al JS per scivolare della misura esatta */
    padding: 16px 0; 
    font-size: 1.1rem; 
    font-weight: 700; 
    color: #666; /* Grigio spento e misterioso quando non attivo */
    background: transparent;
    border: none; 
    border-radius: 50px; 
    cursor: pointer; 
    position: relative; 
    z-index: 2; 
    transition: color 0.4s ease;
}

/* Stile Testo e Icona quando Attivo */
.aff-switch-btn.active { 
    color: #fff; /* Testo bianco brillante sul colore acceso */
    text-shadow: 0 2px 5px rgba(0,0,0,0.4); /* Ombra per staccare le lettere dal colore di fondo */
}
.aff-switch-btn svg {
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.aff-switch-btn.active svg {
    transform: scale(1.25) translateY(-1px); /* L'icona fa un "pop" e si ingrandisce */
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

/* La Pillola Colorata Scorrevole */
.aff-switch-bg {
    position: absolute; 
    top: 6px; 
    left: 6px; 
    width: 170px; 
    height: calc(100% - 12px);
    /* MAGIA: Usa i colori dinamici che il JS cambia al click! */
    background: linear-gradient(135deg, var(--primary-glow), var(--secondary-glow)); 
    border-radius: 50px; 
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1); /* Effetto "Molla" fluido */
    z-index: 1;
    /* Effetto 3D Pazzesco: luce in alto, ombra in basso */
    box-shadow: 
        inset 0 2px 4px rgba(255,255,255,0.4), 
        0 8px 15px rgba(0,0,0,0.4);
}

/* =========================================
   5. SEZIONE: IL MATCH IN 3 PASSI (Premium Design con Sfondo)
   ========================================= */
.aff-how-section {
    width: 100%; padding: 120px 20px 80px 20px;
    display: flex; flex-direction: column; align-items: center;
    position: relative;
    overflow: hidden; /* Contiene la luce */
}

/* 1. Il Pattern a Griglia (Effetto Radar/Architettura) */
.aff-how-section::before {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-image: 
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    /* Sfuma la griglia in alto e in basso per farla fondere col sito */
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 20%, black 80%, transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0%, black 20%, black 80%, transparent 100%);
    z-index: 0;
}

/* 2. L'Aura Luminosa (Cambia colore in automatico con lo switcher!) */
.aff-how-section::after {
    content: ''; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 70%; height: 60%;
    background: var(--primary-glow);
    opacity: 0.08; /* Luce soffusa ed elegante */
    filter: blur(120px);
    z-index: 0;
    pointer-events: none;
}

/* Assicuriamoci che i titoli e le card stiano SOPRA lo sfondo */
.aff-how-title { 
    position: relative; z-index: 2;
    font-size: 3rem; font-weight: 800; margin-bottom: 70px; text-align: center;
    background: linear-gradient(90deg, var(--primary-glow), var(--secondary-glow));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
    filter: drop-shadow(0 0 15px rgba(0, 196, 85, 0.3));
    letter-spacing: -1.5px;
}

.aff-3steps-grid {
    position: relative; z-index: 2;
    width: 100%; max-width: 1200px; /* Centra perfettamente le card */
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 35px; 
    counter-reset: step-counter; 
}

/* La Carta Premium */
.aff-step-card {
    background: linear-gradient(145deg, rgba(30, 30, 30, 0.6) 0%, rgba(15, 15, 15, 0.8) 100%);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 30px; 
    padding: 50px 40px; 
    text-align: left; /* Look editoriale */
    position: relative; 
    transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    display: flex; flex-direction: column; align-items: flex-start;
    overflow: hidden; /* Nasconde le sbavature del numero gigante */
    z-index: 1;
}

/* Il Numero Gigante nello Sfondo (Watermark) */
.aff-step-card::before {
    counter-increment: step-counter;
    content: "0" counter(step-counter);
    position: absolute;
    top: -15px;
    right: -10px;
    font-size: 160px;
    font-weight: 900;
    color: rgba(255,255,255,0.02);
    z-index: -1;
    line-height: 1;
    transition: all 0.5s ease;
    letter-spacing: -5px;
}

/* Effetto Hover della Carta */
.aff-step-card:hover {
    transform: translateY(-15px);
    background: linear-gradient(145deg, rgba(40, 40, 40, 0.8) 0%, rgba(20, 20, 20, 0.95) 100%);
    border-color: rgba(255,255,255,0.15);
    box-shadow: 0 30px 60px rgba(0,0,0,0.6), 0 0 40px rgba(0, 196, 85, 0.1);
}

.aff-step-card:hover::before {
    color: rgba(255,255,255,0.06); /* Il numero gigante si accende */
    transform: scale(1.05) translate(-10px, 10px);
}

/* Contenitore Icona (Design a Gioiello) */
.step-icon-wrap {
    width: 70px; height: 70px; border-radius: 22px;
    background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.02));
    display: flex; justify-content: center; align-items: center;
    margin-bottom: 30px; 
    color: var(--primary-glow); /* Prende in automatico il verde o viola dello switcher */
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 10px 20px rgba(0,0,0,0.3), inset 0 0 15px rgba(255,255,255,0.05);
    transition: all 0.4s ease;
    position: relative;
}

/* Aura luminosa dietro l'icona (FIX QUADRATO SU SMARTPHONE) */
.step-icon-wrap::after {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    border-radius: 50%; /* Arrotondato per evitare angoli spezzati */
    background: var(--primary-glow);
    filter: blur(20px); opacity: 0.25; z-index: -1;
    transition: opacity 0.4s ease;
    /* Forza l'accelerazione hardware (GPU) su iPhone/Android */
    -webkit-transform: translate3d(0,0,0);
    transform: translate3d(0,0,0);
}

.aff-step-card:hover .step-icon-wrap {
    transform: scale(1.1) rotate(5deg);
    border-color: var(--primary-glow);
    box-shadow: 0 15px 30px rgba(0,0,0,0.4), inset 0 0 20px rgba(255,255,255,0.1);
}

.aff-step-card:hover .step-icon-wrap::after {
    opacity: 0.5; /* L'aura si intensifica al passaggio del mouse */
}

/* Testi della Carta */
.aff-step-card h3 { 
    font-size: 1.8rem; font-weight: 800; color: #fff; margin-bottom: 15px; 
    letter-spacing: -0.5px; position: relative; z-index: 2; 
}
.aff-step-card p { 
    font-size: 1.05rem; color: #aaa; line-height: 1.7; margin: 0; 
    position: relative; z-index: 2; font-weight: 500;
}

/* Adattamento Mobile */
@media (max-width: 900px) {
    .aff-3steps-grid { grid-template-columns: 1fr; gap: 30px; }
    .aff-step-card { padding: 40px 30px; align-items: center; text-align: center; }
    .aff-step-card::before { font-size: 120px; right: 0; opacity: 0.5; } 
}

/* =========================================
   6. MODALITA' MOBILE
   ========================================= */
@media (max-width: 768px) {
    .aff-hero h1 { font-size: 2.8rem; }
    .aff-hero p { font-size: 1.1rem; }
    .aff-navbar { padding: 15px 20px; }
}

/* =========================================
   7. NUOVE SEZIONI LUNGHE E ANIMAZIONI
   ========================================= */
/* Animazione allo scroll */
.aff-reveal {
    opacity: 0;
    transform: translateY(60px);
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}
.aff-reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Espandiamo la sezione a tutto schermo (Full-Screen) */
.aff-features-section { 
    width: 100%; 
    padding: 120px 20px; 
    /* Rimosso il max-width e il margin: 0 auto; */
}

/* Manteniamo solo il contenuto ordinato al centro */
.aff-features-container { 
    width: 100%; 
    max-width: 1200px; 
    margin: 0 auto; 
    display: flex; align-items: center; gap: 60px; 
}

.aff-feature-text { flex: 1; }
.aff-feature-image { flex: 1; display: flex; justify-content: center; }

.aff-feature-list { list-style: none; padding: 0; margin: 0; }
.aff-feature-list li { 
    display: flex; align-items: flex-start; gap: 20px; 
    margin-bottom: 30px; font-size: 1.05rem; color: #ddd; line-height: 1.6; 
    transition: transform 0.3s ease;
}
.aff-feature-list li:hover { transform: translateX(5px); } /* Slide morbido al passaggio del mouse */

/* Icone Lussuose e Dinamiche */
.feat-icon { 
    font-size: 1.5rem; 
    background: linear-gradient(135deg, rgba(255,255,255,0.05), rgba(255,255,255,0.01)); 
    padding: 12px; 
    border-radius: 14px; 
    border: 1px solid rgba(255,255,255,0.1); 
    color: var(--primary-glow); /* Si accende in verde o viola in base allo switcher! */
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
    display: flex; align-items: center; justify-content: center;
    transition: all 0.4s;
}

/* L'icona brilla quando ci passi sopra col mouse */
.aff-feature-list li:hover .feat-icon {
    border-color: var(--primary-glow);
    background: rgba(255,255,255,0.08);
    box-shadow: 0 10px 25px rgba(0,0,0,0.5), inset 0 0 15px rgba(255,255,255,0.05);
}

/* Manda a capo i testi per fare dei veri Titoli Professionali */
.aff-feature-list li strong { 
    color: #fff; 
    font-weight: 800; 
    font-size: 1.15rem; 
    display: block; 
    margin-bottom: 5px;
}

/* =========================================
   LA FOTO GIGANTE (Human Touch)
   ========================================= */
.aff-human-photo-card {
    background: transparent; border: none; padding: 0; 
    width: 100%; max-width: 420px;
    position: relative;
    display: flex; justify-content: center; align-items: center;
}

.aff-human-img {
    width: 100%; height: auto;
    aspect-ratio: 4/5; /* Mantiene proporzioni ritratto */
    object-fit: cover; border-radius: 24px;
    box-shadow: 0 30px 60px rgba(0,0,0,0.6);
    border: 1px solid rgba(255,255,255,0.08); 
    position: relative; z-index: 2;
    transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.aff-human-photo-card:hover .aff-human-img {
    transform: scale(1.02) translateY(-10px);
}

/* L'aura luminosa alle spalle della foto */
.aff-photo-glow {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 85%; height: 85%;
    background: var(--primary-glow); /* Colore dinamico */
    filter: blur(80px); opacity: 0.15;
    z-index: 1; transition: all 0.5s ease; pointer-events: none;
}

.aff-human-photo-card:hover .aff-photo-glow {
    opacity: 0.25; filter: blur(100px);
}

/* =========================================
   16. SEZIONE CTA FINALE PREMIUM (STILE)
   ========================================= */
.aff-bottom-cta-section {
    width: 100%;
    /* Il contenitore base non ha limiti stretti per far vedere lo sfondo a tutto schermo */
}

/* --- Luce Dinamica Sfondo Finale (Anti-Banding) --- */
.aff-bottom-glow {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 100%; height: 100%;
    background: var(--primary-glow); 
    /* Sfocatura ridotta da 180 a 120 per evitare il color banding sul nero */
    filter: blur(120px); 
    opacity: 0.2; 
    z-index: 1; pointer-events: none;
    transition: background 0.5s ease;
    animation: aff-bottom-pulse 6s infinite ease-in-out;
    /* Aggiunta di un supporto per hardware acceleration */
    transform: translateZ(0); 
    will-change: transform, opacity;
}

@keyframes aff-bottom-pulse {
    0%, 100% { opacity: 0.15; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 0.25; transform: translate(-50%, -50%) scale(1.1); }
}

/* La Glass Card centrale */
.aff-bottom-glass-card {
    background: rgba(15, 15, 15, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 32px;
    padding: 60px 40px;
    box-shadow: 0 30px 60px rgba(0,0,0,0.7);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    position: relative; z-index: 2;
    transition: transform 0.3s ease, border-color 0.3s ease;
}
.aff-bottom-glass-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-glow);
}

.aff-bottom-title {
    font-size: 3rem; font-weight: 850; margin-bottom: 25px; color: #fff; line-height: 1.2;
    filter: drop-shadow(0 5px 15px rgba(0,0,0,0.5));
}

.aff-bottom-desc {
    font-size: 1.25rem; color: #ccc; line-height: 1.7; max-width: 650px; margin: 0 auto;
}

/* Bottone massiccio per la finish line */
.aff-btn-massive {
    font-size: 1.3rem !important;
    padding: 22px 45px !important;
    border-radius: 50px !important;
}

.aff-btn-massive { font-size: 1.1rem !important; padding: 18px 30px !important; }

@media (max-width: 768px) {
    .aff-features-container { flex-direction: column; gap: 40px; }
    .aff-human-photo-card { max-width: 100%; margin-top: 20px; }
    
    .aff-bottom-cta-section { padding: 80px 15px; }
    .aff-bottom-glass-card { padding: 40px 20px; border-radius: 24px; }
    .aff-bottom-title { font-size: 2.2rem; }
    .aff-bottom-desc { font-size: 1.1rem; }
    .aff-btn-massive { font-size: 1.1rem !important; padding: 18px 30px !important; }
    
    /* FIX STRIATURE SU TELEFONO: Riduciamo la sfocatura per gli schermi piccoli */
    .aff-bottom-glow {
        filter: blur(60px);
        opacity: 0.1;
    }
}

/* =========================================
   8. FIX CONFLITTI TEMA & HOVER BOTTONI
   ========================================= */
/* Forza la visibilità di tutti i titoli e sottotitoli contro il tema WP */
.aff-page-container h1, 
.aff-page-container h2, 
.aff-page-container h3, 
.aff-page-container h4 {
    color: #ffffff !important;
    position: relative;
    z-index: 2;
}
.aff-page-container p {
    color: #d1d1d1 !important;
}

/* Fix Bottone CTA: Stile Premium e Hover */
.aff-main-cta {
    display: inline-flex !important; 
    align-items: center; 
    justify-content: center; 
    gap: 10px;
    padding: 18px 45px; 
    font-size: 1.25rem; 
    font-weight: 800;
    color: #000 !important; /* Testo nero per massimo contrasto col neon */
    background: var(--primary-glow) !important; /* Prende in automatico il verde o viola! */
    text-decoration: none; 
    border-radius: 50px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
    box-shadow: 0 10px 30px rgba(0,0,0,0.5), 0 0 20px var(--primary-glow) !important; 
    border: none !important;
    margin-top: 15px; /* Lo distanzia un po' dal testo */
    z-index: 10;
    position: relative;
}
.aff-main-cta:hover {
    transform: translateY(-5px);
    background: var(--secondary-glow) !important; 
    color: #000 !important; 
    box-shadow: 0 15px 40px var(--secondary-glow) !important;
}

/* Allineamento perfetto per le nuove icone SVG nello switcher */
.aff-switch-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.aff-switch-btn svg {
    margin-bottom: 2px;
}

/* =========================================
   9. ESPANSIONE LARGHEZZA SCHERMO
   ========================================= */
/* Allarghiamo la navbar e le sezioni per sfruttare i monitor grandi */
.aff-navbar, 
.aff-how-section {
    max-width: 1500px !important; /* Da 1200px a 1500px */
    width: 96% !important; /* Prende quasi tutto lo schermo */
}

/* =========================================
   10. STILE MODALE LOGIN (Vetro e Neon)
   ========================================= */
.aff-modal-overlay {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.85); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    display: none; align-items: center; justify-content: center;
    z-index: 9999999 !important; padding: 20px;
}

.aff-modal-box {
    background: rgba(15, 15, 15, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-top: 2px solid var(--primary-glow); /* Righina neon in cima */
    border-radius: 24px; padding: 40px; 
    width: 100%; max-width: 420px;
    position: relative; 
    box-shadow: 0 30px 60px rgba(0,0,0,0.7);
    color: #fff;
    animation: modalPopUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modalPopUp {
    0% { transform: scale(0.9) translateY(20px); opacity: 0; }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

/* Bottone X di chiusura: Area di click ingrandita e centrata */
.aff-modal-close {
    position: absolute; top: 15px; right: 15px; 
    background: transparent; border: none; color: #888;
    cursor: pointer; transition: 0.3s;
    width: 45px; height: 45px; /* Area bella grande per i polpastrelli */
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
}
.aff-modal-close:hover { 
    color: #ff4d4d; 
    background: rgba(255,77,77,0.1); 
    transform: rotate(90deg); 
}

/* Input del Login */
.aff-modal-box .aff-input-group { margin-bottom: 20px; }

.aff-modal-box input {
    width: 100%; 
    padding: 15px 20px; 
    border-radius: 12px;
    background: rgba(0,0,0,0.5); 
    border: 1px solid rgba(255,255,255,0.1);
    color: #ffffff !important; /* FORZA IL BIANCO E BLOCCA IL TEMA */
    font-size: 1rem; 
    outline: none; 
    transition: 0.3s;
}

/* Colore del testo finto di suggerimento (es. tu@email.com) */
.aff-modal-box input::placeholder {
    color: #888888 !important; 
    opacity: 1;
}

.aff-modal-box input:focus { 
    border-color: var(--primary-glow); 
    background: rgba(0,0,0,0.8); 
}

/* Bottone Accedi: Hover corretto senza sfondi invisibili */
.aff-btn-submit {
    width: 100%; padding: 16px; margin-top: 10px;
    background: var(--primary-glow) !important; color: #fff !important;
    border: 2px solid transparent !important; border-radius: 50px; 
    font-weight: 800; font-size: 1.1rem;
    cursor: pointer; transition: all 0.3s ease; 
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    display: flex; align-items: center; justify-content: center; gap: 8px; /* Per l'SVG */
}
.aff-btn-submit:hover { 
    background: var(--secondary-glow) !important; /* Si accende del colore secondario */
    color: #000 !important; /* Testo nero a contrasto */
    transform: translateY(-3px); 
    box-shadow: 0 15px 35px var(--secondary-glow) !important;
}

/* =========================================
   11. SEZIONE COMBINATA: TELEGRAM + STATS E ANIMAZIONE RADAR
   ========================================= */

/* 1. IL NUOVO CONTAINER UNIFICATO A TUTTO SCHERMO */
.aff-dark-combined-background {
    width: 100%; 
    max-width: 100%; 
    margin: 0 auto;
    padding: 0; 
    position: relative;
    /* Lasciamo lo sfondo trasparente per fargli prendere il nero nativo del sito! */
    background-color: transparent;
    z-index: 1;
}

/* LA MAGIA: Inseriamo l'immagine qui dietro, con i bordi che sfumano a trasparenza */
.aff-dark-combined-background::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: var(--aff-telegram-bg, url('https://www.affittala.com/wp-content/uploads/2026/07/foto-sfondo-telegram-back-scaled-1.webp'));
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    
    z-index: -1;
    
    /* 🚀 REGOLA LA LUMINOSITA' QUI: 0.35 significa che è opaca al 35%. Alzalo o abbassalo a piacimento */
    opacity: 0.35; 
    
    /* 🚀 VIA LE LINEE NETTE: Questo cancella letteralmente i bordi in alto e in basso fonodendola col sito */
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 15%, black 85%, transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0%, black 15%, black 85%, transparent 100%);
}

/* 2. SEZIONE TELEGRAM: Allargata ma contenuta nei margini */
.aff-telegram-section {
    width: 100%; max-width: 100%;
    padding: 80px 20px 40px; 
    margin: 0 auto;
}

/* 3. CARD DI VETRO TELEGRAM: Centrata e trasparente */
.aff-telegram-glass {
    max-width: 1200px; 
    margin: 0 auto; 
    
    display: flex; align-items: center; justify-content: space-between; gap: 50px;
    
    /* VETRO PULITO: Completamente trasparente per far vedere la foto dietro */
    background-image: none;
    background-color: transparent;
    
    backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(0, 136, 204, 0.3); border-radius: 24px;
    padding: 50px; box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    position: relative; overflow: hidden;
}

/* Luce azzurra d'accento dietro al vetro (opzionale) */
.aff-telegram-glass::before {
    content: ''; position: absolute; top: -50px; left: -50px; width: 200px; height: 200px;
    background: #0088cc; filter: blur(100px); opacity: 0.3; z-index: 0; pointer-events: none;
}

.aff-tg-text { flex: 1.5; position: relative; z-index: 2; }
.aff-tg-visual { flex: 1; display: flex; justify-content: center; align-items: center; position: relative; z-index: 2; }

.aff-tg-list { list-style: none; padding: 0; margin: 0; }
.aff-tg-list li { 
    display: flex; align-items: flex-start; /* Allinea l'icona all'inizio del testo */
    gap: 12px; margin-bottom: 15px; font-size: 1.05rem; color: #ddd; font-weight: 500; 
    text-align: left; 
}
/* Impedisce all'icona di schiacciarsi e la centra con la prima riga */
.aff-tg-list li svg { flex-shrink: 0; margin-top: 3px; }

/* 4. SEZIONE STATS (COUNTER) */
.aff-counters-section {
    width: 100%; max-width: 100%;
    padding: 40px 20px 80px; 
    margin: 0 auto;
}

/* La griglia che fa da "vetro" anche per i counter */
.aff-counters-grid {
    max-width: 1200px; 
    margin: 0 auto; 
    display: flex; align-items: center; justify-content: space-around; gap: 30px;
    
    background-color: transparent; 
    backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.15); border-radius: 24px;
    padding: 40px; box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

.aff-counter-item { text-align: center; }
.aff-counter-num { display: block; font-size: 4rem; font-weight: 800; color: #fff; line-height: 1; }
.aff-counter-text { color: rgba(255,255,255,0.8); font-size: 1.1rem; font-weight: 500; margin-top: 10px; }
.aff-stat-percent { color: #0088cc; } 
.aff-stat-symbol { font-size: 2.5rem; vertical-align: super; font-weight: 700; color: #0088cc; }

/* ========================================= */
/* --- ICONA E ANIMAZIONE RADAR --- */
/* ========================================= */
.tg-icon-wrapper {
    background: #0088cc; width: 90px; height: 90px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 0 30px rgba(0, 136, 204, 0.8); z-index: 5;
    position: relative;
}
.tg-icon-wrapper svg { margin-right: 4px; margin-top: 2px; }

.tg-radar-box { position: relative; width: 160px; height: 160px; display: flex; align-items: center; justify-content: center; }

.tg-radar-circle {
    position: absolute; top: 50%; left: 50%; 
    transform: translate(-50%, -50%) scale(1); 
    width: 90px; height: 90px; border-radius: 50%;
    border: 2px solid #0088cc; opacity: 0;
    will-change: transform, opacity; 
}

.wave-1 { animation: radarScan 3s infinite ease-out; }
.wave-2 { animation: radarScan 3s infinite ease-out 1.5s; }

@keyframes radarScan {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 0.8; }
    100% { transform: translate(-50%, -50%) scale(3.5); opacity: 0; }
}

/* =========================================
   12. ANIMAZIONI DI ENTRATA ALLO SCROLL (MOBILE & DESKTOP)
   ========================================= */
/* Prepariamo le card ad essere invisibili e abbassate */
.aff-glass-card, .aff-human-photo-card, .aff-telegram-glass {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease-out, transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Quando lo JS aggiunge la classe 'active' scivolano su morbidamente */
.aff-glass-card.active, .aff-human-photo-card.active, .aff-telegram-glass.active {
    opacity: 1;
    transform: translateY(0);
}

/* Hover per PC */
@media (min-width: 769px) {
    .aff-glass-card.active:hover {
        transform: translateY(-10px);
        box-shadow: 0 20px 50px rgba(0,0,0,0.5); 
        border-color: rgba(255,255,255,0.1); 
        border-top-color: var(--secondary-glow);
    }
}

@media (max-width: 768px) {
    .aff-telegram-glass { flex-direction: column; padding: 30px 25px; text-align: left; gap: 30px; }
    .aff-tg-list li { justify-content: flex-start; }
    .aff-telegram-glass::before { display: none; }
}

/* =========================================
   13. SEZIONE CONTATORI (FOMO ANIMATO)
   ========================================= */
.aff-counters-section {
    width: 100%; max-width: 1100px; padding: 20px; margin: 20px auto 60px auto;
}

.aff-counters-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px;
    background: rgba(20,20,20,0.5); border: 1px solid rgba(255,255,255,0.05);
    border-radius: 24px; padding: 40px; box-shadow: 0 15px 35px rgba(0,0,0,0.3);
    text-align: center; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}

.aff-counter-item { 
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; 
}

.aff-counter-num {
    font-size: 3.5rem; /* Leggermente più piccolo */
    font-weight: 600; /* Più sottile ed elegante, meno massiccio */
    color: var(--primary-glow);
    line-height: 1; 
    text-shadow: 0 0 10px rgba(0,0,0,0.5); /* Ombra scura per staccare dal fondo, niente bagliori esagerati */
    display: flex; align-items: center; justify-content: center;
    transition: color 0.4s;
    letter-spacing: -1px; /* Stringe i numeri per un look tech */
}

.aff-counter-text { 
    font-size: 1.1rem; color: #aaa; font-weight: 600; 
}

/* Modalità Mobile */
@media (max-width: 768px) {
    .aff-counters-section { margin: 10px auto 40px auto; }
    .aff-counters-grid { grid-template-columns: 1fr; padding: 40px 20px; gap: 40px; }
    .aff-counter-num { font-size: 3rem; }
}

/* =========================================
   13.5 SEZIONE REFERRAL (PORTA UN AMICO)
   ========================================= */
.aff-referral-section {
    width: 100%; max-width: 1100px; margin: 0 auto 80px auto; padding: 0 20px;
}
.aff-referral-glass {
    background: linear-gradient(135deg, rgba(20, 20, 20, 0.6), rgba(10, 10, 10, 0.8));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-left: 5px solid var(--primary-glow); /* Linea colorata laterale dinamica */
    border-radius: 24px; padding: 40px;
    backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    transition: transform 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}
.aff-referral-glass:hover {
    transform: translateY(-8px);
    border-left-color: var(--secondary-glow);
    box-shadow: 0 30px 50px rgba(0,0,0,0.6);
}
.aff-ref-content {
    display: flex; align-items: center; gap: 35px;
}
.aff-ref-icon {
    background: rgba(255,255,255,0.03); padding: 25px; border-radius: 50%;
    color: var(--primary-glow); /* Icona dinamica */
    border: 1px solid rgba(255,255,255,0.05);
    box-shadow: inset 0 0 20px rgba(255,255,255,0.02);
    display: flex; align-items: center; justify-content: center;
}
.aff-ref-text h3 {
    font-size: 2.2rem; color: #fff; margin: 0 0 12px 0; font-weight: 800; letter-spacing: -0.5px;
}
.aff-ref-text p {
    font-size: 1.15rem; color: #aaa; margin: 0; line-height: 1.6; font-weight: 500;
}
@media (max-width: 768px) {
    .aff-ref-content { flex-direction: column; text-align: center; gap: 20px; }
    .aff-referral-glass { padding: 30px 20px; border-left: none; border-top: 5px solid var(--primary-glow); }
    .aff-ref-text h3 { font-size: 1.8rem; }
    .aff-referral-section { margin-bottom: 50px; }
}

/* =========================================
   14. SEZIONE RECENSIONI (STILE CHAT PREMIUM)
   ========================================= */
.aff-reviews-section {
    width: 100%; 
    /* Max-width e margin sono stati spostati nel contenitore interno in HTML per far sfumare lo sfondo a tutto schermo */
}

.aff-reviews-title {
    text-align: center; font-size: 2.8rem; font-weight: 800; margin-bottom: 50px; color: #fff;
    filter: drop-shadow(0 5px 15px rgba(0,0,0,0.5));
}

.aff-chat-container {
    display: flex; flex-direction: column; gap: 25px;
}

/* Stile Base Fumetto Premium */
.aff-chat-bubble {
    background: rgba(15, 15, 15, 0.75); /* Più scuro e contrastato */
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 25px; max-width: 85%; color: #e0e0e0;
    box-shadow: 0 15px 40px rgba(0,0,0,0.6);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    position: relative; /* Per posizionare il tick */
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s;
}
.aff-chat-bubble:hover { 
    transform: translateY(-8px) scale(1.02); 
    box-shadow: 0 25px 50px rgba(0,0,0,0.8);
}

/* Fumetto a Sinistra (Utente 1) */
.aff-chat-bubble.left {
    align-self: flex-start;
    border-radius: 24px 24px 24px 4px;
    border-left: 4px solid var(--primary-glow);
}

/* Fumetto a Destra (Utente 2) */
.aff-chat-bubble.right {
    align-self: flex-end;
    border-radius: 24px 24px 4px 24px;
    background: rgba(20, 20, 20, 0.85);
    border-right: 4px solid var(--secondary-glow);
}

/* Testi interni */
.chat-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 12px; border-bottom: 1px solid rgba(255,255,255,0.05); padding-bottom: 10px;
}
.chat-header strong {
    color: #fff; font-weight: 700; font-size: 1.05rem; letter-spacing: 0.5px;
}
.chat-time {
    font-size: 0.8rem; color: #777; font-weight: 600;
}
.chat-body { 
    font-size: 1.1rem; line-height: 1.6; color: #ddd; font-weight: 500;
}

/* Il Tick di lettura (Doppia spunta) */
.chat-tick {
    position: absolute; bottom: 15px; right: 20px;
    color: var(--primary-glow); /* Si accende in base allo switcher */
    opacity: 0.8;
}
.chat-tick.right-tick {
    right: auto; left: 20px;
    color: var(--secondary-glow);
}

/* 🚀 ANIMAZIONE DI ENTRATA A CASCATA (Pop-up) */
.aff-chat-anim {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1); /* Effetto rimbalzo fluido */
}

/* Quando la sezione è inquadrata, il JS aggiunge "active" ai fumetti */
.aff-reviews-section.active .aff-chat-anim {
    opacity: 1;
    transform: translateY(0) scale(1);
}

@media (max-width: 768px) {
    .aff-reviews-section { padding: 60px 15px; }
    .aff-chat-bubble { max-width: 95%; padding: 20px; }
    .chat-body { font-size: 1rem; }
    .aff-reviews-title { font-size: 2.2rem; }
}

/* =========================================
   15. SEZIONE FAQ (ACCORDION)
   ========================================= */
.aff-faq-section {
    /* Il contenitore base non ha più limiti stretti, l'HTML gestisce il full-width e gli spazi per far vedere lo sfondo */
    width: 100%;
}

/* --- NUOVO: Luce Dinamica Sfondo --- */
.aff-faq-glow {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 80%; height: 80%;
    background: var(--primary-glow); /* Diventa verde o viola in automatico */
    filter: blur(150px); opacity: 0.12;
    z-index: 1; pointer-events: none;
    transition: background 0.5s ease;
}

.aff-faq-title {
    text-align: center; font-size: 2.2rem; font-weight: 800; margin-bottom: 40px; color: #fff;
    position: relative; z-index: 2; /* Sopra la luce */
}

.aff-faq-container {
    display: flex; flex-direction: column; gap: 15px;
    position: relative; z-index: 2; /* Sopra la luce */
}

.aff-faq-item {
    background: rgba(30, 30, 30, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    overflow: hidden;
    transition: background 0.3s, border-color 0.3s;
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.aff-faq-item:hover {
    background: rgba(30, 30, 30, 0.7);
    border-color: rgba(255, 255, 255, 0.15);
}

.aff-faq-question {
    width: 100%; text-align: left; padding: 25px;
    background: transparent; border: none; color: #fff;
    font-size: 1.15rem; font-weight: 700; cursor: pointer;
    display: flex; justify-content: space-between; align-items: center;
    font-family: inherit; transition: color 0.3s;
}

.aff-faq-question:hover { color: var(--primary-glow); }

.faq-icon {
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    min-width: 24px; color: var(--primary-glow);
}

.aff-faq-answer {
    max-height: 0; 
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Lo spazio lo diamo al div interno, non al testo! */
.aff-faq-inner {
    padding: 0 25px 25px 25px;
}

.aff-faq-answer p {
    padding: 0; margin: 0;
    color: #bbb !important; font-size: 1.05rem; line-height: 1.6;
    transition: color 0.4s ease, text-shadow 0.4s ease; /* Transizione fluida per l'accensione */
}

/* Stato Attivo (Aperto) */
.aff-faq-item.active {
    background: rgba(20, 20, 20, 0.8);
    border-color: var(--primary-glow);
}
.aff-faq-item.active .faq-icon {
    transform: rotate(180deg);
}

/* --- NUOVO: Forza il colore del testo della domanda ad abbinarsi al bordo --- */
.aff-faq-item.active .aff-faq-question,
.aff-faq-item.active .aff-faq-question span {
    color: var(--primary-glow) !important;
}

@media (max-width: 768px) {
    .aff-faq-question { font-size: 1.05rem; padding: 20px; }
    .aff-faq-inner { padding: 0 20px 20px 20px; }
    .aff-faq-answer p { font-size: 0.95rem; }
}


/* =========================================
   16. FOOTER PREMIUM CORPORATE
   ========================================= */
.aff-footer {
    width: 100%;
    background: linear-gradient(180deg, rgba(10,10,10,0.6) 0%, rgba(5,5,5,1) 100%);
    border-top: 1px solid rgba(255,255,255,0.05);
    padding: 80px 20px 30px 20px;
    margin-top: 60px;
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}

.aff-footer-container {
    max-width: 1200px; margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr; /* Proporzioni delle 4 colonne */
    gap: 40px;
}

/* Colonna Brand */
.aff-footer-logo {
    height: 35px; margin-bottom: 20px;
    filter: grayscale(100%) brightness(150%);
    transition: filter 0.4s ease, transform 0.4s ease;
}
.aff-footer-logo:hover {
    filter: grayscale(0%) brightness(100%);
    transform: scale(1.05);
}
.brand-col p { color: #888 !important; font-size: 0.95rem; line-height: 1.6; margin-bottom: 15px; }

.aff-contact-item {
    display: flex; align-items: flex-start; gap: 10px;
    color: #aaa; font-size: 0.9rem; line-height: 1.5;
}
.aff-contact-item svg { flex-shrink: 0; margin-top: 3px; }

/* Titoli Colonne */
.aff-footer-col h4 {
    color: #fff !important; font-size: 1.1rem; margin-bottom: 25px; font-weight: 800;
}

/* Liste Link (Incolonnate perfettamente) */
.aff-footer-link-group {
    display: flex; flex-direction: column; gap: 12px;
}

.aff-footer-link-group a {
    color: #888; text-decoration: none; font-size: 0.95rem; font-weight: 500;
    transition: color 0.3s, transform 0.3s;
    display: inline-flex; align-items: center; gap: 8px;
    width: fit-content; /* L'effetto hover non prende tutta la riga */
}
.aff-footer-link-group a:hover {
    color: var(--primary-glow);
    transform: translateX(6px);
}

/* Link Highlight (La Mail) */
.aff-highlight-link { color: #ddd !important; }
.aff-highlight-link svg { color: var(--primary-glow); }

/* Icone Social */
.aff-social-icons { display: flex; gap: 12px; margin-bottom: 30px; }
.aff-social-icons a {
    display: flex; align-items: center; justify-content: center;
    width: 42px; height: 42px; border-radius: 50%;
    background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.05);
    color: #fff; transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.aff-social-icons a:hover {
    background: var(--primary-glow); color: #000;
    transform: translateY(-5px); border-color: var(--primary-glow);
    box-shadow: 0 10px 20px rgba(0, 196, 85, 0.4);
}

/* Badge di Sicurezza */
.aff-trust-badge {
    background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px; padding: 15px;
}
.trust-title {
    display: flex; align-items: center; gap: 6px;
    color: #fff; font-size: 0.8rem; font-weight: 700; text-transform: uppercase; margin-bottom: 10px;
}
.trust-icons {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}

/* Base Footer */
.aff-footer-bottom {
    max-width: 1200px; margin: 60px auto 0 auto; padding-top: 25px;
    border-top: 1px solid rgba(255,255,255,0.05); text-align: center;
}
.aff-footer-bottom p {
    color: #555 !important; font-size: 0.85rem; margin: 0; font-weight: 500;
}

/* Adattamento per i Telefoni */
@media (max-width: 900px) {
    .aff-footer-container { grid-template-columns: 1fr 1fr; } /* A metà schermo fa 2 colonne */
}
@media (max-width: 600px) {
    .aff-footer { padding: 60px 20px 20px 20px; }
    .aff-footer-container { grid-template-columns: 1fr; gap: 40px; } /* Su cell tutto in fila */
}

/* =========================================
   17. MODALE TESTI LEGALI E SCROLLBAR
   ========================================= */
.aff-legal-overlay {
    z-index: 9999999 !important;
}

.aff-legal-box {
    max-width: 850px; /* Più largo del Login per leggere bene i testi lunghi */
    width: 95%;
    padding: 40px 30px;
}

/* Area che scorre internamente */
.aff-legal-content-scroll {
    max-height: 70vh; /* Occupa massimo il 70% dello schermo in altezza */
    overflow-y: auto;
    padding-right: 15px; /* Spazio per non far accavallare il testo alla barra */
}

/* Personalizzazione Barra di scorrimento (Scrollbar) */
.aff-legal-content-scroll::-webkit-scrollbar { 
    width: 6px; 
}
.aff-legal-content-scroll::-webkit-scrollbar-track { 
    background: rgba(255,255,255,0.05); 
    border-radius: 10px; 
}
.aff-legal-content-scroll::-webkit-scrollbar-thumb { 
    background: var(--primary-glow); /* La barra si illumina di verde o viola! */
    border-radius: 10px; 
}

/* Stile dei testi legali */
.legal-text-content h2 {
    font-size: 2rem; color: #fff; margin-top: 0; margin-bottom: 25px; text-align: left;
}
.legal-body {
    color: #ccc; font-size: 1rem; line-height: 1.7; text-align: left;
}
.legal-body h3, .legal-body strong {
    color: #fff; margin-top: 25px; margin-bottom: 10px; display: block;
}
.legal-body p { margin-bottom: 15px; }

/* Adattamento Mobile */
@media (max-width: 768px) {
    .aff-legal-box { padding: 30px 20px; }
    .legal-text-content h2 { font-size: 1.6rem; }
    .legal-body { font-size: 0.95rem; }
    .aff-legal-content-scroll { max-height: 75vh; }
}

/* =========================================
   COOKIE BANNER GDPR
   ========================================= */
.aff-cookie-banner {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 900px;
    background: rgba(17, 17, 17, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.8);
    z-index: 9999999; /* Sopra a tutto */
    padding: 20px;
    display: flex;
    align-items: center;
}

.aff-cookie-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 20px;
}

.aff-cookie-text {
    flex: 1;
}

.aff-cookie-buttons {
    display: flex;
    align-items: center; /* Centra i bottoni verticalmente */
    gap: 12px;
    flex-shrink: 0;
}

/* Regola universale per i bottoni del banner per non farli schiacciare */
.aff-cookie-buttons button {
    white-space: nowrap; /* Impedisce al testo di andare a capo! */
    height: 42px; /* Altezza uguale per entrambi */
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0; /* Rimuove margini indesiderati */
}

.aff-btn-outline {
    background: transparent;
    color: #ccc;
    border: 1px solid rgba(255,255,255,0.2);
    padding: 0 20px;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
}

.aff-btn-outline:hover {
    border-color: #fff;
    color: #fff;
}

/* Versione Mobile */
@media (max-width: 768px) {
    .aff-cookie-banner {
        bottom: 10px;
        width: 95%;
        padding: 15px;
    }
    .aff-cookie-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    .aff-cookie-buttons {
        width: 100%;
        flex-direction: column;
    }
    .aff-cookie-buttons button {
        width: 100%;
    }
}