@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Outfit:wght@400;600;800;900&display=swap');

:root {
  --primary: #111d53;      /* Blue Lega Main */
  --primary-light: #0b4076; /* Blue Lega Light */
  --primary-gradient: linear-gradient(135deg, var(--primary), var(--primary-light));
  --accent: #ffcc00;       /* Yellow Lega */
  --accent-light: #ffdb4d;
  --bg-body: #f8fafc;      /* Very light slate */
  --surface: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 40px;
  
  --shadow-xs: 0 2px 8px rgba(0,0,0,0.04);
  --shadow-sm: 0 4px 16px rgba(0,0,0,0.06);
  --shadow-md: 0 12px 32px rgba(10,28,64,0.08);
  --shadow-lg: 0 24px 48px rgba(10,28,64,0.12);
  
  --transition: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 { font-family: 'Outfit', sans-serif; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; height: auto; display: block; }

/* UTILS */
.container {
  width: 90%;
  max-width: 1280px;
  margin: 0 auto;
}
.section-pad { padding: 8rem 0; }
.reveal { opacity: 0; transform: translateY(30px); transition: all 0.8s var(--transition); }
.reveal.active { opacity: 1; transform: translateY(0); }

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.75rem;
  font-weight: 600;
  border-radius: var(--radius-xl);
  transition: all 0.3s ease;
  cursor: pointer;
  border: none;
}
.btn-primary { background: var(--primary-gradient); color: white; }
.btn-primary:hover { background: var(--primary-light); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn-accent { background: var(--accent); color: var(--primary); }
.btn-accent:hover { background: var(--accent-light); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(242,169,0,0.3); }

/* HEADER */
.header {
  position: fixed;
  top: 0; left: 0; width: 100%;
  height: 64px;
  z-index: 1000;
  background: white;
  box-shadow: var(--shadow-sm);
}
.header .container { display: flex; align-items: center; justify-content: flex-end; height: 100%; position: relative; }

.logo { 
  position: absolute; 
  left: 0; 
  top: 10px; 
  background: white;
  padding: 6px;
  border-radius: 50%;
  box-shadow: var(--shadow-xs);
  display: flex;
  align-items: center;
  justify-content: center;
}
.logo img { height: 90px; width: auto; transition: transform 0.3s ease; }
.logo img:hover { transform: scale(1.05); }

.nav-links { display: flex; align-items: center; gap: 2.5rem; transition: 0.3s; }
.nav-link { font-weight: 700; font-size: 0.9rem; color: var(--text-main); text-transform: uppercase; letter-spacing: 0.05em; transition: 0.2s; }
.nav-link:hover, .nav-link.active { color: var(--accent); }

/* Mobile Menu Button */
.mobile-menu-btn {
  display: none;
  background: transparent;
  border: none;
  color: var(--primary);
  cursor: pointer;
  z-index: 1001;
}
.mobile-menu-btn svg { width: 32px; height: 32px; }

/* HERO IMAGE ONLY */
.hero-image-only {
  width: 100%;
  margin-top: 64px; /* Matches slim header height */
  position: relative;
  overflow: hidden;
}
.hero-image-only img {
  width: 100%;
  height: 85vh;
  object-fit: cover;
  object-position: center;
}

/* SLOGAN BAND */
.slogan-band { background: var(--primary-gradient); color: white; overflow: hidden; }
.slogan-container { display: flex; align-items: center; gap: 4rem; flex-wrap: wrap; }
.slogan-img { flex: 1; min-width: 300px; }
.slogan-img img { width: 100%; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.slogan-text { flex: 1; min-width: 300px; padding-right: 2rem; }
.slogan-text h2 { color: var(--accent); margin-bottom: 1.5rem; font-size: 2.5rem; font-family: 'Outfit', sans-serif; }
.slogan-text p { font-size: 1.15rem; line-height: 1.8; color: rgba(255,255,255,0.9); }

/* BENTO PROGRAM GRID */
.program-section { background: var(--bg-body); }
.section-header { text-align: center; margin-bottom: 4rem; }
.section-header h2 { font-size: clamp(2.5rem, 4vw, 3.5rem); color: var(--primary); font-weight: 800; line-height: 1.2; }
.section-header p { font-size: 1.1rem; color: var(--text-muted); margin-top: 1rem; }

/* TABBED PROGRAM INTERFACE */
.program-tabs-container {
  display: flex;
  background: var(--surface);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  margin-top: 2rem;
  border: 1px solid rgba(0,0,0,0.03);
}

.tab-sidebar {
  width: 35%;
  background: var(--bg-body);
  padding: 2rem 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(0,0,0,0.05);
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  padding: 1.25rem 2rem;
  text-align: left;
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.tab-btn:hover {
  background: rgba(10,28,64,0.03);
  color: var(--primary);
}

.tab-btn.active {
  background: white;
  color: var(--primary);
  box-shadow: -4px 0 0 inset var(--accent);
}

.tab-icon {
  font-size: 1.5rem;
  filter: grayscale(100%);
  opacity: 0.6;
  transition: all 0.3s ease;
}

.tab-btn.active .tab-icon {
  filter: grayscale(0%);
  opacity: 1;
  transform: scale(1.1);
}

.tab-content-area {
  width: 65%;
  padding: 4rem;
  position: relative;
}

.tab-panel {
  display: none;
  animation: fadeIn 0.5s ease;
}

.tab-panel.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

.panel-header {
  position: relative;
  margin-bottom: 2rem;
}

.panel-num {
  font-size: 6rem;
  font-weight: 900;
  color: rgba(10,28,64,0.04);
  font-family: 'Outfit', sans-serif;
  position: absolute;
  top: -40px;
  left: -20px;
  z-index: 0;
  line-height: 1;
}

.panel-texts {
  position: relative;
  z-index: 1;
}

.panel-texts h3 {
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--primary);
  margin-bottom: 0.5rem;
  line-height: 1.1;
}

.panel-texts h4 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1.5rem;
}

.panel-body p {
  font-size: 1.1rem;
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 1rem;
}

/* CANDIDATES PAGE */
.page-hero { padding: 12rem 0 6rem; background: var(--primary-gradient); color: white; text-align: center; }
.page-hero h1 { font-size: clamp(3rem, 5vw, 4.5rem); margin-bottom: 1rem; }
.page-hero h1 span { color: var(--accent); }
.page-hero p { font-size: 1.15rem; color: rgba(255,255,255,0.7); max-width: 600px; margin: 0 auto; }

.filters { display: flex; justify-content: space-between; align-items: center; margin-bottom: 3rem; background: white; padding: 1rem 2rem; border-radius: var(--radius-xl); box-shadow: var(--shadow-xs); }
.search-input { border: none; outline: none; padding: 0.5rem 1rem; font-family: inherit; font-size: 1rem; width: 300px; background: var(--bg-body); border-radius: var(--radius-md); }

.candidates-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 2rem; }

.cand-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  box-shadow: var(--shadow-xs);
  transition: all var(--transition);
  border: 1px solid transparent;
}
.cand-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); border-color: rgba(17,29,83,0.1); }
.cand-card:hover .cand-photo { transform: scale(1.05); }

.cand-photo-wrapper {
  position: relative;
  width: 220px;
  height: 250px;
  margin: 0 auto 1.5rem; /* Centered in card */
}

.cand-photo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: bottom center;
  transition: transform 0.3s ease;
  filter: drop-shadow(2px 5px 8px rgba(0,0,0,0.15));
}

.cand-card h3 { font-size: 1.25rem; color: var(--primary); margin-bottom: 0.25rem; }
.cand-card .role { font-size: 0.85rem; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0; }

/* CONTACT FORM "DILLO ALLA LEGA" */
.contact-section { background: var(--bg-body); border-top: 1px solid rgba(0,0,0,0.05); }
.form-container { max-width: 700px; margin: 0 auto; background: var(--surface); padding: 3rem; border-radius: var(--radius-xl); box-shadow: var(--shadow-sm); border: 1px solid rgba(0,0,0,0.03); }
.form-header { text-align: center; margin-bottom: 2rem; }
.form-header h2 { font-size: 2.5rem; color: var(--primary); font-weight: 900; margin-bottom: 0.5rem; text-transform: uppercase; }
.form-header p { color: var(--text-muted); font-size: 1.05rem; }
.contact-form { display: flex; flex-direction: column; gap: 1.5rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.input-group { display: flex; flex-direction: column; gap: 0.5rem; }
.input-group label { font-size: 0.9rem; font-weight: 600; color: var(--primary); }
.input-group input, .input-group textarea { padding: 1rem; border: 1px solid rgba(0,0,0,0.1); border-radius: var(--radius-sm); font-family: inherit; font-size: 1rem; transition: 0.3s; background: var(--bg-body); }
.input-group input:focus, .input-group textarea:focus { outline: none; border-color: var(--accent); background: white; box-shadow: 0 0 0 4px rgba(255,204,0,0.1); }
.checkbox-group { flex-direction: row; align-items: center; gap: 0.75rem; }
.checkbox-group input { width: 18px; height: 18px; cursor: pointer; }
.checkbox-group label { font-size: 0.85rem; font-weight: 400; color: var(--text-muted); cursor: pointer; }

/* COMPACT FOOTER */
.footer { background: var(--text-main); color: white; padding: 2rem 0; font-size: 0.9rem; }
.footer-compact { display: flex; flex-direction: column; gap: 1.5rem; }
.footer-row-1 { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 1.5rem; }
.footer-logo-small { height: 50px; opacity: 0.9; }
.footer-links-small { display: flex; gap: 1.5rem; font-weight: 500; }
.footer-links-small a { color: rgba(255,255,255,0.7); transition: 0.2s; }
.footer-links-small a:hover { color: var(--accent); }
.footer-row-2 { display: flex; align-items: center; justify-content: space-between; color: rgba(255,255,255,0.4); font-size: 0.8rem; }
.footer-timone { width: 30px; opacity: 0.2; }

/* SCROLLING MARQUEE CANDIDATES */
.marquee-wrapper {
  overflow: hidden;
  position: relative;
  width: 100%;
  white-space: nowrap;
  padding: 1rem 0;
}
.marquee-track {
  display: inline-flex;
  gap: 2rem;
  animation: scroll-left 40s linear infinite;
  padding-left: 2rem;
}
.marquee-track:hover { animation-play-state: paused; }
@keyframes scroll-left {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); } /* Requires the elements to be duplicated */
}
.marquee-card {
  background: var(--surface);
  border: 1px solid rgba(0,0,0,0.05);
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 200px;
}
.marquee-card h4 { font-size: 1.1rem; color: var(--primary); margin-bottom: 0.25rem; font-family: 'Inter', sans-serif;}
.marquee-card span { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; font-weight: 600; }

/* MOBILE & TABLET OPTIMIZATION */
@media (max-width: 900px) {
  /* Layout Spacing */
  .section-pad { padding: 4rem 0; }
  
  /* Header */
  .hero-image-only { margin-top: 64px; }
  .hero-image-only img { height: 60vh; }
  .logo { top: 0; padding: 4px; box-shadow: none; border-radius: 0; }
  .logo img { height: 50px; margin-top: 4px; }
  .mobile-menu-btn { display: block; }
  .nav-links { 
    position: fixed; top: 64px; right: -100%; width: 250px; height: calc(100vh - 64px);
    background: white; flex-direction: column; align-items: flex-start; padding: 2rem;
    box-shadow: -5px 0 15px rgba(0,0,0,0.05);
  }
  .nav-links.open { right: 0; }
  
  /* Slogan */
  .slogan-container { flex-direction: column; text-align: center; gap: 2rem; }
  .slogan-text { padding-right: 0; }
  .slogan-text h2 { font-size: 2rem; }
  .slogan-text p { font-size: 1rem; }
  
  /* Program Tabs */
  .program-tabs-container { flex-direction: column; }
  .tab-sidebar { width: 100%; padding: 1rem; display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; border-right: none; border-bottom: 1px solid rgba(0,0,0,0.05); }
  .tab-btn { padding: 0.75rem 0.5rem; font-size: 0.85rem; justify-content: center; text-align: center; flex-direction: column; gap: 0.25rem; border-radius: var(--radius-sm); }
  .tab-btn.active { box-shadow: 0 4px 0 inset var(--accent); border-bottom: none; }
  .tab-content-area { width: 100%; padding: 1.5rem; }
  .panel-header { margin-bottom: 1rem; }
  .panel-num { font-size: 3.5rem; top: -15px; left: -10px; }
  .panel-texts h3 { font-size: 1.4rem; }
  .panel-texts h4 { font-size: 0.9rem; margin-bottom: 1rem; }
  .panel-body p { font-size: 1rem; }

  /* Candidates Page */
  .page-hero { padding: 8rem 0 3rem; }
  .page-hero h1 { font-size: 2.5rem; }
  .filters { flex-direction: column; gap: 1rem; align-items: stretch; }
  .search-input { width: 100%; }
  
  .candidates-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 1rem; }
  .cand-card { padding: 1.5rem 1rem; }
  .cand-photo-wrapper { width: 160px; height: 190px; }
  .cand-card h3 { font-size: 1rem; }
  .cand-card .role { font-size: 0.75rem; margin-bottom: 0; }

  /* Contact & Footer */
  .form-container { padding: 2rem 1.5rem; }
  .form-row { grid-template-columns: 1fr; gap: 1.5rem; }
  .footer-row-1 { flex-direction: column; gap: 1.5rem; text-align: center; }
  .footer-links-small { flex-direction: column; gap: 0.75rem; }
  .footer-row-2 { flex-direction: column-reverse; gap: 1rem; text-align: center; }
}
