
/* ==========================================================================
   SUBPAGES & MODULAR COMPONENTS STYLESHEET
   Supports: comuni.html, fusione.html, dati.html, simulatore.html,
   previsioni.html, progetti.html, link.html, trasparenza.html
   ========================================================================== */

/* 1. Header & Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(3, 7, 18, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(0, 229, 255, 0.18);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  transition: var(--transition);
}
.site-header.scrolled {
  background: rgba(3, 7, 18, 0.98);
  box-shadow: 0 8px 30px rgba(0, 229, 255, 0.15);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
}
.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}
.logo-img {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--neon-cyan);
  box-shadow: var(--glow-cyan);
}
.brand-text {
  display: flex;
  flex-direction: column;
}
.brand-title {
  font-family: 'Cinzel', serif;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 1.5px;
  background: var(--rainbow-linear);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.brand-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: 'Inter', sans-serif;
  letter-spacing: 0.5px;
}
.nav-menu {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 6px;
  transition: var(--transition);
}
.nav-link:hover, .nav-link.active {
  color: #fff;
  background: rgba(0, 229, 255, 0.12);
  border: 1px solid rgba(0, 229, 255, 0.35);
  box-shadow: var(--glow-cyan);
}
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
}

/* 2. Layout & Page Hero */
.page-container {
  padding: 40px 20px 80px 20px;
  max-width: 1300px;
  margin: 0 auto;
}
.page-hero {
  padding: 30px 10px 45px 10px;
}
.neon-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 800;
  margin-bottom: 16px;
  letter-spacing: 0.5px;
}
.hero-lead {
  font-size: 1.1rem;
  line-height: 1.65;
  color: #cbd5e1;
}
.max-800 { max-width: 800px; }
.max-600 { max-width: 600px; }
.mx-auto { margin-left: auto; margin-right: auto; }

.section-title-wrap {
  margin: 40px 0 24px 0;
}
.section-title {
  font-family: 'Cinzel', serif;
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: 1px;
}
.section-sub {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* 3. Comuni Cards & Badges */
.comuni-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 24px;
}
.comuni-grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}
.comuni-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 20px;
}
.comune-card-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}
.stemma-lg {
  width: 68px;
  height: 80px;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.6));
}
.stemma-md {
  width: 50px;
  height: 60px;
  object-fit: contain;
  filter: drop-shadow(0 3px 8px rgba(0,0,0,0.5));
}
.card-metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 16px 0;
  background: rgba(0, 0, 0, 0.35);
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.metric-box {
  display: flex;
  flex-direction: column;
}
.m-val {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  font-family: 'Inter', sans-serif;
}
.m-lbl {
  font-size: 0.72rem;
  color: var(--text-muted);
}
.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 14px 0;
}
.tag {
  background: rgba(255, 255, 255, 0.07);
  color: #e2e8f0;
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.card-footer-action {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

/* 4. Reasons Grid & Cards */
.reasons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 22px;
}
.icon-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-bottom: 14px;
}
.icon-red { background: rgba(255, 0, 85, 0.15); color: var(--neon-red); border: 1px solid var(--neon-red); }
.icon-orange { background: rgba(255, 119, 0, 0.15); color: var(--neon-orange); border: 1px solid var(--neon-orange); }
.icon-yellow { background: rgba(255, 234, 0, 0.15); color: var(--neon-yellow); border: 1px solid var(--neon-yellow); }
.icon-green { background: rgba(0, 230, 118, 0.15); color: var(--neon-green); border: 1px solid var(--neon-green); }
.icon-cyan { background: rgba(0, 229, 255, 0.15); color: var(--neon-cyan); border: 1px solid var(--neon-cyan); }
.icon-violet { background: rgba(213, 0, 249, 0.15); color: var(--neon-violet); border: 1px solid var(--neon-violet); }

/* 5. Tables */
.table-responsive {
  overflow-x: auto;
  border-radius: var(--radius-md);
  margin-top: 16px;
}
.table-delta {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.92rem;
}
.table-delta th {
  background: rgba(0, 229, 255, 0.08);
  color: var(--neon-cyan);
  padding: 14px 18px;
  font-weight: 600;
  border-bottom: 2px solid rgba(0, 229, 255, 0.25);
  white-space: nowrap;
}
.table-delta td {
  padding: 12px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: #f1f5f9;
}
.table-delta tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}
.table-delta tr.highlight-row {
  background: rgba(0, 229, 255, 0.05);
  border-left: 3px solid var(--neon-cyan);
}

/* 6. Stepper & Timeline */
.timeline-stepper {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-top: 20px;
}
.step-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 18px;
  position: relative;
  transition: var(--transition);
}
.step-card:hover {
  border-color: var(--neon-cyan);
  box-shadow: var(--glow-cyan);
  transform: translateY(-4px);
}
.step-card.highlight {
  border-color: var(--neon-yellow);
  box-shadow: var(--glow-yellow);
  background: rgba(255, 234, 0, 0.06);
}
.step-num {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--neon-cyan);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
}

/* 7. Simulator Elements */
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}
.cb-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.04);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: var(--transition);
}
.cb-item:hover {
  border-color: var(--neon-cyan);
  background: rgba(0, 229, 255, 0.06);
}
.sim-checkbox {
  width: 18px;
  height: 18px;
  accent-color: var(--neon-cyan);
  cursor: pointer;
}
.cb-info {
  display: flex;
  flex-direction: column;
}
.cb-info small { color: var(--text-muted); }

.sim-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-top: 24px;
}
.card-metric-val {
  font-size: 1.85rem;
  font-weight: 800;
  display: block;
  margin: 8px 0 4px 0;
  font-family: 'Cinzel', serif;
}
.card-metric-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}
.formula-box {
  background: #020617;
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--neon-cyan);
  font-family: monospace;
  color: #38bdf8;
  overflow-x: auto;
}

/* 8. Scarcity & Countdown */
.scarcity-card {
  padding: 30px;
  border-radius: var(--radius-lg);
  background: radial-gradient(circle at center, rgba(255, 0, 85, 0.12) 0%, rgba(3, 7, 18, 0.95) 75%);
}
.countdown-timer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  font-size: 1.8rem;
  margin-top: 16px;
}
.time-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(0, 0, 0, 0.6);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 0, 85, 0.35);
  box-shadow: var(--glow-red);
}
.time-block strong { font-size: 2rem; color: #fff; line-height: 1; }
.time-block small { font-size: 0.72rem; color: var(--neon-red); text-transform: uppercase; }

/* 9. Directory Links */
.search-box-wrap {
  position: relative;
}
.input-icon-group {
  position: relative;
  display: flex;
  align-items: center;
}
.input-icon-group i {
  position: absolute;
  left: 18px;
  color: var(--neon-cyan);
}
.input-neon {
  width: 100%;
  padding: 14px 18px 14px 48px;
  background: rgba(8, 17, 34, 0.85);
  border: 1px solid rgba(0, 229, 255, 0.35);
  border-radius: 30px;
  color: #fff;
  font-size: 1rem;
  outline: none;
  box-shadow: var(--glow-cyan);
  transition: var(--transition);
}
.input-neon:focus {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 25px rgba(0, 229, 255, 0.5);
}
.link-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}
.link-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: var(--radius-md);
  text-decoration: none;
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: var(--transition);
}
.link-card:hover {
  transform: translateY(-3px);
  border-color: var(--neon-cyan);
  box-shadow: var(--glow-cyan);
}
.lc-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--neon-cyan);
  flex-shrink: 0;
}
.lc-info h4 {
  font-size: 0.95rem;
  color: #fff;
  margin-bottom: 2px;
}
.lc-info p {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.lc-url {
  font-size: 0.72rem;
  color: var(--neon-cyan);
  font-family: monospace;
}

/* 10. Footer */
.site-footer {
  background: #02040a;
  border-top: 1px solid rgba(0, 229, 255, 0.15);
  padding: 60px 0 20px 0;
  margin-top: 80px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 40px;
}
.footer-logo .logo-img {
  width: 40px;
  height: 40px;
}
.footer-desc {
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text-muted);
  margin: 14px 0;
}
.footer-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.footer-title {
  color: #fff;
  font-size: 1rem;
  margin-bottom: 16px;
  font-family: 'Cinzel', serif;
  letter-spacing: 0.5px;
}
.footer-links {
  list-style: none;
  padding: 0;
}
.footer-links li {
  margin-bottom: 10px;
}
.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  transition: var(--transition);
}
.footer-links a:hover {
  color: var(--neon-cyan);
  padding-left: 4px;
}
.footer-text {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 10px;
  line-height: 1.5;
}
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  margin-top: 40px;
  padding-top: 20px;
}
.footer-bottom-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.78rem;
  color: var(--text-dim);
}
.footer-meta-links a {
  color: var(--text-muted);
  text-decoration: none;
}
.footer-meta-links a:hover {
  color: #fff;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 768px) {
  .nav-menu {
    display: none;
  }
  .nav-toggle {
    display: block;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
}


/* KPI Cards & Grid */
.grid-4-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px;
}
.kpi-card {
  background: rgba(8, 17, 34, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.kpi-card:hover {
  transform: translateY(-4px);
  border-color: var(--neon-cyan);
  box-shadow: 0 8px 25px rgba(0, 229, 255, 0.25);
}
.kpi-val {
  font-family: 'Cinzel', serif;
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 8px;
}
.kpi-lbl {
  font-size: 0.88rem;
  font-weight: 600;
  color: #f1f5f9;
  margin-bottom: 4px;
}
