/* =========================================
VARIABILI & RESET — DESIGN GLASS PREMIUM
========================================= */
:root {
    /* Palette Colori Elettorali Premium */
    --primary: #0A2540;
    --primary-light: #183C66;
    --secondary: #D32F2F;
    --secondary-hover: #B71C1C;
    --accent: #059669;

    /* Neutri */
    --bg-color: #F4F7F9;
    --bg-light: #FFFFFF;
    --text-main: #334155;
    --text-muted: #64748B;
    --text-heading: var(--primary);

    /* Tipografia Fluida (Leggermente ridotta per maggiore leggibilità editoriale) */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --fs-h1: clamp(2rem, 4vw, 3.2rem);
    --fs-h2: clamp(1.5rem, 3vw, 2.2rem);
    --fs-h3: clamp(1.25rem, 2vw, 1.5rem);
    --fs-h4: clamp(1.05rem, 1.5vw, 1.15rem);
    --fs-lead: clamp(1rem, 1.5vw, 1.1rem);
    --fs-body: clamp(0.95rem, 1vw, 1rem);
    --fs-small: 0.85rem;
    --lh-heading: 1.2; /* Aumentato leggermente per compensare font più piccoli */
    --lh-body: 1.75;
    --lh-tight: 1.45;

    /* Spaziature Fluide */
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: clamp(1.25rem, 3vw, 1.75rem);
    --spacing-xl: clamp(2.5rem, 5vw, 3.5rem);

    /* UI / Glassmorphism */
    --radius-sm: 10px;
    --radius-md: 20px;
    --radius-lg: 32px;
    --radius-pill: 50px;
    --shadow-soft: 0 4px 20px rgba(10, 37, 64, 0.06), 0 1px 3px rgba(0,0,0,0.04);
    --shadow-hover: 0 20px 40px rgba(10, 37, 64, 0.1), 0 4px 12px rgba(0,0,0,0.06);
    --shadow-card: 0 1px 3px rgba(0,0,0,0.04), 0 8px 24px rgba(10,37,64,0.04);
    --glass-bg: rgba(255, 255, 255, 0.82);
    --glass-border: 1px solid rgba(255, 255, 255, 0.75);
    --glass-glow: inset 0 1px 0 rgba(255,255,255,0.8);
    --transition-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
    overflow-x: hidden;
    width: 100%;
}

/* SVG Icon base style */
.icon { display: inline-block; width: 1em; height: 1em; vertical-align: -0.125em; fill: currentColor; }

body {
    font-family: var(--font-body);
    color: var(--text-main);
    background-color: var(--bg-color);
    line-height: var(--lh-body);
    font-size: var(--fs-body);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: var(--lh-heading);
    color: var(--text-heading);
    margin-bottom: var(--spacing-md);
    text-wrap: balance;
}

h1 { font-size: var(--fs-h1); letter-spacing: -0.03em; line-height: 1.1; }
h2 { font-size: var(--fs-h2); letter-spacing: -0.03em; }
h3 { font-size: var(--fs-h3); letter-spacing: -0.02em; }
h4 { font-size: var(--fs-h4); letter-spacing: -0.01em; }

.subtitle, .lead { text-wrap: pretty; }

a { text-decoration: none; color: var(--accent); transition: color 0.4s ease, transform 0.4s ease; }
img { max-width: 100%; height: auto; display: block; }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 var(--spacing-lg); }
.section-padding { padding: var(--spacing-xl) 0; }
.text-center { text-align: center; }

/* Ottimizzazione Performance Rendering disabilitata per incompatibilità con lo scroll di Safari
.about-section, .program-section, .candidates-section, .come-vota-section, .news-section, .contact-section {
    content-visibility: auto;
    contain-intrinsic-size: 0 500px;
} */

.mt-2 { margin-top: var(--spacing-md); }
.mt-4 { margin-top: var(--spacing-lg); }
.bg-light { background-color: var(--bg-light); }
.bg-accent { background-color: var(--primary); }
.text-white h2, .text-white p, .text-white h3 { color: #fff; }

/* =========================================
   BOTTONI & UI
========================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 10px 24px;
    border-radius: var(--radius-pill);
    font-weight: 600;
    font-family: var(--font-heading);
    cursor: pointer;
    border: none;
    font-size: var(--fs-body);
    transition: transform 0.4s var(--transition-bounce), box-shadow 0.4s var(--transition-bounce), background-color 0.4s var(--transition-bounce), color 0.4s var(--transition-bounce), border-color 0.4s var(--transition-bounce);
    letter-spacing: 0.02em;
}

.btn-large { padding: 12px 32px; font-size: var(--fs-lead); }
.btn-block { display: block; width: 100%; }

.btn-primary {
    background: linear-gradient(135deg, var(--secondary), var(--secondary-hover));
    color: white;
    box-shadow: 0 4px 15px rgba(211, 47, 47, 0.25);
    border: 1px solid rgba(255,255,255,0.1);
}
.btn-primary:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 25px rgba(211, 47, 47, 0.35);
}

/* Animazione composita PageSpeed 100/100 */
@keyframes pulse-glow {
    0% { transform: scale(1); opacity: 0.6; }
    70% { transform: scale(1.15, 1.4); opacity: 0; }
    100% { transform: scale(1); opacity: 0; }
}

.btn-primary.pulse {
    position: relative;
    z-index: 1;
}
.btn-primary.pulse::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: rgba(211, 47, 47, 0.5);
    z-index: -1;
    animation: pulse-glow 2s infinite;
}

.btn-secondary {
    background-color: var(--primary);
    color: #fff;
}
.btn-secondary:hover {
    background-color: var(--primary-light);
    transform: translateY(-2px);
    color: #fff;
}

.btn-outline {
    background-color: var(--glass-bg);
    backdrop-filter: blur(8px);
    color: var(--primary);
    border: 2px solid var(--primary-light);
}
.btn-outline:hover {
    background-color: var(--primary);
    border-color: var(--primary);
    color: white;
    transform: translateY(-4px) scale(1.02);
    box-shadow: var(--shadow-hover);
}

.badge {
    display: inline-flex;
    align-items: center;
    background: transparent;
    color: var(--primary);
    border: 1px solid rgba(10, 37, 64, 0.2);
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: var(--spacing-md);
}

.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: var(--accent);
    border-radius: 50%;
    margin-right: 8px;
    position: relative;
}
.status-dot::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background-color: rgba(5, 150, 105, 0.7);
    animation: pulse-dot-composited 2s infinite;
}

@keyframes pulse-dot-composited {
    0% { transform: scale(0.95); opacity: 1; }
    70% { transform: scale(2.5); opacity: 0; }
    100% { transform: scale(0.95); opacity: 0; }
}

/* Modificatori per Status Dot (Eventi News) */
.status-dot.concluded {
    background-color: var(--text-muted);
}
.status-dot.concluded::after {
    display: none; /* Evento passato, nessuna pulsazione */
}
.status-dot.upcoming {
    background-color: #F59E0B; /* Ambra */
}
.status-dot.upcoming::after {
    background-color: rgba(245, 158, 11, 0.7);
}
/* 'active' o default usa var(--accent) (Verde) */

/* =========================================
   HEADER (Floating Pill)
========================================= */
#main-header {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translate(-50%, 20px);
    width: 95%;
    max-width: 1200px;
    z-index: 1000;
    padding: 10px 20px;
    transition: transform 0.4s var(--transition-bounce), box-shadow 0.4s var(--transition-bounce), background-color 0.4s var(--transition-bounce);
    will-change: transform;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: var(--glass-border);
    box-shadow: var(--shadow-soft);
    border-radius: var(--radius-pill);
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: var(--glass-border);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.8), 0 8px 30px rgba(10,37,64,0.06);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    transition: transform 0.4s var(--transition-bounce), box-shadow 0.4s var(--transition-bounce), border-color 0.4s var(--transition-bounce);
}
.glass-card:hover {
    transform: translateY(-8px);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.9), 0 20px 40px rgba(10,37,64,0.12);
    border-color: rgba(255,255,255,0.9);
}

#main-header.scrolled {
    box-shadow: var(--shadow-hover);
    padding: 8px 20px;
    background: rgba(255, 255, 255, 0.95);
    transform: translate(-50%, 15px);
}

.nav-container { display: flex; justify-content: space-between; align-items: center; }

.logo-placeholder a {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-heading);
    letter-spacing: -0.5px;
}
.logo-placeholder img { height: 40px !important; transition: transform 0.4s var(--transition-bounce); transform-origin: left center; }
#main-header.scrolled .logo-placeholder img { transform: scale(0.8); }

.main-nav { display: flex; }

.nav-links {
    display: flex;
    list-style: none;
    align-items: center;
    gap: 1.5rem;
}
@media (min-width: 1025px) and (max-width: 1150px) {
    .nav-links { gap: 0.8rem; }
    .nav-links a { font-size: 0.9rem !important; }
}
.nav-links a { color: var(--primary); font-weight: 600; font-size: 0.95rem; white-space: nowrap; }
.nav-links a:hover { color: var(--secondary); }
.nav-links .btn { color: #fff; padding: 8px 20px; font-size: 0.95rem; }
.nav-links .btn:hover { color: #fff; }
.nav-links .btn-outline { color: var(--primary); padding: 8px 20px; font-size: 0.95rem; }
.nav-links .btn-outline:hover { color: #fff; }

.mobile-menu-toggle {
    display: none;
    background: transparent;
    border: none;
    font-size: 1.8rem;
    color: var(--primary);
    cursor: pointer;
}

/* --- Hover Vertical Language Dropdown --- */
.lang-dropdown {
    position: relative;
    /* Rimuoviamo il margin extra, usa il gap di nav-links */
}
.lang-btn-main {
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    padding: 0;
    cursor: default;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary);
    transition: color 0.2s ease;
}
.lang-btn-main:hover {
    color: var(--secondary);
}
.lang-btn-main img {
    border-radius: 2px;
    object-fit: cover;
}
.lang-menu {
    position: absolute;
    top: 100%;
    right: 50%;
    transform: translateX(50%) translateY(10px);
    background: white;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 120px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 1001;
}
.lang-dropdown:hover .lang-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(50%) translateY(0);
}
.lang-menu button {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 12px;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: var(--font-body);
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    text-align: left;
    white-space: nowrap;
}
.lang-menu button img {
    border-radius: 2px;
    object-fit: cover;
}
.lang-menu button:hover { 
    background: rgba(10,37,64,0.04); 
    color: var(--primary);
}

/* =========================================
   HERO SECTION
========================================= */
.hero-section {
    padding-top: 120px;
    padding-bottom: 2.5rem;
    min-height: 85vh;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #F8F9FA 0%, #E9ECEF 100%);
    position: relative;
    overflow: hidden;
}


.hero-content {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 2.5rem;
    align-items: center;
    position: relative; z-index: 1;
}

.hero-text h1 {
    margin-bottom: var(--spacing-sm);
    color: var(--primary);
}
.hero-text .highlight { color: var(--secondary); }

.hero-text .lead {
    font-size: var(--fs-lead);
    font-weight: 400;
    color: var(--text-muted);
    margin-bottom: var(--spacing-lg);
    max-width: 500px;
}
.hero-cta { display: flex; gap: var(--spacing-md); }

.hero-image {
    position: relative;
    display: inline-block;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-hover);
}
.hero-image img {
    display: block;
    width: 100%;
    height: auto;
}
.hero-image::after {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 6px;
    background: linear-gradient(to right, #009246 0%, #009246 33.33%, #ffffff 33.33%, #ffffff 66.66%, #CE2B37 66.66%, #CE2B37 100%);
}

/* Placeholder Box */
.placeholder-box {
    background: rgba(10, 37, 64, 0.05);
    border: 2px dashed rgba(10, 37, 64, 0.2);
    border-radius: var(--radius-lg);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    height: 500px; width: 100%;
    color: var(--text-muted);
    font-family: var(--font-heading); font-weight: 600;
}
.placeholder-box i { font-size: 4rem; margin-bottom: 10px; color: rgba(10, 37, 64, 0.2); }
.placeholder-box.tall { height: 600px; }

/* =========================================
   COUNTDOWN
========================================= */
.countdown-section {
    padding: var(--spacing-md) 0;
    box-shadow: inset 0 5px 15px rgba(0,0,0,0.1);
}
.countdown-container {
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; gap: var(--spacing-md);
}
.countdown-text h2 { font-size: var(--fs-h3); color: #fff; margin-bottom: 0; }
.countdown-text p { font-size: var(--fs-lead); opacity: 0.8; }
.countdown-timer { display: flex; gap: 15px; }
.time-box {
    background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0.02) 100%);
    border: 1px solid rgba(255,255,255,0.15);
    border-top: 1px solid rgba(255,255,255,0.4);
    border-left: 1px solid rgba(255,255,255,0.3);
    border-radius: var(--radius-md);
    
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 85px;
    height: 85px;
    padding: 0;
    
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    color: #fff;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.time-box:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.25);
}
.time-value { 
    display: block; font-size: clamp(1.8rem, 4vw, 2.5rem); font-weight: 800; 
    font-family: var(--font-heading); line-height: 1; color: #fff; 
    text-shadow: 0 2px 8px rgba(0,0,0,0.3); 
}
.time-label { 
    display: block; font-size: 0.75rem; text-transform: uppercase; 
    letter-spacing: 1.5px; opacity: 0.85; margin-top: 8px; 
    color: #fff; font-weight: 600; 
}

/* =========================================
   CHI SONO
========================================= */
.about-grid {
    display: grid; grid-template-columns: 1fr 1.2fr;
    gap: 2.5rem; align-items: center; margin-top: 1.5rem;
}

.about-image img {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-hover);
    width: 100%; height: 100%; object-fit: cover;
}

.about-text h3 { margin-bottom: 1rem; }
.about-text p { margin-bottom: 1rem; color: var(--text-main); }

.about-features {
    list-style: none;
    display: flex; flex-direction: column; gap: 15px;
}
.about-features li { display: flex; align-items: flex-start; font-weight: 500; font-size: 1rem; color: var(--text-heading); }
.about-features .icon { color: var(--secondary); font-size: 1.4rem; margin-right: 10px; min-width: 1.4rem; height: 1.4rem; flex-shrink: 0; margin-top: 2px; }

/* =========================================
   PROGRAMMA (Cards)
========================================= */
.section-header { margin-bottom: 1.75rem; }
.section-header h2 { color: var(--text-heading); }
.section-header .subtitle { font-size: var(--fs-lead); color: var(--text-muted); margin-top: 6px; }

.grid { display: grid; gap: 1.25rem; }
.cards-grid { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

/* Override glass-card for program cards per renderle visibili su sfondo bianco */
.card.glass-card {
    background: rgba(255,255,255,0.98); /* Più opaco */
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    /* Ombra più profonda e netta per staccare dal fondo chiaro */
    box-shadow: 0 8px 24px rgba(10,37,64,0.08), 0 2px 8px rgba(10,37,64,0.04);
    /* Bordo scuro leggerissimo per delineare il contorno */
    border: 1px solid rgba(10, 37, 64, 0.08);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    position: relative; overflow: hidden;
}
.card.glass-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-hover); }
.card.glass-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transform: scaleX(0); transform-origin: left;
    transition: transform 0.4s ease;
}
.card.glass-card:hover::before { transform: scaleX(1); }

.card-icon {
    width: 56px; height: 56px;
    background: rgba(23, 67, 132, 0.08);
    border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.8rem; color: var(--primary);
    margin-bottom: 1rem;
    transition: transform 0.3s ease;
}
.glass-card:hover .card-icon { transform: scale(1.1); }

.read-more {
    display: inline-flex; align-items: center; gap: 5px;
    margin-top: var(--spacing-md); font-weight: 600;
}
.read-more:hover { gap: 10px; }

/* =========================================
   CANDIDATI
========================================= */
.candidates-grid {
    display: grid; grid-template-columns: repeat(8, 1fr);
    gap: 0.75rem; text-align: center;
}
@media (max-width: 1024px) { .candidates-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 576px) { .candidates-grid { grid-template-columns: repeat(2, 1fr); } }

.candidate-card { display: flex; flex-direction: column; align-items: center; transition: transform 0.3s ease; }
.candidate-card:hover { transform: translateY(-5px); }
.candidate-photo-placeholder {
    width: 100px; height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, #E9ECEF 0%, #F8F9FA 100%);
    border: 3px solid var(--primary);
    display: flex; align-items: center; justify-content: center;
    font-size: 3rem; color: #CED4DA;
    margin-bottom: 10px;
    box-shadow: var(--shadow-soft), inset 0 2px 4px rgba(0,0,0,0.06);
    overflow: hidden;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.candidate-photo-placeholder:hover {
    border-color: var(--secondary);
    box-shadow: var(--shadow-hover), inset 0 2px 4px rgba(0,0,0,0.06);
}
.candidate-card h3 { font-size: var(--fs-body); margin-bottom: 0; line-height: var(--lh-tight); color: var(--primary); }

/* =========================================
   NEWS
========================================= */
.news-grid { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.news-card {
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    border: 1px solid rgba(255,255,255,0.6);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}
.news-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.news-image-placeholder {
    height: 200px; background: #E9ECEF;
    display: flex; align-items: center; justify-content: center;
    font-size: 3rem; color: #CED4DA;
    position: relative;
}
.play-overlay {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.5);
    border-radius: 50%;
    width: 60px; height: 60px;
    display: flex; align-items: center; justify-content: center;
    backdrop-filter: blur(4px);
    border: 2px solid rgba(255,255,255,0.8);
    transition: all 0.3s ease;
    z-index: 2;
}
.news-card:hover .play-overlay {
    background: rgba(220, 38, 38, 0.9);
    transform: translate(-50%, -50%) scale(1.1);
    border-color: #fff;
}
.news-content { padding: var(--spacing-lg); }
.news-date { display: block; font-size: 0.85rem; color: var(--secondary); font-weight: 600; margin-bottom: 5px; }
.news-content h3 { font-size: var(--fs-h4); margin-bottom: 8px; line-height: var(--lh-tight); }
.news-content p { margin-top: 0; margin-bottom: 0; line-height: var(--lh-body); color: var(--text-muted); }

/* News Load More */
@media (min-width: 1025px) {
    .news-grid.collapsed .news-card:nth-child(n+7) {
        display: none;
    }
}
@media (max-width: 1024px) {
    .news-load-more {
        display: none !important;
    }
}

/* =========================================
   CONTATTI
========================================= */
.contact-grid {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 2.5rem; align-items: center;
}
.contact-item { display: flex; align-items: flex-start; gap: 15px; margin-bottom: 20px; }
.contact-item .icon { font-size: 1.8rem; color: #fff; background: rgba(255,255,255,0.15); padding: 10px; border-radius: 50%; width: 1em; height: 1em; box-sizing: content-box; }
.contact-item h3 { margin-bottom: 2px; color: #fff; }

.glass-card.dark {
    background: rgba(255,255,255,0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
}

.form-group { margin-bottom: var(--spacing-md); }
.form-group label { display: block; margin-bottom: 5px; font-size: 0.9rem; font-weight: 600; color: rgba(255,255,255,0.8); }
.contact-form input[type="text"], .contact-form textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: border-color 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
    background: rgba(255,255,255,0.1);
    color: white;
}
.contact-form input[type="text"]::placeholder, .contact-form textarea::placeholder {
    color: rgba(255,255,255,0.7);
}
.contact-form input[type="text"]:focus, .contact-form textarea:focus {
    outline: none;
    border-color: rgba(255,255,255,0.5);
    background: rgba(255,255,255,0.15);
    box-shadow: 0 0 0 4px rgba(255,255,255,0.1);
}
.form-check { display: flex; align-items: flex-start; gap: 10px; font-size: 0.85rem; color: rgba(255,255,255,0.7); margin-bottom: var(--spacing-md); line-height: 1.3; }
.form-check input[type="checkbox"] { margin-top: 3px; flex-shrink: 0; }

/* =========================================
   FOOTER
========================================= */
.site-footer {
    background-color: #051320;
    color: rgba(255,255,255,0.7);
    padding: 2.5rem 0 1rem;
    margin-top: -1px; /* Fix subpixel rendering gap */
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; }
.footer-brand h3 { color: #fff; margin-bottom: 10px; }
.social-links { margin-top: var(--spacing-md); display: flex; gap: 15px; }
.social-links a {
    color: #fff; font-size: 1.5rem;
    background: rgba(255,255,255,0.1);
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
}
.social-links a:hover { background: var(--secondary); }
.footer-links h3, .footer-legal h3 { color: #fff; margin-bottom: 15px; }
.footer-links ul, .footer-legal ul { list-style: none; }
.footer-links li, .footer-legal li { margin-bottom: 10px; }
.footer-links a, .footer-legal a { color: rgba(255,255,255,0.7); }
.footer-links a:hover { color: var(--secondary); }

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.08);
    padding-top: 1.25rem;
    margin-top: 2rem;
    font-size: 0.8rem;
}
.footer-bottom-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}
.footer-bottom-row p { color: rgba(255,255,255,0.7); }

/* --- Footer Language Selector (Premium Pills) --- */
.lang-selector-footer {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-pill);
    padding: 4px;
}
.lang-selector-footer > .icon {
    color: rgba(255,255,255,0.3);
    font-size: 0.9rem;
    margin: 0 4px 0 8px;
}
.lang-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    border: none;
    background: transparent;
    color: rgba(255,255,255,0.5);
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    font-family: var(--font-body);
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.25s ease, color 0.25s ease;
    letter-spacing: 0.02em;
}
.lang-pill img {
    border-radius: 2px;
    object-fit: cover;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}
.lang-pill:hover img, .lang-pill.active img {
    opacity: 1;
}
.lang-pill:hover {
    color: #fff;
    background: rgba(255,255,255,0.08);
}
.lang-pill.active {
    color: #fff;
    background: rgba(255,255,255,0.12);
}

/* --- Mobile Language Selector (Light Theme adaptation) --- */
.mobile-lang-selector {
    background: rgba(10, 37, 64, 0.04);
    border: 1px solid rgba(10, 37, 64, 0.08);
}
.mobile-lang-selector > .icon {
    color: rgba(10, 37, 64, 0.4);
}
.mobile-lang-selector .lang-pill {
    color: rgba(10, 37, 64, 0.6);
}
.mobile-lang-selector .lang-pill:hover {
    color: var(--primary);
    background: rgba(10, 37, 64, 0.06);
}
.mobile-lang-selector .lang-pill.active {
    color: var(--primary);
    background: rgba(10, 37, 64, 0.1);
    font-weight: 700;
}

@media (max-width: 1024px) {
    .desktop-only-item { display: none !important; }
}
@media (min-width: 1025px) {
    .mobile-only-item { display: none !important; }
}

/* =========================================
   RESPONSIVE
========================================= */
@media (max-width: 992px) {
    .hero-content, .about-grid, .contact-grid { grid-template-columns: 1fr; }
    .hero-content { padding-top: 2rem; }
    .hero-cta { flex-direction: column; }
    .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
}

@media (max-width: 1024px) {
    /* Ripristina Menu Top Classico (Hamburger) */
    .mobile-menu-toggle { display: block; margin-left: auto; }
    
    .main-nav {
        display: none;
        position: absolute;
        top: calc(100% + 10px); /* Stacca il menu dall'header a pillola */
        left: 0;
        width: 100%;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        box-shadow: 0 15px 30px rgba(0,0,0,0.1);
        padding: 1.5rem;
        border: 1px solid rgba(0,0,0,0.05);
        border-radius: var(--radius-lg); /* Arrotonda tutti gli angoli */
    }
    .main-nav.active {
        display: block;
        animation: fadeInDown 0.3s ease;
        max-height: 80vh;
        overflow-y: auto;
    }
    
    /* Permetti lo scroll ma usa una classe per tracciamento se necessario */
    body.no-scroll {
        /* overflow: hidden rimosso per permettere lo scroll del background come richiesto */
    }
    
    /* Overlay reale per menu mobile — elemento DOM, non pseudo-element */
    .menu-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100dvh; /* Usa dynamic viewport height per iOS Safari */
        background: rgba(10, 37, 64, 0.4);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        z-index: 990;
        pointer-events: auto;
    }
    .menu-overlay.active {
        display: block;
        animation: fadeIn 0.3s ease;
    }
    
    @keyframes fadeInDown {
        from { opacity: 0; transform: translateY(-10px); }
        to { opacity: 1; transform: translateY(0); }
    }
    @keyframes fadeIn {
        from { opacity: 0; }
        to { opacity: 1; }
    }

    .nav-links {
        flex-direction: column;
        gap: 0;
        align-items: flex-start;
    }
    .nav-links li { width: 100%; }
    .nav-links a { 
        display: block; width: 100%; padding: 12px 0; 
        border-bottom: 1px solid rgba(0,0,0,0.05);
        font-size: 1.1rem;
    }
    /* Rimuove la riga dall'ultimo elemento (il pulsante o il selettore lingua) e dall'elemento prima di esso se non ha il bordo */
    .nav-links li:last-child a, .nav-links li:nth-last-child(2) a:not(.btn) {
        border-bottom: none;
    }
    .nav-links .btn, .nav-links .btn-outline { 
        width: 100%; text-align: center; margin-top: 15px; border-bottom: none; 
    }
    
    body { padding-bottom: 0; } /* Rimosso padding per la bottom nav */
    
    /* Countdown Typography Mobile */
    .countdown-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 15px;
    }
    .countdown-text h2 {
        font-size: 1.25rem;
        line-height: 1.3;
        margin-bottom: 8px;
        text-wrap: pretty;
    }
    .countdown-text p {
        font-size: 0.95rem;
        line-height: 1.5;
        text-wrap: pretty;
    }
    .countdown-timer {
        justify-content: center;
        width: 100%;
    }
    
    /* Countdown Mobile Fix */
    .cards-grid, .news-grid {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        gap: 15px;
        padding-top: 30px;
        padding-bottom: 45px;
        margin-top: -30px;
        margin-bottom: -25px;
        margin-inline: calc(-1 * var(--spacing-lg));
        padding-inline: var(--spacing-lg);
        scroll-padding-inline: var(--spacing-lg);
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .cards-grid::-webkit-scrollbar, .news-grid::-webkit-scrollbar { display: none; }
    
    /* Misure per le card Programma e News (grandi) */
    .cards-grid .card, .news-grid .news-card {
        width: 82vw;
        min-width: 82vw;
        max-width: 82vw;
        scroll-snap-align: center;
        flex: 0 0 auto;
        white-space: normal;
    }
    /* La prima scheda si allinea al margine sinistro */
    .cards-grid .card:first-child, .news-grid .news-card:first-child {
        scroll-snap-align: start;
    }
    /* L'ultima scheda si allinea al margine destro */
    .cards-grid .card:last-child, .news-grid .news-card:last-child {
        scroll-snap-align: end;
    }
    
    /* Micro-interazioni Tattili (Haptic feel) */
    .btn:active, .program-card:active, .news-card:active {
        transform: scale(0.96) !important;
        transition: transform 0.1s !important;
    }

    .logo-placeholder a { font-size: 1.05rem; }
    .logo-placeholder img { height: 32px !important; }
    #main-header.scrolled .logo-placeholder img { height: 28px !important; }
    
    /* Bottoni Mobile */
    .btn { padding: 10px 24px; white-space: normal; text-align: center; }
    .btn .icon { min-width: 16px; margin-right: 0 !important; }
    .btn-primary { gap: 8px; }
    
    /* Contatti e Candidati */

    
    .placeholder-box { height: 300px; }
    .placeholder-box.tall { height: 400px; }

    /* Countdown Mobile Fix Extra */
    .countdown-timer { flex-wrap: wrap; justify-content: center; }
    .time-box { width: 70px; height: 70px; }
    .time-value { font-size: 1.5rem; }

    .footer-bottom-row {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 15px;
    }
    .lang-selector-footer { justify-content: center; }
}

/* =========================================
   SCROLL REVEAL ANIMATIONS
========================================= */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.34, 1.56, 0.64, 1), transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.reveal.active {
    opacity: 1;
    transform: translateY(0);
}
/* Hero è sempre visibile per non bloccare l'LCP */
.hero-text,
.hero-image {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
}

/* =========================================
   MOBILE FIXES (max-width: 768px)
========================================= */
@media (max-width: 768px) {
    /* Fix Badge wrapping */
    .badge {
        font-size: 0.65rem;
        padding: 4px 8px;
        letter-spacing: 0.5px;
        white-space: nowrap;
    }

    /* Fix Countdown overflow */
    .countdown-timer {
        gap: 8px;
        justify-content: center;
        width: 100%;
        flex-wrap: nowrap;
    }
    .time-box {
        flex: 1;
        aspect-ratio: 1;
        width: auto;
        height: auto;
    }
    .time-value {
        font-size: 1.6rem;
    }
    .time-label {
        font-size: 0.65rem;
        letter-spacing: 0.5px;
        margin-top: 4px;
    }
}

/* =========================================
   PAGINE LEGALI (Privacy & Cookie Policy)
========================================= */
.legal-content {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: var(--glass-border);
    padding: var(--spacing-xl);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    margin-bottom: var(--spacing-xl);
    margin-top: 120px; /* Padding top for the fixed header */
}
.legal-content h2 { color: var(--primary); margin-bottom: 1.5rem; font-size: var(--fs-h2); }
.legal-content h3 { color: var(--primary-light); margin-top: 2.5rem; margin-bottom: 1rem; font-size: var(--fs-h3); }
.legal-content p, .legal-content ul { margin-bottom: 1.2rem; color: var(--text-main); line-height: var(--lh-body); font-size: var(--fs-body); }
.legal-content ul { padding-left: 1.5rem; }
.legal-content li { margin-bottom: 0.5rem; }
