@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;600;800&display=swap');

/* Definizione dei Temi */
[data-theme="dark"] {
    --bg-deep: #060b13;
    --bg-card: #0f172a;
    --text-primary: #f8fafc;
    --text-dim: #94a3b8;
}

[data-theme="light"] {
    --bg-deep: #f1f5f9;
    --bg-card: #ffffff;
    --text-primary: #0f172a;
    --text-dim: #475569;
}

/* Applica le variabili */
body {
    background-color: var(--bg-deep);
    color: var(--text-primary);
    transition: background 0.3s, color 0.3s;
}

.card {
    background-color: var(--bg-card);
    color: var(--text-primary);
}


/* modifica colori sito */
:root {
    --bg-deep: #060b13; --bg-card: #0f172a; --accent: #ff6b00;
    --accent-glow: rgba(255, 107, 0, 0.3); --text-primary: #f8fafc;
    --text-dim: #94a3b8; --white: #ffffff;
}

* { margin: 0; padding: 10; box-sizing: border-box; }
body { font-family: 'Plus Jakarta Sans', sans-serif; background-color: var(--bg-deep); color: var(--text-primary); line-height: 1.6; transition: background 0.3s; }

/* Navigazione */
header { background: rgba(6, 11, 19, 0.9); backdrop-filter: blur(12px); padding: 2px 8%; display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; z-index: 1000; border-bottom: 1px solid rgba(255,255,255,0.05); }
.logo { img { width: 100px; height: auto; }font-size: 24px; font-weight: 800; background: linear-gradient(90deg, #fff, var(--accent)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; text-decoration: none; }
nav ul { display: flex; gap: 25px; list-style: none; }
nav a { color: var(--text-primary); text-decoration: none; font-weight: 600; font-size: 14px; transition: 0.3s; }
nav a:hover { color: var(--accent); }

/* Hero  per modificare altezza testo cambbia voce 3vm da 1 a 10*/
.hero { padding: 60px 8% 60px; text-align: left; background: radial-gradient(circle at top right, #1e293b, var(--bg-deep)); }
.hero h1 { font-size: clamp(2.5rem, 3vw, 4rem); line-height: 1.1; margin-bottom: 25px; font-weight: 800; }
.hero h1 span { color: var(--accent); }

/* Griglia e Card */
.content-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; padding: 60px 8%; max-width: 1400px; margin: auto; }
.card { background: var(--bg-card); padding: 20px; border-radius: 24px; border: 1px solid rgba(255,255,255,0.05); transition: 0.4s; position: relative; overflow: hidden; }
.card:hover { transform: translateY(-10px); border-color: var(--accent); box-shadow: 0 20px 40px rgba(0,0,0,0.5); }
.card h3 { margin-bottom: 15px; color: var(--white); }

/* Bottoni */
.btn-primary { background: var(--accent); color: white; padding: 16px 35px; border-radius: 12px; font-weight: bold; text-decoration: none; display: inline-block; box-shadow: 0 4px 15px var(--accent-glow); transition: 0.3s; }
.btn-primary:hover { transform: scale(1.05); box-shadow: 0 8px 25px var(--accent-glow); }

/* Footer */
footer { background: #020617; color: var(--text-dim); padding: 80px 8% 40px; border-top: 1px solid rgba(255,255,255,0.05); }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 50px; max-width: 1200px; margin: 0 auto 50px; }
.footer-h4 { color: white; margin-bottom: 25px; font-size: 15px; text-transform: uppercase; letter-spacing: 1.5px; border-left: 3px solid var(--accent); padding-left: 10px; }
.footer-section p { font-size: 13px; margin-bottom: 10px; line-height: 1.7; }
.footer-section a { color: var(--accent); text-decoration: none; }
.footer-bottom { text-align: center; padding-top: 30px; border-top: 1px solid rgba(255,255,255,0.05); font-size: 12px; }

/* Accessibilità */
.acc-menu { position: fixed; bottom: 30px; left: 30px; z-index: 1001; }
.acc-toggle { background: var(--accent); color: white; border: none; width: 55px; height: 55px; border-radius: 50%; cursor: pointer; font-size: 24px; box-shadow: 0 5px 15px rgba(0,0,0,0.3); }
.acc-panel { display: none; position: absolute; bottom: 70px; left: 0; width: 280px; background: var(--bg-card); padding: 20px; border-radius: 16px; border: 1px solid var(--accent); flex-direction: column; gap: 10px; }
.acc-btn { padding: 12px; border: 1px solid #334155; border-radius: 8px; background: #1e293b; color: white; cursor: pointer; font-weight: 600; font-size: 13px; text-align: left; }
#reading-guide { position: fixed; left: 0; width: 100%; height: 10px; background: var(--accent); opacity: 0.3; pointer-events: none; z-index: 9999; display: none; }

/* Progress Bar in alto */
#scroll-progress {
    position: fixed; top: 0; left: 0; width: 0%; height: 4px;
    background: var(--accent); z-index: 2000; transition: width 0.1s;
}

/* Pulsante Back to Top */
#back-to-top {
    position: fixed; bottom: 30px; right: 30px;
    width: 50px; height: 50px;
    background: var(--bg-card); color: var(--accent);
    border: 1px solid var(--accent); border-radius: 12px;
    cursor: pointer; display: none; /* Appare via JS */
    z-index: 1000; transition: 0.3s;
}
#back-to-top:hover { background: var(--accent); color: white; transform: translateY(-5px); }

/* Accessibilità Evoluta */
.acc-wrapper { position: fixed; bottom: 30px; left: 30px; z-index: 1001; }
.acc-header { font-weight: 800; color: var(--accent); margin-bottom: 15px; font-size: 14px; text-transform: uppercase; border-bottom: 1px solid #334155; padding-bottom: 5px;}
.acc-panel { 
    display: none; flex-direction: column; gap: 8px;
    background: #0f172a; border: 1px solid var(--accent);
    padding: 20px; border-radius: 20px; width: 260px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.8);
    position: absolute; bottom: 70px; left: 0;
}
.acc-btn { 
    background: #1e293b; color: white; border: 1px solid #334155;
    padding: 12px; border-radius: 10px; cursor: pointer; text-align: left;
    font-size: 13px; font-weight: 600; transition: 0.2s;
}
.acc-btn i { margin-right: 10px; color: var(--accent); width: 20px; }
.acc-btn:hover { background: #334155; border-color: var(--accent); }
.acc-btn.reset { margin-top: 10px; background: transparent; border-color: #ef4444; color: #ef4444; }

/* Focus per Ipovedenti */
.high-contrast { background: #000 !important; color: #00ff00 !important; }
.high-contrast .card { background: #111; border: 2px solid #00ff00; }

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

input[type="text"], 
input[type="email"], 
textarea {
    width: 100%;
    padding: 15px;
    background: #1e293b;
    border: 1px solid #334155;
    color: white;
    border-radius: 10px;
    font-family: inherit;
    transition: 0.3s;
}

input:focus, select:focus {
    border-color: var(--accent);
    outline: none;
    background: #243147;
}

/* Back to Top - Verifica visibilità */
#back-to-top {
    position: fixed; bottom: 30px; right: 30px;
    width: 50px; height: 50px; background: var(--accent);
    color: white; border: none; border-radius: 50%;
    display: none; cursor: pointer; z-index: 1000;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

/* --- OTTIMIZZAZIONE RESPONSIVE --- */
@media (max-width: 768px) {
    .hero h1 { font-size: 2.5rem; text-align: center; }
    .hero p { text-align: center; }
    .cta-group { display: flex; flex-direction: column; gap: 15px; align-items: center; }
    .btn-primary { width: 100%; text-align: center; }
    
    .form-grid { grid-template-columns: 1fr; } /* Campi uno sotto l'altro su mobile */
    
    nav ul {
        flex-direction: column;
        position: absolute;
        top: 80px; left: 0; width: 100%;
        background: var(--bg-deep);
        padding: 20px;
        border-bottom: 2px solid var(--accent);
        display: none; /* Gestito da JS */
    }
    nav ul.active { display: flex; }
}

/* --- STILE FORM E PRIVACY --- */
.privacy-box {
    margin: 20px 0;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.85rem;
    color: var(--text-dim);
}

.privacy-box input { width: auto; margin-top: 4px; }

input:invalid { border-color: #ef4444; } /* Feedback errore visivo */

/* Notifica Invio */
.form-loader {
    display: none;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    text-align: center;
    font-weight: bold;
}
.success { background: rgba(34, 197, 94, 0.2); color: #22c55e; border: 1px solid #22c55e; }

/* Ulteriori classi per Accessibilità */
.extra-spacing { letter-spacing: 2px !important; word-spacing: 4px !important; line-height: 2 !important; }
.grayscale { filter: grayscale(100%); }

/* --- FIX ACCESSIBILITÀ LINK --- */
.underline-links a { 
    text-decoration: underline !important; 
    font-weight: bold !important; 
    /* Forza un colore visibile sia su tema chiaro che scuro */
    color: var(--accent) !important; 
	
	    text-decoration: underline !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Se sei in High Contrast, il link deve essere giallo per visibilità */
.high-contrast.underline-links a {
    color: #ffff00 !important;
}





.readable-font { font-family: 'Open Sans', Arial, sans-serif !important; }

/* Responsive improvements */
@media (max-width: 768px) {
    .hero { padding: 80px 5%; }
    .content-grid { grid-template-columns: 1fr; }
}

/* --- ACCESSIBILITÀ AVANZATA --- */
.high-contrast { background-color: #000 !important; color: #fff !important; }
.high-contrast .card, .high-contrast header { background: #000; border: 2px solid #fff; }
.high-contrast a { color: #ffff00 !important; }

.extra-spacing { letter-spacing: 2px !important; word-spacing: 4px !important; line-height: 2.2 !important; }
.grayscale { filter: grayscale(100%); }

/* --- FIX ACCESSIBILITÀ LINK --- */
.underline-links a { 
    text-decoration: underline !important; 
    font-weight: bold !important; 
    /* Forza un colore visibile sia su tema chiaro che scuro */
    color: var(--accent) !important; 
}

/* Se sei in High Contrast, il link deve essere giallo per visibilità */
.high-contrast.underline-links a {
    color: #ffff00 !important;
}



#reading-guide {
    position: fixed; top: 50%; left: 0; width: 100%; height: 2px;
    background: var(--accent); box-shadow: 0 0 10px var(--accent);
    display: none; z-index: 9999; pointer-events: none;
}

.acc-panel {
    display: none; position: fixed; bottom: 85px; right: 20px;
    background: var(--bg-card); border: 1px solid var(--accent);
    padding: 15px; border-radius: 12px; flex-direction: column; gap: 8px;
    z-index: 1001; box-shadow: 0 10px 30px rgba(0,0,0,0.5); width: 220px;
}
.acc-btn {
    background: transparent; color: white; border: 1px solid rgba(255,255,255,0.1);
    padding: 8px; border-radius: 6px; cursor: pointer; text-align: left; font-size: 0.9rem;
}
.acc-btn:hover { background: var(--accent); }
.acc-btn.reset { color: #ff4444; border-color: #ff4444; margin-top: 5px; }

/* Pannello Accessibilità */
.acc-panel {
    display: none; /* Inizialmente nascosto, gestito da JS */
    flex-direction: column;
    gap: 8px;
    background: #0f172a;
    border: 1px solid #ff6b00;
    padding: 15px;
    border-radius: 12px;
    width: 220px;
    margin-bottom: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.acc-btn {
    background: rgba(255,255,255,0.05);
    color: white;
    border: 1px solid rgba(255,255,255,0.1);
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    text-align: left;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.acc-btn:hover {
    background: #ff6b00;
    color: white;
}

/* Classi di stato attivate dal JS */
.high-contrast { background: black !important; color: white !important; }
.high-contrast .card { background: black; border: 2px solid white; }
.high-contrast a { color: #ffff00 !important; }

.extra-spacing { letter-spacing: 2px !important; line-height: 2 !important; }
.grayscale { filter: grayscale(100%); }
.underline-links a { text-decoration: underline !important; font-weight: bold; opacity: 1 !important; visibility: visible !important; }



/* Pannello Accessibilità - Stato Iniziale */
.acc-panel {
    display: none; /* Fondamentale: deve essere nascosto di default */
    flex-direction: column;
    gap: 10px;
    background: var(--bg-card);
    border: 1px solid var(--accent);
    padding: 20px;
    border-radius: 15px;
    width: 250px;
    position: fixed;
    bottom: 90px;
    right: 20px;
    z-index: 3000;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

/* Classi di utilità attivate dal JS */
.high-contrast { background: #000 !important; color: #fff !important; }
.high-contrast * { border-color: #fff !important; }
.high-contrast a { color: #ffff00 !important; text-decoration: underline !important; }

.grayscale { filter: grayscale(100%); }

.extra-spacing { letter-spacing: 2px !important; line-height: 2 !important; }

.underline-links a { text-decoration: underline !important; font-weight: bold !important; color: var(--accent) !important; }

#reading-guide {
    position: fixed;
    width: 100%;
    height: 3px;
    background: var(--accent);
    z-index: 9999;
    pointer-events: none;
    display: none;
    box-shadow: 0 0 15px var(--accent);
}

/* Pannello Accessibilità */
.acc-panel {
    display: none; flex-direction: column; gap: 8px;
    background: #0f172a; border: 1px solid #ff6b00;
    padding: 15px; border-radius: 12px; width: 220px;
    position: fixed; bottom: 85px; right: 20px; z-index: 3000;
}
.acc-btn {
    background: rgba(255,255,255,0.05); color: white; border: 1px solid rgba(255,255,255,0.1);
    padding: 10px; border-radius: 6px; cursor: pointer; text-align: left;
}
.acc-btn:hover { background: #ff6b00; }
.acc-toggle {
    position: fixed; bottom: 20px; right: 20px; width: 60px; height: 60px;
    border-radius: 50%; background: #ff6b00; color: white; border: none;
    cursor: pointer; font-size: 24px; z-index: 3000;
}

/* Effetti visivi */
.high-contrast { background: #000 !important; color: #fff !important; }

/* Modifica questa parte nel tuo style.css */
.grayscale { 
    filter: grayscale(100%) !important; 
    /* Rimuovi eventuali transizioni pesanti che potrebbero spostare il layout */
}

/* Forza il menu a restare fisso anche con i filtri attivi */
.acc-wrapper, .acc-panel, .acc-toggle {
    filter: none !important; 
	backdrop-filter: none !important; /* Impedisce al menu di diventare grigio e di spostarsi */
}

/* Reset selettivo per evitare che il menu si sposti */
body.grayscale {
    filter: grayscale(1);
}



/* Assicura visibilità link */
.underline-links a {
    text-decoration: underline !important;
    opacity: 1 !important;
    visibility: visible !important;
}





.extra-spacing { letter-spacing: 2px !important; line-height: 2 !important; }
.underline-links a { text-decoration: underline !important; font-weight: bold; }
#reading-guide { position: fixed; width: 100%; height: 3px; background: #ff6b00; display: none; z-index: 9999; pointer-events: none; }

#back-to-top {
    position: fixed;
    bottom: 25px;
    right: 90px; /* Posizionato a sinistra del tasto accessibilità */
    width: 50px;
    height: 50px;
    background-color: var(--accent);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    z-index: 2500;
    display: none; /* Gestito dal JS */
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
    transition: all 0.3s ease;
}

#back-to-top:hover {
    transform: scale(1.1);
    background-color: #ff8533;
}

/* Assicurati che il wrapper accessibilità sia a destra del back-to-top */
.acc-toggle {
    right: 20px !important;
}

footer {
    background: rgba(15, 23, 42, 0.95);
    padding: 60px 8% 20px;
    border-top: 1px solid rgba(255,255,255,0.05);
    color: var(--text-primary);
}

.footer-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-h4 {
    color: var(--accent);
    margin-bottom: 20px;
    font-size: 1.2rem;
    font-weight: 800;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.05);
    font-size: 0.85rem;
    color: var(--text-dim);
}

/* Adattamento per Modalità Bianca */
[data-theme="light"] footer {
    background: #e2e8f0;
    color: #0f172a;
}

/* --- TEMA DARK (Default) --- */
[data-theme="dark"] {
    --bg-deep: #060b13;
    --bg-card: #0f172a;
    --text-primary: #f8fafc; /* Bianco sporco */
    --text-dim: #94a3b8;     /* Grigio chiaro */
    --header-bg: rgba(6, 11, 19, 0.9);
}

/* --- TEMA LIGHT (Bianco) --- */
[data-theme="light"] {
    --bg-deep: #f1f5f9;      /* Sfondo grigio chiarissimo/bianco */
    --bg-card: #ffffff;      /* Card bianche */
    --text-primary: #0f172a; /* Testo Blu Notte/Nero (IMPORTANTE) */
    --text-dim: #475569;     /* Testo secondario Grigio scuro */
    --header-bg: rgba(255, 255, 255, 0.9);
}

body {
    background-color: var(--bg-deep);
    color: var(--text-primary); /* Questo cambierà da bianco a nero automaticamente */
    transition: all 0.3s ease;
}

header {
    background-color: var(--header-bg);
}

/* Header links */
nav ul li a {
    color: var(--text-primary) !important;
}

/* Titoli e Paragrafi */
h1, h2, h3, h4, p, li {
    color: var(--text-primary);
}

/* Card */
.card {
    background-color: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid rgba(0,0,0,0.05);
}

/* Footer (spesso rimane scuro anche in tema chiaro, ma ecco come adeguarlo) */
[data-theme="light"] footer {
    background-color: #e2e8f0;
    color: #0f172a;
}

[data-theme="light"] .footer-h4 {
    color: var(--accent); /* Mantiene l'arancione ZBpoint */
}


/* --- DROPDOWN CONTATTI --- */
/* ========== FIX FINALE DROPDOWN CONTATTI ========== */

/* il <li class="dropdown"> diventa il contenitore del menu */
.dropdown {
    position: relative;
}

/* sottomenu nascosto di default */
.dropdown-menu {
    display: none !important;
    position: absolute;
    top: 100%;           /* appiccicato subito sotto "Contatti" */
    left: 0;
    background: var(--bg-card);
    padding: 8px 0;
    list-style: none;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 8px;
    min-width: 220px;
    z-index: 9999;
}

/* elementi interni cliccabili e facili da agganciare col mouse */
.dropdown-menu li a {
    display: block;
    padding: 8px 16px;
    white-space: nowrap;
}

/* DESKTOP: hover stabile */
@media (min-width: 769px) {
    .dropdown:hover .dropdown-menu {
        display: block !important;
    }
}

/* MOBILE: apertura a click tramite classe .open del JS */
@media (max-width: 768px) {

    nav ul.menu {
        position: absolute;
        top: 80px;
        left: 0;
        width: 100%;
        background: var(--bg-deep);
    }

    .dropdown-menu {
        position: static !important;
        border: none !important;
        min-width: auto;
        padding-left: 16px;
    }

    .dropdown.open .dropdown-menu {
        display: block !important;
    }
}

/* ===== FIX FINALE MENU RESPONSIVE ===== */
/* ===== FIX DEFINITIVO MENU MOBILE ===== */

/* ===== FIX DEFINITIVO MENU MOBILE CONTATTI ===== */

/* ===== FIX DEFINITIVO: SBLOCCA IL CLICK SU CONTATTI ===== */

/* ===== FIX MENU MOBILE ===== */

@media (max-width: 768px) {

    nav ul.menu {
        display: none !important;
        flex-direction: column !important;
        width: 100%;
        background: var(--bg-deep);
        padding: 20px;
    }

    nav ul.menu.active {
        display: flex !important;
    }
}


/* Esempio di correzione nel CSS mobile */
@media (max-width: 768px) {
    .nav-links {
        display: flex;
        flex-direction: column;
        z-index: 9999 !important; /* Forza il menu a stare sopra a tutto */
    }
    
    .nav-links a {
        display: block;
        padding: 15px;
        width: 100%; /* Espande l'area cliccabile */
    }
}


/* Mostra il dropdown al passaggio del mouse */
.dropdown:hover .dropdown-menu {
    display: block;
}

/* Stile base del dropdown */
.dropdown-menu {
    display: none;
    list-style: none;
    margin: 0;
    padding: 0;
    background: #000;
    border: 1px solid #ccc;
    position: absolute;
}

/* Stile dei link del sottomenu 
.dropdown-menu li a {
    display: block;
    padding: 8px 12px;
    color: #000000;
    text-decoration: none;
	 ! color: var(--text-primary) !important; 
}



/* Stile dei link del sottomenu - CORRETTO */
.dropdown-menu li a {
    display: block;
    padding: 10px 16px;
    color: var(--text-primary) !important; /* Usa la variabile invece di #000000 */
    text-decoration: none;
    transition: 0.2s;
}

@media (max-width: 768px) {
    /* Assicura che il sottomenu non si sovrapponga ma sposti il contenuto */
    .dropdown-menu {
        position: static !important;
        background: rgba(255, 255, 255, 0.05) !important;
        border: none !important;
        width: 100% !important;
        padding-left: 20px !important;
    }
}



/* Esempio di correzione nel CSS mobile */
@media (max-width: 768px) {
    .nav-links {
        display: flex;
        flex-direction: column;
        z-index: 9999 !important; /* Forza il menu a stare sopra a tutto */
    }
    
    .nav-links a {
        display: block;
        padding: 15px;
        width: 100%; /* Espande l'area cliccabile */
    }
}






/* Stile per il separatore su Mobile */
@media (max-width: 768px) {
    .dropdown {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
    }
    
    .dropdown > a {
        flex: 1; /* Il link prende tutto lo spazio a sinistra */
    }

    .submenu-trigger {
        padding: 15px; /* Area cliccabile grande per il pollice */
        cursor: pointer;
        color: var(--accent);
        font-weight: bold;
    }

    /* Mostra il sottomenu solo quando si clicca sulla freccia o sulla classe active */
    .dropdown-menu {
        width: 100%; /* Si posiziona sotto */
    }
}

/* Layout del contenitore link + freccia */
.nav-link-wrapper {
    display: flex;
    align-items: top;
    justify-content: space-between;
}

.submenu-toggle {
    padding: 0px 0px; /* Ampia area di tocco per smartphone */
    cursor: pointer;
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

/* Effetto rotazione freccia quando aperto (opzionale) */
.dropdown.open .submenu-toggle {
    transform: rotate(180deg);
}

@media (max-width: 768px) {
    .dropdown-menu {
        display: none; /* Nasconde di base su mobile */
        width: 100%;
        position: static;
    }
    
    .dropdown.open .dropdown-menu {
        display: block; /* Mostra quando la classe .open è attiva */
    }
}





/* Evidenziazione al passaggio del mouse */
.dropdown-menu li a:hover {
    background-color: #ff6b00;
	border-radius: 8px; 
}

/* Evidenziazione quando il link è selezionato con TAB */
.dropdown-menu li a:focus {
    background-color: #ff6b00 ;
    outline: none;
}



/* --- RESET E POSIZIONAMENTO UNIFICATO PULSANTI FLOAT --- */

/* 1. Accessibilità (Estrema destra) */
.acc-toggle {
    right: 20px !important;
    bottom: 20px !important;
    width: 60px !important;
    height: 60px !important;
    border-radius: 50% !important;
    z-index: 3000 !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4) !important;
    transition: transform 0.3s ease !important;
}

.acc-toggle:hover {
    transform: scale(1.1);
}

/* 2. Back to Top (Tra Accessibilità e WhatsApp) */
#back-to-top {
    position: fixed !important;
    right: 95px !important; /* Spazio: 20px + 60px icona + 15px gap */
    bottom: 25px !important; /* Leggermente più su per allinearsi visivamente */
    width: 50px !important;
    height: 50px !important;
    border-radius: 12px !important; /* Design moderno squadrato-curvo */
    background: var(--bg-card) !important;
    color: var(--accent) !important;
    border: 2px solid var(--accent) !important;
    z-index: 2500 !important;
    display: none; /* Gestito da JS */
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4) !important;
}

/* 3. Pannello Accessibilità (Sopra il suo tasto) */
.acc-panel {
    display: none;
    position: fixed !important;
    right: 20px !important;
    bottom: 90px !important;
    z-index: 5000 !important;
}

/* Fix per Mobile: nascondiamo il testo di WhatsApp per non coprire lo schermo */
@media (max-width: 768px) {
    .whatsapp-text {
        display: none;
    }
    .whatsapp-container {
        right: 155px;
    }
    #back-to-top {
        right: 90px !important;
    }
}

/* immagine responsive */
.img-responsive {
    max-width: 100%;
    height: auto;
    display: block;
}





/* =========================================
   FIX ACCESSIBILITÀ (Link e Grigi)
   ========================================= */

/* 1. FIX LINK INVISIBILI
   Usa !important e colori HEX diretti per evitare errori con le variabili.
   Resetta anche -webkit-text-fill-color nel caso i link avessero gradienti.
*/
.underline-links a,
body.underline-links a { 
    text-decoration: underline !important; 
    text-decoration-thickness: 2px !important;
    font-weight: 800 !important; 
    color: #ff6b00 !important; /* Arancione acceso */
    -webkit-text-fill-color: #ff6b00 !important; /* Rimuove trasparenze indesiderate */
    opacity: 1 !important;
    visibility: visible !important;
}

/* Se è attiva ANCHE la modalità Alto Contrasto, i link diventano Gialli */
body.high-contrast.underline-links a,
.high-contrast .underline-links a {
    color: #ffff00 !important; /* Giallo puro */
    -webkit-text-fill-color: #ffff00 !important;
    text-decoration-color: #ffff00 !important;
}

/* 2. FIX MENU CHE SCENDE (Grigi)
   NON applicare il filtro al body, ma solo ai contenuti.
   Questo impedisce al menu 'fixed' di sganciarsi e scendere a fine pagina.
*/
.grayscale header, 
.grayscale section, 
.grayscale footer,
.grayscale main,
.grayscale .content-grid,
.grayscale .hero { 
    filter: grayscale(100%) !important; 
}

/* Assicurati che il body stesso NON abbia filtri */
body.grayscale {
    filter: none !important;
}

/* 3. ALTRE FUNZIONI */
.high-contrast { 
    background-color: #000000 !important; 
    color: #ffffff !important; 
}
.high-contrast .card { 
    background-color: #000000 !important; 
    border: 2px solid #ffffff !important; 
}
.extra-spacing { 
    letter-spacing: 2px !important; 
    line-height: 2.2 !important; 
}

/* Barra guida lettura */
#reading-guide {
    position: fixed; width: 100%; height: 5px;
    background: #ff6b00; z-index: 9999;
    pointer-events: none; display: none;
    box-shadow: 0 0 15px rgba(255, 107, 0, 0.8);
}

/* =========================================
   FIX LINK E BOTTONI
   ========================================= */

/* 1. LINK STANDARD (Nel testo) -> Diventano Arancioni e Sottolineati */
.underline-links a:not(.btn-primary):not(.acc-btn):not(.button) { 
    text-decoration: underline !important; 
    text-decoration-thickness: 2px !important;
    font-weight: 800 !important; 
    color: #ff6b00 !important; /* Arancione per evidenziare */
    -webkit-text-fill-color: #ff6b00 !important;
    opacity: 1 !important;
}

/* 2. LINK CHE SONO BOTTONI -> Restano Bianchi */
/* Questo impedisce l'effetto "Arancione su Arancione" (invisibile) */
.underline-links .btn-primary,
.underline-links .acc-btn,
.underline-links button,
.underline-links a.button {
    color: #ffffff !important; /* Forza il testo bianco */
    -webkit-text-fill-color: #ffffff !important;
    text-decoration: none !important; /* Niente sottolineatura sui bottoni */
    border-color: #ffffff !important; /* Bordo bianco per contrasto */
}

/* 3. FIX GRIGI (Menu fermo) */
.grayscale header, 
.grayscale section, 
.grayscale footer,
.grayscale main,
.grayscale .content-grid,
.grayscale .hero { 
    filter: grayscale(100%) !important; 
}

/* Impedisce al filtro di colpire il menu accessibilità */
body.grayscale { filter: none !important; }
.acc-wrapper, .acc-panel { filter: none !important; }









