:root {
    --rosso-lista: #a0172f; 
    --testo-scuro: #1f2937;
    --sfondo-body: #f3f4f6;
    --sfondo-bianco: #ffffff;
}

/* === ANIMAZIONI === */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes logoBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes loading {
    to { left: 100%; }
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--sfondo-body);
    color: var(--testo-scuro);
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* === SPLASH SCREEN === */
#splash-screen {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: var(--rosso-lista);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    transition: opacity 0.5s ease, visibility 0.5s;
}

.splash-content { text-align: center; color: white; }
.splash-logo { width: 150px; margin-bottom: 20px; animation: logoBounce 2s infinite; }
.splash-text { font-family: 'Anton', sans-serif; font-size: 2.5rem; letter-spacing: 2px; }
.splash-loader { 
    width: 50px; height: 5px; background: rgba(255,255,255,0.3); 
    margin: 20px auto; position: relative; overflow: hidden; border-radius: 10px;
}
.splash-loader::after {
    content: ''; position: absolute; left: -100%; width: 100%; height: 100%;
    background: white; animation: loading 1.5s infinite;
}

/* === TOP BAR === */
.top-bar { 
    background-color: white; 
    color: var(--rosso-lista); 
    font-size: 0.85rem; 
    padding: 10px 20px; 
    text-align: center; 
    font-weight: 700; 
    letter-spacing: 1px; 
    border-bottom: 1px solid rgba(160, 23, 47, 0.1);
}

/* === HEADER & MENU === */
.header-rosso {
    color: white;
    padding: 40px 20px 8vw 20px;
    position: relative;
}

.header-rosso::before {
    content: "";
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: var(--rosso-lista);
    clip-path: polygon(0 0, 100% 0, 100% 85%, 0 100%);
    z-index: -1; 
}

.header-container { max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 30px; }
.slogan-box { display: flex; align-items: flex-start; }
.img-slogan { max-width: 100%; width: 380px; height: auto; display: block; filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1)); }

.main-nav { display: flex; justify-content: flex-end; align-items: center; gap: 20px; flex-wrap: wrap; }
.main-nav a { color: white; text-decoration: none; font-weight: 600; font-size: 1.05rem; padding: 8px 12px; border-radius: 6px; transition: all 0.3s ease; }
.main-nav a:hover { background-color: rgba(255, 255, 255, 0.1); transform: translateY(-2px); }

.btn-partecipa { background-color: white !important; color: var(--rosso-lista) !important; border-radius: 50px !important; box-shadow: 0 4px 15px rgba(160, 23, 47, 0.15); padding: 12px 24px !important; font-weight: 700 !important; }
.btn-partecipa:hover { box-shadow: 0 6px 20px rgba(160, 23, 47, 0.25); transform: translateY(-3px); }

/* === MENU MOBILE (HAMBURGER) === */
.menu-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 10px; position: relative; z-index: 2001; }
.menu-toggle span { width: 30px; height: 3px; background: white; border-radius: 2px; transition: 0.3s; }

/* OVERLAY MENU MOBILE */
.menu-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6); backdrop-filter: blur(3px);
    z-index: 1999; opacity: 0; visibility: hidden; transition: 0.3s;
}
.menu-overlay.active { opacity: 1; visibility: visible; }

/* === AREA CONTENUTI & CARD === */
.content-area { flex: 1; padding: 0 20px 60px 20px; max-width: 900px; margin: -5vw auto 0 auto; position: relative; z-index: 10; }
.modern-card { background-color: var(--sfondo-bianco); border-radius: 16px; padding: 50px; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08); animation: fadeInUp 0.6s ease-out forwards; opacity: 0; }
.title-wrapper { display: flex; flex-direction: column; align-items: center; margin-bottom: 30px; }
.intro-section h2 { font-family: 'Anton', sans-serif; font-size: 3rem; color: var(--rosso-lista); letter-spacing: 1px; text-align: center; }
.accent-line { width: 60px; height: 4px; background-color: var(--rosso-lista); border-radius: 2px; margin-top: 10px; }
.text-content p { font-size: 1.15rem; line-height: 1.8; margin-bottom: 20px; color: #4b5563; overflow-wrap: break-word; word-wrap: break-word; }
.text-content p:last-child { margin-bottom: 0; }
.text-content a { color: var(--rosso-lista); font-weight: 600; text-decoration: none; }
.text-content a:hover { text-decoration: underline; }

/* === FORM OFFICINA E BOTTONI (RIPRISTINATO) === */
.officina-form { display: flex; flex-direction: column; gap: 25px; width: 100%; margin-top: 20px; }
.form-row { display: flex; gap: 20px; width: 100%; }
.form-group { display: flex; flex-direction: column; gap: 8px; text-align: left; flex: 1; }
.form-group label { font-weight: 700; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.5px; color: #4b5563; }
.form-group input, .form-group textarea { width: 100%; padding: 16px; border: 2px solid #e5e7eb; border-radius: 12px; font-family: 'Inter', sans-serif; font-size: 1.05rem; background-color: #f9fafb; color: var(--testo-scuro); transition: all 0.3s; }
.form-group input::placeholder, .form-group textarea::placeholder { color: #9ca3af; }
.form-group input:focus, .form-group textarea:focus { outline: none; border-color: var(--rosso-lista); background-color: #ffffff; box-shadow: 0 0 0 4px rgba(160, 23, 47, 0.15); }
.captcha-box { background-color: #fff1f2; padding: 20px; border-radius: 12px; border: 2px dashed #fecdd3; margin-top: 10px; }
.captcha-box label { color: var(--rosso-lista); font-size: 0.95rem; }
.submit-group { margin-top: 20px; display: flex; justify-content: center; }

/* Bottoni intelligenti */
.btn-invia { 
    background-color: var(--rosso-lista); 
    color: white !important;
    font-family: 'Anton', sans-serif; 
    font-size: 1.6rem; 
    padding: 18px 50px; 
    border: none; 
    border-radius: 50px; 
    cursor: pointer; 
    box-shadow: 0 10px 25px rgba(160, 23, 47, 0.3); 
    transition: all 0.3s ease; 
    text-transform: uppercase; 
    letter-spacing: 2px;
    display: inline-block;
    text-align: center;
    text-decoration: none;
    box-sizing: border-box;
    max-width: 100%;
    white-space: normal;
}
.btn-invia:hover { transform: translateY(-4px); box-shadow: 0 15px 35px rgba(160, 23, 47, 0.4); color: white; }

/* === GRIGLIA CANDIDATI === */
.candidati-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 40px;
}
.candidato-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #f3f4f6;
}
.candidato-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(160, 23, 47, 0.15);
}
.img-candidato {
    width: 100%;
    height: auto; 
    display: block;
    border-bottom: 4px solid var(--rosso-lista); 
}

/* === TITOLI SEZIONI CANDIDATI === */
.titolo-organo {
    font-family: 'Anton', sans-serif;
    font-size: 2.2rem;
    color: var(--testo-scuro);
    margin-top: 60px;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.accent-line-small {
    width: 50px;
    height: 4px;
    background-color: var(--rosso-lista);
    border-radius: 2px;
    margin: 0 auto 30px auto;
}

/* === FOOTER === */
.footer-rosso { background-color: var(--rosso-lista); clip-path: polygon(0 15vw, 100% 0, 100% 100%, 0 100%); padding: 12vw 20px 40px 20px; margin-top: -6vw; position: relative; z-index: 5; }
.footer-container { max-width: 900px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 30px; }
.vota-badge { background-color: white; color: var(--rosso-lista); font-family: 'Anton', sans-serif; font-size: 2.5rem; padding: 15px 30px; border-radius: 8px; text-transform: uppercase; box-shadow: 6px 6px 0px rgba(160, 23, 47, 0.4); transform: rotate(-3deg); }
.logo-container img { max-width: 180px; height: auto; display: block; filter: drop-shadow(0 4px 10px rgba(0,0,0,0.2)); }

/* === COOKIE BANNER === */
.cookie-banner { 
    position: fixed; 
    bottom: 20px; 
    left: 50%;
    transform: translateX(-50%); 
    width: 90%;
    max-width: 800px; 
    background-color: white; 
    color: var(--testo-scuro); 
    padding: 20px 30px; 
    display: none; 
    justify-content: space-between; 
    align-items: center; 
    z-index: 9999; 
    gap: 20px; 
    border-radius: 16px; 
    box-shadow: 0 15px 40px rgba(0,0,0,0.15); 
    border: 2px solid #fecdd3; 
}
.cookie-text { max-width: 600px; line-height: 1.5; font-size: 0.95rem; }
.cookie-banner a { color: var(--rosso-lista); font-weight: 600; text-underline-offset: 4px; }
.btn-cookie { 
    background-color: var(--rosso-lista); 
    color: white; border: none; padding: 12px 25px; 
    border-radius: 50px; font-weight: 700; cursor: pointer; 
    white-space: nowrap; transition: transform 0.2s; 
    box-shadow: 0 4px 15px rgba(160, 23, 47, 0.2);
}
.btn-cookie:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(160, 23, 47, 0.3); }

/* === RESPONSIVE === */
@media (max-width: 900px) {
    .menu-toggle { display: flex; }
    .img-slogan { width: 250px; }
    
    .main-nav {
        position: fixed; top: 0; right: -100%; width: 75%; max-width: 300px; height: 100vh;
        background: white; flex-direction: column; justify-content: flex-start; padding-top: 80px;
        transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1); z-index: 2000;
        box-shadow: -10px 0 30px rgba(0,0,0,0.2);
    }
    .main-nav.active { right: 0; }
    .main-nav a { 
        color: var(--testo-scuro); font-size: 1.3rem; padding: 18px 20px; 
        border-bottom: 1px solid #f3f4f6; width: 100%; text-align: left; 
    }
    .main-nav a:hover { background-color: #fff1f2; color: var(--rosso-lista); }
    .btn-partecipa { margin: 20px auto 0 !important; width: 90% !important; text-align: center !important; }
    
    .menu-toggle.open span { background: var(--testo-scuro); }
    .menu-toggle.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .menu-toggle.open span:nth-child(2) { opacity: 0; }
    .menu-toggle.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

    .header-rosso::before { clip-path: polygon(0 0, 100% 0, 100% 90%, 0 100%); }
    .header-rosso { padding-bottom: 12vw; }
    .modern-card { padding: 30px 20px; }
    .intro-section h2 { font-size: 2.2rem; }
    .footer-rosso { clip-path: polygon(0 10vw, 100% 0, 100% 100%, 0 100%); padding-top: 15vw; }
    .footer-container { justify-content: center; flex-direction: column-reverse; gap: 40px; }
    .cookie-banner { flex-direction: column; text-align: center; bottom: 10px; padding: 20px; width: 95%; }
}

@media (max-width: 600px) {
    .modern-card { padding: 25px 15px; } 
    .text-content p { font-size: 1.05rem; }
    
    /* CSS mobile per il form ripristinato */
    .form-row { flex-direction: column; gap: 20px; }
    .btn-invia { 
        padding: 15px 15px; 
        font-size: 1.15rem; 
        width: 100%; 
        line-height: 1.3;
    } 
}