/* ==========================================================================
   CITTÀ DEL DELTA · PWA PORTAL DESIGN SYSTEM
   THE 7 RAINBOW NEON COLORS & GLOW EFFECTS
   1. Red (#ff0055)    2. Orange (#ff7700)   3. Yellow (#ffea00)
   4. Green (#00e676)  5. Cyan (#00e5ff)     6. Blue (#2979ff)
   7. Violet/Magenta (#d500f9)
   ========================================================================== */

:root {
  /* I 7 COLORI NEON DELL'ARCOBALENO */
  --neon-red: #ff0055;
  --neon-orange: #ff7700;
  --neon-yellow: #ffea00;
  --neon-green: #00e676;
  --neon-cyan: #00e5ff;
  --neon-blue: #2979ff;
  --neon-violet: #d500f9;
  --neon-magenta: #e040fb;

  /* BASE PALETTE */
  --bg-dark: #030712;
  --bg-card: rgba(8, 17, 34, 0.78);
  --bg-card-hover: rgba(12, 26, 52, 0.88);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  /* RAINBOW GRADIENTS */
  --rainbow-linear: linear-gradient(90deg, #ff0055 0%, #ff7700 16%, #ffea00 33%, #00e676 50%, #00e5ff 66%, #2979ff 83%, #d500f9 100%);
  --rainbow-linear-135: linear-gradient(135deg, #ff0055 0%, #ff7700 16%, #ffea00 33%, #00e676 50%, #00e5ff 66%, #2979ff 83%, #d500f9 100%);
  
  /* NEON GLOW SHADOWS */
  --glow-cyan: 0 0 15px rgba(0, 229, 255, 0.35), 0 0 30px rgba(0, 229, 255, 0.15);
  --glow-green: 0 0 15px rgba(0, 230, 118, 0.35), 0 0 30px rgba(0, 230, 118, 0.15);
  --glow-yellow: 0 0 15px rgba(255, 234, 0, 0.35), 0 0 30px rgba(255, 234, 0, 0.15);
  --glow-orange: 0 0 15px rgba(255, 119, 0, 0.35), 0 0 30px rgba(255, 119, 0, 0.15);
  --glow-red: 0 0 15px rgba(255, 0, 85, 0.35), 0 0 30px rgba(255, 0, 85, 0.15);
  --glow-blue: 0 0 15px rgba(41, 121, 255, 0.35), 0 0 30px rgba(41, 121, 255, 0.15);
  --glow-violet: 0 0 15px rgba(213, 0, 249, 0.35), 0 0 30px rgba(213, 0, 249, 0.15);
  --glow-rainbow: 0 0 20px rgba(0, 229, 255, 0.3), 0 0 40px rgba(213, 0, 249, 0.2);

  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 8px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  background: var(--bg-dark);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
}

/* ==========================================================================
   SFONDI DINAMICI & AMBIENT RAINBOW GLOW
   ========================================================================== */
.dynamic-bg-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.bg-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transform: scale(1.04);
  transition: opacity 2s ease-in-out, transform 8s ease-out;
  filter: brightness(0.4) saturate(1.2);
}

.bg-slide.active {
  opacity: 1;
  transform: scale(1);
}

.bg-overlay-glass {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at top right, rgba(0, 229, 255, 0.08), transparent 50%),
              radial-gradient(circle at bottom left, rgba(213, 0, 249, 0.08), transparent 50%),
              linear-gradient(180deg, rgba(3, 7, 18, 0.7) 0%, rgba(3, 7, 18, 0.9) 60%, rgba(3, 7, 18, 0.98) 100%);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.rainbow-ambient-glow {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80vw;
  height: 300px;
  background: radial-gradient(ellipse at top, rgba(0, 229, 255, 0.15) 0%, rgba(213, 0, 249, 0.1) 40%, transparent 70%);
  filter: blur(60px);
  pointer-events: none;
}

/* ==========================================================================
   TOP APPBAR ISTITUZIONALE
   ========================================================================== */
.top-appbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(3, 7, 18, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0, 229, 255, 0.2);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.6);
}

.appbar-inner {
  max-width: 1380px;
  margin: 0 auto;
  padding: 0.8rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  text-decoration: none;
}

.brand-logo-glow {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  padding: 2px;
  background: var(--rainbow-linear);
  box-shadow: var(--glow-rainbow);
}

.brand-logo-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.brand-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #fff;
  line-height: 1.1;
}

.brand-claim {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
}

/* SCARCITY COUNTDOWN */
.top-scarcity-box {
  background: rgba(255, 0, 85, 0.1);
  border: 1px solid rgba(255, 0, 85, 0.35);
  box-shadow: var(--glow-red);
  padding: 0.4rem 1rem;
  border-radius: 50px;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 0.82rem;
}

.scarcity-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: #fca5a5;
  font-weight: 600;
}

.scarcity-countdown {
  display: flex;
  gap: 0.4rem;
  color: #fff;
  font-family: monospace;
  font-weight: 700;
}

.sc-block strong {
  color: var(--neon-yellow);
}

.top-status-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(0, 230, 118, 0.12);
  border: 1px solid rgba(0, 230, 118, 0.4);
  padding: 0.35rem 0.9rem;
  border-radius: 50px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--neon-green);
  box-shadow: var(--glow-green);
}

/* DESKTOP NAV TABS */
.desktop-nav-tabs {
  max-width: 1380px;
  margin: 0 auto;
  padding: 0.3rem 1.5rem 0.6rem;
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.desktop-nav-tabs::-webkit-scrollbar {
  display: none;
}

.nav-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 50px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
  transition: var(--transition);
}

.nav-tab-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.nav-tab-btn.active {
  color: #fff;
  background: rgba(0, 229, 255, 0.15);
  border: 1px solid var(--neon-cyan);
  box-shadow: var(--glow-cyan);
}

/* ==========================================================================
   NEON CARD SYSTEM & 7 RAINBOW COLORS
   ========================================================================== */
.neon-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 2rem;
  transition: var(--transition);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  position: relative;
  overflow: hidden;
}

.neon-card:hover {
  transform: translateY(-3px);
  background: var(--bg-card-hover);
}

/* BORDER NEON VARIATIONS */
.neon-border-rainbow {
  border: 1px solid rgba(0, 229, 255, 0.3);
  position: relative;
}

.neon-border-rainbow::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--rainbow-linear);
  box-shadow: var(--glow-rainbow);
}

.neon-border-cyan { border-color: rgba(0, 229, 255, 0.4); box-shadow: var(--glow-cyan); }
.neon-border-green { border-color: rgba(0, 230, 118, 0.4); box-shadow: var(--glow-green); }
.neon-border-yellow { border-color: rgba(255, 234, 0, 0.4); box-shadow: var(--glow-yellow); }
.neon-border-gold { border-color: rgba(255, 214, 0, 0.5); box-shadow: 0 0 15px rgba(255, 214, 0, 0.3); }
.neon-border-orange { border-color: rgba(255, 119, 0, 0.4); box-shadow: var(--glow-orange); }
.neon-border-red { border-color: rgba(255, 0, 85, 0.4); box-shadow: var(--glow-red); }
.neon-border-blue { border-color: rgba(41, 121, 255, 0.4); box-shadow: var(--glow-blue); }
.neon-border-magenta { border-color: rgba(213, 0, 249, 0.4); box-shadow: var(--glow-violet); }

/* NEON TEXT COLORS */
.neon-text-rainbow {
  background: var(--rainbow-linear);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
  font-weight: 800;
}

.neon-text-red { color: var(--neon-red); text-shadow: 0 0 10px rgba(255, 0, 85, 0.5); }
.neon-text-orange { color: var(--neon-orange); text-shadow: 0 0 10px rgba(255, 119, 0, 0.5); }
.neon-text-yellow { color: var(--neon-yellow); text-shadow: 0 0 10px rgba(255, 234, 0, 0.5); }
.neon-text-green { color: var(--neon-green); text-shadow: 0 0 10px rgba(0, 230, 118, 0.5); }
.neon-text-cyan { color: var(--neon-cyan); text-shadow: 0 0 10px rgba(0, 229, 255, 0.5); }
.neon-text-blue { color: var(--neon-blue); text-shadow: 0 0 10px rgba(41, 121, 255, 0.5); }
.neon-text-magenta { color: var(--neon-magenta); text-shadow: 0 0 10px rgba(224, 64, 251, 0.5); }

/* NEON BACKGROUNDS */
.neon-bg-red { background: var(--neon-red) !important; color: #fff; }
.neon-bg-orange { background: var(--neon-orange) !important; color: #fff; }
.neon-bg-yellow { background: var(--neon-yellow) !important; color: #000; }
.neon-bg-green { background: var(--neon-green) !important; color: #000; }
.neon-bg-cyan { background: var(--neon-cyan) !important; color: #000; }
.neon-bg-blue { background: var(--neon-blue) !important; color: #fff; }
.neon-bg-magenta { background: var(--neon-magenta) !important; color: #fff; }

/* NEON BOX HIGHLIGHTS */
.neon-box-cyan { background: rgba(0, 229, 255, 0.08); border: 1px solid rgba(0, 229, 255, 0.3); border-radius: var(--radius-md); }
.neon-box-green { background: rgba(0, 230, 118, 0.08); border: 1px solid rgba(0, 230, 118, 0.3); border-radius: var(--radius-md); }
.neon-box-yellow { background: rgba(255, 234, 0, 0.08); border: 1px solid rgba(255, 234, 0, 0.3); border-radius: var(--radius-md); }
.neon-box-orange { background: rgba(255, 119, 0, 0.08); border: 1px solid rgba(255, 119, 0, 0.3); border-radius: var(--radius-md); }
.neon-box-blue { background: rgba(41, 121, 255, 0.08); border: 1px solid rgba(41, 121, 255, 0.3); border-radius: var(--radius-md); }
.neon-box-magenta { background: rgba(213, 0, 249, 0.08); border: 1px solid rgba(213, 0, 249, 0.3); border-radius: var(--radius-md); }

/* PULSE DOTS */
.pulse-neon-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  animation: pulseNeon 1.8s infinite;
}

@keyframes pulseNeon {
  0% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(0, 229, 255, 0.7); }
  70% { transform: scale(1.2); box-shadow: 0 0 0 8px rgba(0, 229, 255, 0); }
  100% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(0, 229, 255, 0); }
}

/* ==========================================================================
   BUTTONS SYSTEM
   ========================================================================== */
.btn-neon-primary {
  padding: 0.85rem 1.8rem;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  transition: var(--transition);
  text-decoration: none;
  font-family: inherit;
  box-shadow: var(--glow-cyan);
}

.btn-neon-primary:hover {
  transform: translateY(-2px);
  filter: brightness(1.15);
}

.btn-neon-outline {
  padding: 0.85rem 1.8rem;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.95rem;
  background: transparent;
  border: 2px solid var(--neon-yellow);
  color: var(--neon-yellow);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  transition: var(--transition);
  text-decoration: none;
  font-family: inherit;
  box-shadow: var(--glow-yellow);
}

.btn-neon-outline:hover {
  background: var(--neon-yellow);
  color: #000;
  transform: translateY(-2px);
}

.btn-neon-ghost {
  padding: 0.85rem 1.8rem;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.95rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  transition: var(--transition);
  text-decoration: none;
  font-family: inherit;
}

.btn-neon-ghost:hover {
  border-color: var(--neon-magenta);
  box-shadow: var(--glow-violet);
  background: rgba(213, 0, 249, 0.1);
}

.btn-neon-small {
  padding: 0.45rem 1rem;
  border-radius: 50px;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: none;
  cursor: pointer;
  transition: var(--transition);
}

.btn-neon-small:hover {
  filter: brightness(1.2);
  transform: translateY(-2px);
}

/* ==========================================================================
   LAYOUT, CONTAINERS & TABS
   ========================================================================== */
.container {
  max-width: 1380px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}

.portal-tab-pane {
  display: none;
  animation: fadeInPane 0.4s ease-out;
}

.portal-tab-pane.active {
  display: block;
}

@keyframes fadeInPane {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.section-header-centered {
  text-align: center;
  max-width: 860px;
  margin: 0 auto 3rem;
}

.section-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 3.5vw, 2.8rem);
  font-weight: 800;
  line-height: 1.2;
  margin: 0.8rem 0;
  color: #fff;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.6;
}

.hero-banner-card {
  padding: 3.5rem 3rem;
  text-align: center;
  margin-bottom: 2.5rem;
}

.hero-top-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1.2rem;
  border-radius: 50px;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1.5rem;
}

.neon-badge-gold { background: rgba(255, 234, 0, 0.12); border: 1px solid var(--neon-yellow); color: var(--neon-yellow); box-shadow: var(--glow-yellow); }
.neon-badge-cyan { background: rgba(0, 229, 255, 0.12); border: 1px solid var(--neon-cyan); color: var(--neon-cyan); box-shadow: var(--glow-cyan); }
.neon-badge-green { background: rgba(0, 230, 118, 0.12); border: 1px solid var(--neon-green); color: var(--neon-green); box-shadow: var(--glow-green); }
.neon-badge-magenta { background: rgba(213, 0, 249, 0.12); border: 1px solid var(--neon-magenta); color: var(--neon-magenta); box-shadow: var(--glow-violet); }
.neon-badge-blue { background: rgba(41, 121, 255, 0.12); border: 1px solid var(--neon-blue); color: var(--neon-blue); box-shadow: var(--glow-blue); }

.hero-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.4rem, 5vw, 4rem);
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: 1.5rem;
}

.hero-desc {
  max-width: 880px;
  margin: 0 auto 2.5rem;
  font-size: 1.15rem;
  color: var(--text-muted);
}

.hero-cta-group {
  display: flex;
  justify-content: center;
  gap: 1.2rem;
  flex-wrap: wrap;
  margin-bottom: 3.5rem;
}

/* ==========================================================================
   STATS COUNTERS & NEURO-MARKETING ANCHORING
   ========================================================================== */
.stats-counter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1.2rem;
  text-align: center;
}

.stat-box {
  padding: 1.5rem 1rem;
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.stat-box:hover {
  transform: translateY(-4px);
}

.stat-number {
  font-family: 'Playfair Display', serif;
  font-size: 2.3rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 0.4rem;
}

.stat-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
}

.stat-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* ==========================================================================
   COMUNI GRID & BADGES (7 RAINBOW NEON BADGES)
   ========================================================================== */
.pills-filter-bar {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
}

.filter-pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-muted);
  padding: 0.55rem 1.3rem;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.filter-pill:hover {
  color: #fff;
  border-color: var(--neon-cyan);
}

.filter-pill.active {
  background: var(--neon-cyan);
  color: #000;
  border-color: var(--neon-cyan);
  box-shadow: var(--glow-cyan);
}

.comuni-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.comune-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.comune-header {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  margin-bottom: 1.2rem;
}

.comune-stemma-wrapper {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  border-radius: 12px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
}

.comune-stemma-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.comune-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  font-weight: 800;
  color: #fff;
}

.comune-pop-area {
  font-size: 0.82rem;
  color: var(--neon-cyan);
  font-weight: 600;
}

.comune-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.2rem;
  flex-grow: 1;
}

/* 7 RAINBOW BADGES PER LE RETI */
.badges-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1.4rem;
}

.badge-tag {
  font-size: 0.72rem;
  padding: 0.25rem 0.65rem;
  border-radius: 50px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-snai { background: rgba(0, 230, 118, 0.15); color: var(--neon-green); border: 1px solid var(--neon-green); }
.badge-parco { background: rgba(0, 229, 255, 0.15); color: var(--neon-cyan); border: 1px solid var(--neon-cyan); }
.badge-mab { background: rgba(255, 234, 0, 0.15); color: var(--neon-yellow); border: 1px solid var(--neon-yellow); }
.badge-gal { background: rgba(255, 119, 0, 0.15); color: var(--neon-orange); border: 1px solid var(--neon-orange); }
.badge-galpa { background: rgba(213, 0, 249, 0.15); color: var(--neon-magenta); border: 1px solid var(--neon-magenta); }
.badge-ogd { background: rgba(41, 121, 255, 0.15); color: var(--neon-blue); border: 1px solid var(--neon-blue); }
.badge-paesc { background: rgba(255, 0, 85, 0.15); color: var(--neon-red); border: 1px solid var(--neon-red); }
.badge-core { background: var(--rainbow-linear); color: #fff; font-weight: 800; border: none; }

/* ==========================================================================
   TABLES & MATRICI
   ========================================================================== */
.table-responsive-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-md);
}

.neon-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  text-align: left;
}

.neon-table th {
  background: rgba(8, 17, 34, 0.95);
  padding: 1rem 0.9rem;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--neon-cyan);
  border-bottom: 2px solid rgba(0, 229, 255, 0.3);
  white-space: nowrap;
}

.neon-table td {
  padding: 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  vertical-align: middle;
}

.neon-table tbody tr:hover {
  background: rgba(0, 229, 255, 0.05);
}

.cell-check {
  color: var(--neon-green);
  font-weight: 900;
  font-size: 1.1rem;
}

.cell-cross {
  color: var(--text-dim);
}

.role-tag {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 50px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.2);
  white-space: nowrap;
}

/* ==========================================================================
   CHART.JS CONTAINERS
   ========================================================================== */
.chart-container-responsive {
  position: relative;
  width: 100%;
  height: 380px;
}

/* ==========================================================================
   SIMULATORE FUSIONE INTERATTIVO
   ========================================================================== */
.sim-selector-pills {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.8rem;
}

.sim-pill-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  padding: 1rem;
  text-align: left;
  cursor: pointer;
  color: var(--text-muted);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sim-pill-btn span {
  font-weight: 700;
  color: #fff;
  font-size: 0.95rem;
}

.sim-pill-btn small {
  font-size: 0.78rem;
}

.sim-pill-btn:hover {
  border-color: var(--neon-yellow);
}

.sim-pill-btn.active {
  background: rgba(255, 234, 0, 0.12);
  border-color: var(--neon-yellow);
  box-shadow: var(--glow-yellow);
}

.sim-pill-btn.active span {
  color: var(--neon-yellow);
}

.scenario-meta-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 1rem;
}

.scenario-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--neon-yellow);
}

.scenario-sub {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.sim-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.sim-kpi-box {
  padding: 1.2rem;
  text-align: center;
}

.kpi-val {
  font-family: 'Playfair Display', serif;
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 0.3rem;
}

.kpi-lbl {
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
}

.kpi-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* ==========================================================================
   DIRECTORY LINK UTILI
   ========================================================================== */
.link-search-wrapper {
  max-width: 600px;
  margin: 0 auto;
}

.search-input-box {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  background: var(--bg-card);
  padding: 0.8rem 1.4rem;
  border-radius: 50px;
}

.search-input-box input {
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 0.95rem;
  font-family: inherit;
  width: 100%;
}

.link-category-block {
  margin-bottom: 3rem;
}

.category-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.45rem;
  font-weight: 800;
  margin-bottom: 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.link-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.link-item-card {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1rem 1.2rem;
  text-decoration: none;
  color: inherit;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: var(--transition);
}

.link-item-card:hover {
  border-color: var(--neon-cyan);
  box-shadow: var(--glow-cyan);
  transform: translateX(4px);
}

.link-stemma-thumb {
  width: 40px;
  height: 40px;
  object-fit: contain;
  flex-shrink: 0;
}

.icon-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 8px;
}

.link-info {
  flex-grow: 1;
  overflow: hidden;
}

.link-name {
  font-weight: 700;
  font-size: 0.92rem;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.link-detail {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.link-arrow {
  font-size: 1.1rem;
  color: var(--neon-cyan);
  transition: var(--transition);
}

.link-item-card:hover .link-arrow {
  transform: translate(2px, -2px);
}

/* ==========================================================================
   TELEGRAM FORUM DAO STYLES
   ========================================================================== */
.tg-app-container {
  display: grid;
  grid-template-columns: 320px 1fr;
  height: 720px;
  padding: 0 !important;
  overflow: hidden;
}

.tg-channels-sidebar {
  background: rgba(4, 9, 20, 0.95);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
}

.tg-sidebar-header {
  padding: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.tg-search-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.45rem 0.8rem;
  border-radius: 50px;
}

.tg-search-box input {
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 0.85rem;
  width: 100%;
}

.tg-filter-tabs {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.8rem;
}

.tg-filter-btn {
  flex: 1;
  padding: 0.35rem 0.5rem;
  border-radius: 50px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.tg-filter-btn.active {
  background: var(--neon-cyan);
  color: #000;
  border-color: var(--neon-cyan);
}

.tg-channels-list {
  flex-grow: 1;
  overflow-y: auto;
}

.tg-channel-item {
  display: flex;
  gap: 0.8rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: var(--transition);
}

.tg-channel-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.tg-channel-item.active {
  background: rgba(0, 229, 255, 0.12);
  border-left: 3px solid var(--neon-cyan);
}

.tg-ch-avatar {
  font-size: 1.5rem;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tg-ch-content {
  flex-grow: 1;
  overflow: hidden;
}

.tg-ch-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.2rem;
}

.tg-ch-title {
  font-weight: 700;
  font-size: 0.88rem;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tg-ch-time {
  font-size: 0.72rem;
  color: var(--text-dim);
}

.tg-ch-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.3rem;
}

.tg-ch-meta {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.tg-ch-tag-voting {
  font-size: 0.68rem;
  padding: 0.15rem 0.5rem;
  border-radius: 50px;
  background: rgba(0, 230, 118, 0.15);
  color: var(--neon-green);
  font-weight: 700;
}

.tg-ch-tag-disc {
  font-size: 0.68rem;
  padding: 0.15rem 0.5rem;
  border-radius: 50px;
  background: rgba(41, 121, 255, 0.15);
  color: var(--neon-blue);
  font-weight: 700;
}

.tg-ch-unread {
  font-size: 0.68rem;
  padding: 0.1rem 0.45rem;
  border-radius: 50px;
  background: var(--neon-yellow);
  color: #000;
  font-weight: 800;
  margin-left: auto;
}

/* CHAT VIEWPORT & BALLOT */
.tg-chat-viewport {
  display: flex;
  flex-direction: column;
  background: rgba(3, 7, 18, 0.8);
  overflow: hidden;
}

.tg-mobile-bar {
  display: none;
  padding: 0.6rem 1rem;
  background: rgba(8, 17, 34, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  align-items: center;
  gap: 0.8rem;
}

.tg-back-btn {
  background: transparent;
  border: none;
  color: var(--neon-cyan);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  cursor: pointer;
  font-family: inherit;
}

.tg-chat-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(8, 17, 34, 0.6);
}

.tg-chat-header-info {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.tg-chat-header-avatar {
  font-size: 1.6rem;
}

.tg-chat-header-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
}

.tg-chat-header-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.dao-ballot-card {
  margin: 1rem 1.5rem;
  padding: 1.2rem;
  border-radius: var(--radius-md);
}

.dao-ballot-title {
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
}

.dao-ballot-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}

.ballot-progress-bar {
  height: 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50px;
  overflow: hidden;
  display: flex;
}

.progress-segment {
  height: 100%;
  transition: width 0.5s ease;
}

.btn-vote-choice {
  padding: 0.6rem 1rem;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.82rem;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.btn-vote-yes { background: var(--neon-green); color: #000; box-shadow: var(--glow-green); }
.btn-vote-no { background: var(--neon-red); color: #fff; box-shadow: var(--glow-red); }
.btn-vote-abstain { background: rgba(255, 255, 255, 0.15); color: #fff; }

.ballot-actions-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.6rem;
}

.tg-messages-stream {
  flex-grow: 1;
  padding: 1rem 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.tg-message-card {
  display: flex;
  gap: 0.8rem;
  max-width: 80%;
}

.tg-message-card.self {
  margin-left: auto;
  flex-direction: row-reverse;
}

.tg-msg-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 229, 255, 0.2);
  color: var(--neon-cyan);
  font-weight: 800;
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tg-msg-body {
  background: rgba(8, 17, 34, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.75rem 1rem;
  border-radius: 14px;
}

.tg-message-card.self .tg-msg-body {
  background: rgba(0, 229, 255, 0.12);
  border-color: rgba(0, 229, 255, 0.35);
}

.tg-msg-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
}

.tg-msg-author {
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--neon-cyan);
}

.tg-msg-badge {
  font-size: 0.68rem;
  padding: 0.1rem 0.4rem;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50px;
  color: var(--neon-yellow);
}

.tg-msg-time {
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-left: auto;
}

.tg-msg-text {
  font-size: 0.85rem;
  color: var(--text-main);
  line-height: 1.45;
}

.tg-msg-reactions {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.4rem;
}

.tg-react-chip {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0.15rem 0.45rem;
  border-radius: 50px;
  font-size: 0.72rem;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  transition: var(--transition);
}

.tg-react-chip:hover {
  border-color: var(--neon-cyan);
  transform: scale(1.08);
}

.tg-composer-bar {
  padding: 0.8rem 1.5rem;
  background: rgba(4, 9, 20, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.composer-inner {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.btn-composer-attach {
  background: transparent;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
}

.composer-inner input {
  flex-grow: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 0.65rem 1.1rem;
  border-radius: 50px;
  color: #fff;
  outline: none;
  font-size: 0.88rem;
  font-family: inherit;
}

.btn-composer-send {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.btn-composer-send:hover {
  transform: scale(1.08);
}

.composer-subtext {
  font-size: 0.72rem;
  margin-top: 0.4rem;
  text-align: center;
}

/* MODALE PROPOSTA DAO */
.dao-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 1rem;
}

.dao-modal-card {
  max-width: 580px;
  width: 100%;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
}

.modal-form label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.35rem;
}

.modal-form input,
.modal-form select,
.modal-form textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.9rem;
  color: #fff;
  font-family: inherit;
  outline: none;
}

/* ==========================================================================
   ATTI & DOSSIER CARDS
   ========================================================================== */
.acts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 1.5rem;
}

.act-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.act-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.2rem 0.65rem;
  border-radius: 50px;
  margin-bottom: 0.8rem;
}

.act-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 0.5rem;
}

.act-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  flex-grow: 1;
}

/* ==========================================================================
   AI CHAT & CORTEX
   ========================================================================== */
.max-w-800 {
  max-width: 840px;
  margin: 0 auto;
}

.ai-chat-header {
  padding: 1rem 1.4rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.badge-source-verified {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.2rem 0.6rem;
  background: rgba(0, 230, 118, 0.15);
  color: var(--neon-green);
  border: 1px solid var(--neon-green);
  border-radius: 50px;
}

.ai-chat-body {
  padding: 1.5rem;
  min-height: 280px;
  max-height: 440px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.msg-bubble {
  padding: 1rem 1.2rem;
}

.msg-source {
  display: block;
  font-size: 0.75rem;
  color: var(--text-dim);
  font-style: italic;
  margin-top: 0.8rem;
  border-top: 1px dashed rgba(255, 255, 255, 0.1);
  padding-top: 0.4rem;
}

.ai-prompt-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.suggestion-chip {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 0.78rem;
  padding: 0.35rem 0.75rem;
  border-radius: 50px;
  cursor: pointer;
  transition: var(--transition);
}

.suggestion-chip:hover {
  background: rgba(0, 229, 255, 0.15);
  border-color: var(--neon-cyan);
  color: #fff;
}

.ai-chat-input-bar {
  display: flex;
  gap: 0.8rem;
  padding: 1rem 1.4rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.ai-chat-input-bar input {
  flex-grow: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 0.75rem 1.2rem;
  border-radius: 50px;
  color: #fff;
  font-family: inherit;
  outline: none;
}

/* ==========================================================================
   METRO ERIDANIA CARDS
   ========================================================================== */
.metro-phases-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.phase-card {
  padding: 1.8rem;
}

.phase-badge {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 0.4rem;
}

.phase-meta div {
  font-size: 0.85rem;
  margin-bottom: 0.2rem;
}

/* ==========================================================================
   BOTTOM PWA NAVIGATION (MOBILE FIRST)
   ========================================================================== */
.bottom-pwa-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(4, 9, 20, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(0, 229, 255, 0.25);
  padding: 0.4rem 0.5rem;
  justify-content: space-around;
}

.pwa-nav-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: var(--transition);
}

.pwa-icon {
  font-size: 1.2rem;
}

.pwa-nav-btn.active {
  color: var(--neon-cyan);
  text-shadow: var(--glow-cyan);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.portal-footer {
  background: rgba(3, 7, 18, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 3.5rem 0 5rem;
  margin-top: 4rem;
}

/* UTILITY HELPERS */
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-align-center { display: flex; align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.gap-2 { gap: 0.8rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.w-100 { width: 100%; }
.grid-2col { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 1.5rem; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.82rem; }
.font-bold { font-weight: 800; }
.rounded-img { width: 100%; height: auto; border-radius: var(--radius-md); object-fit: cover; }
.responsive-video { width: 100%; border-radius: var(--radius-md); outline: none; }

/* ==========================================================================
   RESPONSIVE DESIGN (BREAKPOINTS)
   ========================================================================== */
@media (max-width: 992px) {
  .top-scarcity-box { display: none; }
  .tg-app-container { grid-template-columns: 280px 1fr; }
}

@media (max-width: 768px) {
  .desktop-nav-tabs { display: none; }
  .bottom-pwa-nav { display: flex; }
  
  .tg-app-container {
    grid-template-columns: 1fr;
    height: 600px;
  }

  .tg-app-container:not(.show-chat) .tg-chat-viewport {
    display: none;
  }

  .tg-app-container.show-chat .tg-channels-sidebar {
    display: none;
  }

  .tg-mobile-bar {
    display: flex;
  }

  .container {
    padding: 1.5rem 1rem;
  }

  .hero-banner-card {
    padding: 2.5rem 1.2rem;
  }

  .stats-counter-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .portal-footer {
    padding-bottom: 6rem;
  }
}


/* ==========================================================================
   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;
}

/* ==========================================================================
   COOKIE BANNER PA 5.0 (GDPR & MOBILE TOUCH PROOF)
   ========================================================================== */
.cookie-consent-card {
  position: fixed !important;
  bottom: 24px !important;
  left: 24px !important;
  width: calc(100% - 48px) !important;
  max-width: 480px !important;
  background: rgba(6, 11, 24, 0.97) !important;
  backdrop-filter: blur(24px) !important;
  -webkit-backdrop-filter: blur(24px) !important;
  border: 1px solid rgba(0, 229, 255, 0.35) !important;
  border-radius: 16px !important;
  padding: 16px 18px !important;
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.85), 0 0 25px rgba(0, 229, 255, 0.15) !important;
  z-index: 2000000 !important;
  display: flex;
  flex-direction: column !important;
  gap: 12px !important;
  color: #e2e8f0 !important;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s !important;
  pointer-events: auto !important;
  box-sizing: border-box !important;
}

.cookie-consent-card[hidden],
.cookie-consent-card.cookie-banner-hidden,
.cookie-consent-card.cookie-banner-hiding {
  display: none !important;
  opacity: 0 !important;
  transform: translateY(20px) scale(0.96) !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

.cookie-card-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
}

.cookie-card-title-wrap {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
}

.cookie-card-icon {
  font-size: 1.5rem !important;
  line-height: 1 !important;
}

.cookie-card-title {
  margin: 0 !important;
  font-size: 0.95rem !important;
  font-weight: 700 !important;
  color: #ffffff !important;
  letter-spacing: -0.01em !important;
}

.cookie-card-badge {
  display: inline-block !important;
  font-size: 0.68rem !important;
  color: #00e5ff !important;
  font-weight: 600 !important;
  background: rgba(0, 229, 255, 0.12) !important;
  border: 1px solid rgba(0, 229, 255, 0.25) !important;
  border-radius: 4px !important;
  padding: 1px 6px !important;
  margin-top: 2px !important;
}

.cookie-close-btn {
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  min-height: 38px !important;
  border-radius: 50% !important;
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  color: #94a3b8 !important;
  font-size: 1.1rem !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  touch-action: manipulation !important;
  transition: all 0.2s ease !important;
  padding: 0 !important;
  flex-shrink: 0 !important;
  pointer-events: auto !important;
}

.cookie-close-btn:hover,
.cookie-close-btn:active {
  background: rgba(255, 255, 255, 0.2) !important;
  color: #ffffff !important;
  transform: scale(1.08) !important;
}

.cookie-card-text {
  margin: 0 !important;
  font-size: 0.8rem !important;
  line-height: 1.5 !important;
  color: #cbd5e1 !important;
}

.cookie-card-text strong {
  color: #f1f5f9 !important;
}

.cookie-card-actions {
  display: flex !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  padding-top: 4px !important;
}

.btn-cookie-accept {
  flex: 1 1 120px !important;
  min-height: 40px !important;
  background: linear-gradient(135deg, #00e5ff 0%, #0077b6 100%) !important;
  border: none !important;
  border-radius: 8px !important;
  color: #020617 !important;
  font-weight: 700 !important;
  font-size: 0.84rem !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  cursor: pointer !important;
  touch-action: manipulation !important;
  box-shadow: 0 4px 15px rgba(0, 229, 255, 0.35) !important;
  transition: transform 0.15s ease, box-shadow 0.15s ease !important;
  pointer-events: auto !important;
}

.btn-cookie-accept:hover,
.btn-cookie-accept:active {
  transform: translateY(-1px) !important;
  box-shadow: 0 6px 20px rgba(0, 229, 255, 0.6) !important;
}

.btn-cookie-reject {
  flex: 1 1 100px !important;
  min-height: 40px !important;
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(0, 229, 255, 0.3) !important;
  border-radius: 8px !important;
  color: #00e5ff !important;
  font-weight: 600 !important;
  font-size: 0.82rem !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  touch-action: manipulation !important;
  transition: background 0.15s ease, border-color 0.15s ease !important;
  pointer-events: auto !important;
}

.btn-cookie-reject:hover,
.btn-cookie-reject:active {
  background: rgba(0, 229, 255, 0.15) !important;
  border-color: #00e5ff !important;
}

.btn-cookie-link {
  font-size: 0.78rem !important;
  color: #94a3b8 !important;
  text-decoration: underline !important;
  padding: 6px 8px !important;
  cursor: pointer !important;
  touch-action: manipulation !important;
  transition: color 0.15s ease !important;
  white-space: nowrap !important;
  pointer-events: auto !important;
}

.btn-cookie-link:hover {
  color: #38bdf8 !important;
}

.cookie-banner-hiding {
  opacity: 0 !important;
  transform: translateY(20px) scale(0.96) !important;
  pointer-events: none !important;
}

@media (max-width: 768px) {
  .cookie-consent-card {
    bottom: 76px !important;
    left: 12px !important;
    right: 12px !important;
    width: auto !important;
    max-width: none !important;
    padding: 14px 16px !important;
    gap: 10px !important;
    border-radius: 14px !important;
  }
  .cookie-card-title {
    font-size: 0.88rem !important;
  }
  .cookie-card-text {
    font-size: 0.76rem !important;
    line-height: 1.45 !important;
  }
  .btn-cookie-accept,
  .btn-cookie-reject {
    min-height: 42px !important;
    font-size: 0.82rem !important;
  }
}

/* ==========================================================================
   MOBILE FIRST VERO SYSTEM (WCAG 2.1 AA & iOS/Android Native UX)
   Ergonomia Touch, Bottom App Bar, Off-Canvas Drawer, Fluid Typography & Anti-Overflow
   ========================================================================== */

/* 1. GLOBAL MOBILE RESETS & ANTI-OVERFLOW */
html {
  box-sizing: border-box;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

*, *::before, *::after {
  box-sizing: inherit;
}

body {
  overflow-x: hidden !important;
  width: 100% !important;
  max-width: 100vw !important;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

body.mobile-drawer-open {
  overflow: hidden !important;
  touch-action: none;
}

/* 2. FLUID CONTAINERS & TYPOGRAPHY */
.container, .page-container {
  width: 100% !important;
  max-width: 100% !important;
  padding-left: 1rem !important;
  padding-right: 1rem !important;
  margin-left: auto !important;
  margin-right: auto !important;
  box-sizing: border-box !important;
}

@media (min-width: 768px) {
  .container, .page-container {
    padding-left: 1.5rem !important;
    padding-right: 1.5rem !important;
  }
}

@media (min-width: 1200px) {
  .container {
    max-width: 1360px !important;
    padding-left: 2rem !important;
    padding-right: 2rem !important;
  }
}

/* 3. TOP APPBAR ISTITUZIONALE RESPONSIVE */
.top-appbar {
  height: 60px !important;
  position: sticky !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 9980 !important;
  background: rgba(6, 10, 20, 0.92) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.appbar-inner {
  max-width: 1360px !important;
  width: 100% !important;
  height: 100% !important;
  padding: 0 1rem !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 0.5rem !important;
  box-sizing: border-box !important;
}

.brand-wrapper {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  text-decoration: none !important;
  min-width: 0 !important;
}

.brand-logo-img {
  width: 36px !important;
  height: 36px !important;
  border-radius: 8px !important;
  border: 1.5px solid var(--accent-gold) !important;
  box-shadow: 0 0 12px rgba(223, 177, 91, 0.3) !important;
  flex-shrink: 0 !important;
}

.brand-title {
  font-size: clamp(0.92rem, 3.8vw, 1.15rem) !important;
  font-weight: 800 !important;
  letter-spacing: 0.03em !important;
  white-space: nowrap !important;
  color: #fff !important;
}

.brand-title-gold {
  color: var(--accent-gold) !important;
}

.brand-claim {
  display: none !important;
}

@media (min-width: 680px) {
  .brand-claim {
    display: block !important;
    font-size: 0.72rem !important;
    color: #94a3b8 !important;
    white-space: nowrap !important;
  }
}

/* HAMBURGER TOGGLE BUTTON */
.nav-toggle {
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
  width: 44px !important;
  height: 44px !important;
  padding: 8px !important;
  background: rgba(14, 165, 233, 0.12) !important;
  border: 1px solid rgba(56, 189, 248, 0.3) !important;
  border-radius: 10px !important;
  cursor: pointer !important;
  touch-action: manipulation !important;
  transition: all 0.2s ease !important;
  gap: 5px !important;
  flex-shrink: 0 !important;
}

.nav-toggle:active {
  transform: scale(0.94);
  background: rgba(14, 165, 233, 0.22) !important;
}

.nav-toggle span {
  display: block !important;
  width: 22px !important;
  height: 2px !important;
  background: #38bdf8 !important;
  border-radius: 2px !important;
  transition: all 0.25s ease !important;
}

.nav-toggle.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg) !important;
}
.nav-toggle.open span:nth-child(2) {
  opacity: 0 !important;
  transform: scaleX(0) !important;
}
.nav-toggle.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg) !important;
}

@media (min-width: 1024px) {
  .nav-toggle {
    display: none !important;
  }
  .desktop-nav-tabs {
    display: flex !important;
  }
}

@media (max-width: 1023px) {
  .desktop-nav-tabs {
    display: none !important;
  }
  .top-scarcity-box {
    display: none !important;
  }
}

/* 4. NATIVE MOBILE BOTTOM APP BAR (THUMB NAVIGATION) */
.mobile-bottom-nav {
  display: flex !important;
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  z-index: 9990 !important;
  background: rgba(6, 10, 20, 0.94) !important;
  backdrop-filter: blur(24px) !important;
  -webkit-backdrop-filter: blur(24px) !important;
  border-top: 1px solid rgba(56, 189, 248, 0.25) !important;
  box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.6) !important;
  padding: 4px 6px max(6px, env(safe-area-inset-bottom, 0px)) !important;
  justify-content: space-around !important;
  align-items: center !important;
  box-sizing: border-box !important;
}

@media (min-width: 1024px) {
  .mobile-bottom-nav {
    display: none !important;
  }
}

.mobile-bottom-tab {
  flex: 1 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 6px 2px !important;
  text-decoration: none !important;
  color: #94a3b8 !important;
  background: transparent !important;
  border: none !important;
  cursor: pointer !important;
  touch-action: manipulation !important;
  transition: all 0.15s ease !important;
  border-radius: 8px !important;
  min-height: 48px !important;
  position: relative !important;
}

.mobile-tab-icon {
  font-size: 1.22rem !important;
  line-height: 1 !important;
  margin-bottom: 3px !important;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.mobile-tab-label {
  font-size: 0.68rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.02em !important;
  white-space: nowrap !important;
  transition: color 0.15s ease !important;
}

.mobile-bottom-tab:active .mobile-tab-icon {
  transform: scale(0.88) !important;
}

.mobile-bottom-tab.active {
  color: #38bdf8 !important;
}

.mobile-bottom-tab.active .mobile-tab-label {
  color: #38bdf8 !important;
  font-weight: 800 !important;
}

.mobile-bottom-tab.active::after {
  content: '' !important;
  position: absolute !important;
  top: 1px !important;
  width: 18px !important;
  height: 3px !important;
  border-radius: 2px !important;
  background: var(--brand-sky) !important;
  box-shadow: 0 0 8px var(--brand-sky) !important;
}

.mobile-bottom-tab.tab-gold.active {
  color: var(--accent-gold) !important;
}

.mobile-bottom-tab.tab-gold.active::after {
  background: var(--accent-gold) !important;
  box-shadow: 0 0 8px var(--accent-gold) !important;
}

/* 5. PRESTIGE OFF-CANVAS MOBILE DRAWER */
.mobile-drawer-backdrop {
  position: fixed !important;
  inset: 0 !important;
  background: rgba(2, 6, 16, 0.78) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  z-index: 100000 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.mobile-drawer-backdrop.active {
  opacity: 1 !important;
  pointer-events: auto !important;
}

.mobile-drawer-sheet {
  position: fixed !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: min(88vw, 390px) !important;
  max-width: 100vw !important;
  height: 100% !important;
  height: 100dvh !important;
  background: #080f22 !important;
  border-left: 1px solid rgba(56, 189, 248, 0.25) !important;
  box-shadow: -14px 0 45px rgba(0, 0, 0, 0.8) !important;
  z-index: 100001 !important;
  display: flex !important;
  flex-direction: column !important;
  transform: translateX(100%) !important;
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1) !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

.mobile-drawer-sheet.active {
  transform: translateX(0) !important;
}

.mobile-drawer-header {
  padding: 1rem 1.25rem !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  background: rgba(10, 18, 38, 0.9) !important;
  flex-shrink: 0 !important;
}

.mobile-drawer-brand {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
}

.mobile-drawer-brand img {
  width: 34px !important;
  height: 34px !important;
  border-radius: 8px !important;
  border: 1px solid var(--accent-gold) !important;
}

.mobile-drawer-close {
  width: 42px !important;
  height: 42px !important;
  border-radius: 10px !important;
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: #cbd5e1 !important;
  font-size: 1.15rem !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  touch-action: manipulation !important;
  transition: all 0.2s ease !important;
}

.mobile-drawer-close:active {
  background: rgba(239, 68, 68, 0.2) !important;
  color: #ef4444 !important;
  transform: scale(0.92);
}

.mobile-drawer-body {
  flex: 1 !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  padding: 1rem 1.25rem 2.5rem !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 1.25rem !important;
}

.drawer-section-title {
  font-size: 0.72rem !important;
  font-weight: 800 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.08em !important;
  color: var(--accent-gold) !important;
  margin-bottom: 0.5rem !important;
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
}

.drawer-nav-list {
  display: flex !important;
  flex-direction: column !important;
  gap: 0.35rem !important;
}

.drawer-link {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 0.7rem 0.9rem !important;
  border-radius: 10px !important;
  text-decoration: none !important;
  color: #e2e8f0 !important;
  font-size: 0.92rem !important;
  font-weight: 600 !important;
  background: rgba(255, 255, 255, 0.03) !important;
  border: 1px solid rgba(255, 255, 255, 0.05) !important;
  transition: all 0.18s ease !important;
  min-height: 46px !important;
}

.drawer-link:active, .drawer-link.active {
  background: rgba(14, 165, 233, 0.18) !important;
  border-color: rgba(56, 189, 248, 0.4) !important;
  color: #38bdf8 !important;
}

.drawer-link.highlight-gold {
  border-color: rgba(223, 177, 91, 0.4) !important;
  color: var(--accent-gold) !important;
  background: rgba(223, 177, 91, 0.08) !important;
}

.drawer-link-left {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
}

.drawer-link-icon {
  font-size: 1.15rem !important;
  width: 24px !important;
  text-align: center !important;
}

.drawer-link-badge {
  font-size: 0.65rem !important;
  padding: 2px 7px !important;
  border-radius: 999px !important;
  background: rgba(14, 165, 233, 0.2) !important;
  color: #38bdf8 !important;
  font-weight: 700 !important;
}

.drawer-footer-cta {
  padding-top: 0.5rem !important;
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
}

/* 6. FLOATING HUD & A11Y COLLISION SHIELD */
@media (max-width: 1023px) {
  .quick-nav-hud {
    bottom: calc(64px + max(8px, env(safe-area-inset-bottom, 0px))) !important;
    right: 14px !important;
    z-index: 9995 !important;
  }
  .a11y-fab-trigger {
    bottom: calc(64px + max(8px, env(safe-area-inset-bottom, 0px))) !important;
    left: 14px !important;
    z-index: 9995 !important;
    width: 42px !important;
    height: 42px !important;
    border-radius: 50% !important;
    justify-content: center !important;
    align-items: center !important;
    display: flex !important;
    padding: 0 !important;
  }
  .a11y-fab-trigger span {
    display: none !important;
  }
  .site-footer, .portal-footer {
    padding-bottom: calc(88px + max(8px, env(safe-area-inset-bottom, 0px))) !important;
  }
  #cookieBanner, .cookie-consent-card {
    bottom: calc(64px + max(8px, env(safe-area-inset-bottom, 0px))) !important;
    left: 10px !important;
    right: 10px !important;
    width: auto !important;
    max-width: 100% !important;
    border-radius: 14px !important;
    padding: 12px 14px !important;
    z-index: 10010 !important;
  }
}

/* 7. GRID BREAKPOINT HARMONIZATION */
@media (max-width: 768px) {
  .grid-2col,
  .grid-3col,
  .acts-grid,
  .comuni-detail-grid,
  .comuni-grid-2,
  .comuni-grid-4,
  .reasons-grid,
  .link-cards-grid,
  .hero-super-canvas,
  .video-feature-hero,
  .allocator-grid,
  .triad-cards-grid,
  .kpi-bento-grid,
  .footer-grid {
    grid-template-columns: 1fr !important;
  }
  .hero-trust-ribbon,
  .stats-counter-grid,
  .card-metrics-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 0.75rem !important;
  }
  .hero-grand-title {
    font-size: clamp(1.85rem, 7vw, 2.75rem) !important;
    line-height: 1.2 !important;
  }
  .hero-lead-text {
    font-size: 0.98rem !important;
    line-height: 1.6 !important;
  }
  .hero-actions-row {
    flex-direction: column !important;
    width: 100% !important;
    gap: 0.75rem !important;
  }
  .hero-actions-row button,
  .hero-actions-row a {
    width: 100% !important;
    min-height: 48px !important;
    justify-content: center !important;
    font-size: 0.95rem !important;
  }
  .cinema-modal-box,
  .doc-modal-container,
  .a11y-panel-box,
  .dao-modal-card {
    width: 95vw !important;
    max-width: 95vw !important;
    max-height: 90vh !important;
    margin: auto !important;
    padding: 1.25rem !important;
  }
  table {
    display: block !important;
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
  /* Prevent iOS zoom on inputs */
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="number"],
  input[type="search"],
  textarea,
  select {
    font-size: 16px !important;
  }
}

/* ==========================================================================
   MOBILE FIRST VERO SYSTEM (WCAG 2.1 AA & iOS/Android Native UX)
   Ergonomia Touch, Bottom App Bar, Off-Canvas Drawer, Fluid Typography & Anti-Overflow
   ========================================================================== */

/* 1. GLOBAL MOBILE RESETS & ANTI-OVERFLOW */
html {
  box-sizing: border-box;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

*, *::before, *::after {
  box-sizing: inherit;
}

body {
  overflow-x: hidden !important;
  width: 100% !important;
  max-width: 100vw !important;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

body.mobile-drawer-open {
  overflow: hidden !important;
  touch-action: none;
}

/* 2. FLUID CONTAINERS & TYPOGRAPHY */
.container, .page-container {
  width: 100% !important;
  max-width: 100% !important;
  padding-left: 1rem !important;
  padding-right: 1rem !important;
  margin-left: auto !important;
  margin-right: auto !important;
  box-sizing: border-box !important;
}

@media (min-width: 768px) {
  .container, .page-container {
    padding-left: 1.5rem !important;
    padding-right: 1.5rem !important;
  }
}

@media (min-width: 1200px) {
  .container {
    max-width: 1360px !important;
    padding-left: 2rem !important;
    padding-right: 2rem !important;
  }
}

/* 3. TOP APPBAR ISTITUZIONALE RESPONSIVE */
.top-appbar {
  height: 60px !important;
  position: sticky !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 9980 !important;
  background: rgba(6, 10, 20, 0.92) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.appbar-inner {
  max-width: 1360px !important;
  width: 100% !important;
  height: 100% !important;
  padding: 0 1rem !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 0.5rem !important;
  box-sizing: border-box !important;
}

.brand-wrapper {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  text-decoration: none !important;
  min-width: 0 !important;
}

.brand-logo-img {
  width: 36px !important;
  height: 36px !important;
  border-radius: 8px !important;
  border: 1.5px solid var(--accent-gold) !important;
  box-shadow: 0 0 12px rgba(223, 177, 91, 0.3) !important;
  flex-shrink: 0 !important;
}

.brand-title {
  font-size: clamp(0.92rem, 3.8vw, 1.15rem) !important;
  font-weight: 800 !important;
  letter-spacing: 0.03em !important;
  white-space: nowrap !important;
  color: #fff !important;
}

.brand-title-gold {
  color: var(--accent-gold) !important;
}

.brand-claim {
  display: none !important;
}

@media (min-width: 680px) {
  .brand-claim {
    display: block !important;
    font-size: 0.72rem !important;
    color: #94a3b8 !important;
    white-space: nowrap !important;
  }
}

/* HAMBURGER TOGGLE BUTTON */
.nav-toggle {
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
  width: 44px !important;
  height: 44px !important;
  padding: 8px !important;
  background: rgba(14, 165, 233, 0.12) !important;
  border: 1px solid rgba(56, 189, 248, 0.3) !important;
  border-radius: 10px !important;
  cursor: pointer !important;
  touch-action: manipulation !important;
  transition: all 0.2s ease !important;
  gap: 5px !important;
  flex-shrink: 0 !important;
}

.nav-toggle:active {
  transform: scale(0.94);
  background: rgba(14, 165, 233, 0.22) !important;
}

.nav-toggle span {
  display: block !important;
  width: 22px !important;
  height: 2px !important;
  background: #38bdf8 !important;
  border-radius: 2px !important;
  transition: all 0.25s ease !important;
}

.nav-toggle.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg) !important;
}
.nav-toggle.open span:nth-child(2) {
  opacity: 0 !important;
  transform: scaleX(0) !important;
}
.nav-toggle.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg) !important;
}

@media (min-width: 1024px) {
  .nav-toggle {
    display: none !important;
  }
  .desktop-nav-tabs {
    display: flex !important;
  }
}

@media (max-width: 1023px) {
  .desktop-nav-tabs {
    display: none !important;
  }
  .top-scarcity-box {
    display: none !important;
  }
}

/* 4. NATIVE MOBILE BOTTOM APP BAR (THUMB NAVIGATION) */
.mobile-bottom-nav {
  display: flex !important;
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  z-index: 9990 !important;
  background: rgba(6, 10, 20, 0.94) !important;
  backdrop-filter: blur(24px) !important;
  -webkit-backdrop-filter: blur(24px) !important;
  border-top: 1px solid rgba(56, 189, 248, 0.25) !important;
  box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.6) !important;
  padding: 4px 6px max(6px, env(safe-area-inset-bottom, 0px)) !important;
  justify-content: space-around !important;
  align-items: center !important;
  box-sizing: border-box !important;
}

@media (min-width: 1024px) {
  .mobile-bottom-nav {
    display: none !important;
  }
}

.mobile-bottom-tab {
  flex: 1 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 6px 2px !important;
  text-decoration: none !important;
  color: #94a3b8 !important;
  background: transparent !important;
  border: none !important;
  cursor: pointer !important;
  touch-action: manipulation !important;
  transition: all 0.15s ease !important;
  border-radius: 8px !important;
  min-height: 48px !important;
  position: relative !important;
}

.mobile-tab-icon {
  font-size: 1.22rem !important;
  line-height: 1 !important;
  margin-bottom: 3px !important;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.mobile-tab-label {
  font-size: 0.68rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.02em !important;
  white-space: nowrap !important;
  transition: color 0.15s ease !important;
}

.mobile-bottom-tab:active .mobile-tab-icon {
  transform: scale(0.88) !important;
}

.mobile-bottom-tab.active {
  color: #38bdf8 !important;
}

.mobile-bottom-tab.active .mobile-tab-label {
  color: #38bdf8 !important;
  font-weight: 800 !important;
}

.mobile-bottom-tab.active::after {
  content: '' !important;
  position: absolute !important;
  top: 1px !important;
  width: 18px !important;
  height: 3px !important;
  border-radius: 2px !important;
  background: var(--brand-sky) !important;
  box-shadow: 0 0 8px var(--brand-sky) !important;
}

.mobile-bottom-tab.tab-gold.active {
  color: var(--accent-gold) !important;
}

.mobile-bottom-tab.tab-gold.active::after {
  background: var(--accent-gold) !important;
  box-shadow: 0 0 8px var(--accent-gold) !important;
}

/* 5. PRESTIGE OFF-CANVAS MOBILE DRAWER */
.mobile-drawer-backdrop {
  position: fixed !important;
  inset: 0 !important;
  background: rgba(2, 6, 16, 0.78) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  z-index: 100000 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.mobile-drawer-backdrop.active {
  opacity: 1 !important;
  pointer-events: auto !important;
}

.mobile-drawer-sheet {
  position: fixed !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: min(88vw, 390px) !important;
  max-width: 100vw !important;
  height: 100% !important;
  height: 100dvh !important;
  background: #080f22 !important;
  border-left: 1px solid rgba(56, 189, 248, 0.25) !important;
  box-shadow: -14px 0 45px rgba(0, 0, 0, 0.8) !important;
  z-index: 100001 !important;
  display: flex !important;
  flex-direction: column !important;
  transform: translateX(100%) !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.32s !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

.mobile-drawer-sheet.active {
  transform: translateX(0) !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

/* ANTI-OVERFLOW RULES FOR HERO, BG & CONTROLS */
.dynamic-bg-wrapper {
  overflow: hidden !important;
  max-width: 100vw !important;
  width: 100% !important;
}
.bg-slide {
  max-width: 100vw !important;
}
.hero-super-canvas, .hero-col-content {
  max-width: 100% !important;
  width: 100% !important;
  box-sizing: border-box !important;
}
.hero-pill-badge {
  max-width: 100% !important;
  white-space: normal !important;
  word-break: break-word !important;
  line-height: 1.4 !important;
  box-sizing: border-box !important;
}
.hero-pill-badge span {
  display: inline-block !important;
  max-width: 100% !important;
  word-break: break-word !important;
}
.allocator-controls,
.slider-group,
.allocator-summary-panel {
  max-width: 100% !important;
  box-sizing: border-box !important;
}

.mobile-drawer-header {
  padding: 1rem 1.25rem !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  background: rgba(10, 18, 38, 0.9) !important;
  flex-shrink: 0 !important;
}

.mobile-drawer-brand {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
}

.mobile-drawer-brand img {
  width: 34px !important;
  height: 34px !important;
  border-radius: 8px !important;
  border: 1px solid var(--accent-gold) !important;
}

.mobile-drawer-close {
  width: 42px !important;
  height: 42px !important;
  border-radius: 10px !important;
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: #cbd5e1 !important;
  font-size: 1.15rem !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  touch-action: manipulation !important;
  transition: all 0.2s ease !important;
}

.mobile-drawer-close:active {
  background: rgba(239, 68, 68, 0.2) !important;
  color: #ef4444 !important;
  transform: scale(0.92);
}

.mobile-drawer-body {
  flex: 1 !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  padding: 1rem 1.25rem 2.5rem !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 1.25rem !important;
}

.drawer-section-title {
  font-size: 0.72rem !important;
  font-weight: 800 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.08em !important;
  color: var(--accent-gold) !important;
  margin-bottom: 0.5rem !important;
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
}

.drawer-nav-list {
  display: flex !important;
  flex-direction: column !important;
  gap: 0.35rem !important;
}

.drawer-link {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 0.7rem 0.9rem !important;
  border-radius: 10px !important;
  text-decoration: none !important;
  color: #e2e8f0 !important;
  font-size: 0.92rem !important;
  font-weight: 600 !important;
  background: rgba(255, 255, 255, 0.03) !important;
  border: 1px solid rgba(255, 255, 255, 0.05) !important;
  transition: all 0.18s ease !important;
  min-height: 46px !important;
}

.drawer-link:active, .drawer-link.active {
  background: rgba(14, 165, 233, 0.18) !important;
  border-color: rgba(56, 189, 248, 0.4) !important;
  color: #38bdf8 !important;
}

.drawer-link.highlight-gold {
  border-color: rgba(223, 177, 91, 0.4) !important;
  color: var(--accent-gold) !important;
  background: rgba(223, 177, 91, 0.08) !important;
}

.drawer-link-left {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
}

.drawer-link-icon {
  font-size: 1.15rem !important;
  width: 24px !important;
  text-align: center !important;
}

.drawer-link-badge {
  font-size: 0.65rem !important;
  padding: 2px 7px !important;
  border-radius: 999px !important;
  background: rgba(14, 165, 233, 0.2) !important;
  color: #38bdf8 !important;
  font-weight: 700 !important;
}

.drawer-footer-cta {
  padding-top: 0.5rem !important;
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
}

/* 6. FLOATING HUD & A11Y COLLISION SHIELD */
@media (max-width: 1023px) {
  .quick-nav-hud {
    bottom: calc(64px + max(8px, env(safe-area-inset-bottom, 0px))) !important;
    right: 14px !important;
    z-index: 9995 !important;
  }
  .a11y-fab-trigger {
    bottom: calc(64px + max(8px, env(safe-area-inset-bottom, 0px))) !important;
    left: 14px !important;
    z-index: 9995 !important;
    width: 42px !important;
    height: 42px !important;
    border-radius: 50% !important;
    justify-content: center !important;
    align-items: center !important;
    display: flex !important;
    padding: 0 !important;
  }
  .a11y-fab-trigger span {
    display: none !important;
  }
  .site-footer, .portal-footer {
    padding-bottom: calc(88px + max(8px, env(safe-area-inset-bottom, 0px))) !important;
  }
  #cookieBanner, .cookie-consent-card {
    bottom: calc(64px + max(8px, env(safe-area-inset-bottom, 0px))) !important;
    left: 10px !important;
    right: 10px !important;
    width: auto !important;
    max-width: 100% !important;
    border-radius: 14px !important;
    padding: 12px 14px !important;
    z-index: 10010 !important;
  }
}

/* 7. GRID BREAKPOINT HARMONIZATION */
@media (max-width: 768px) {
  .grid-2col,
  .grid-3col,
  .acts-grid,
  .comuni-detail-grid,
  .comuni-grid-2,
  .comuni-grid-4,
  .reasons-grid,
  .link-cards-grid,
  .hero-super-canvas,
  .video-feature-hero,
  .allocator-grid,
  .triad-cards-grid,
  .kpi-bento-grid,
  .footer-grid {
    grid-template-columns: 1fr !important;
  }
  .hero-trust-ribbon,
  .stats-counter-grid,
  .card-metrics-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 0.75rem !important;
  }
  .hero-grand-title {
    font-size: clamp(1.85rem, 7vw, 2.75rem) !important;
    line-height: 1.2 !important;
  }
  .hero-lead-text {
    font-size: 0.98rem !important;
    line-height: 1.6 !important;
  }
  .hero-actions-row {
    flex-direction: column !important;
    width: 100% !important;
    gap: 0.75rem !important;
  }
  .hero-actions-row button,
  .hero-actions-row a {
    width: 100% !important;
    min-height: 48px !important;
    justify-content: center !important;
    font-size: 0.95rem !important;
  }
  .cinema-modal-box,
  .doc-modal-container,
  .a11y-panel-box,
  .dao-modal-card {
    width: 95vw !important;
    max-width: 95vw !important;
    max-height: 90vh !important;
    margin: auto !important;
    padding: 1.25rem !important;
  }
  table {
    display: block !important;
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
  /* Prevent iOS zoom on inputs */
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="number"],
  input[type="search"],
  textarea,
  select {
    font-size: 16px !important;
  }
}

/* ==========================================================================
   MOBILE FIRST VERO SYSTEM (WCAG 2.1 AA & iOS/Android Native UX)
   Ergonomia Touch, Bottom App Bar, Off-Canvas Drawer, Fluid Typography & Anti-Overflow
   ========================================================================== */

/* 1. GLOBAL MOBILE RESETS & ANTI-OVERFLOW */
html {
  box-sizing: border-box;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

*, *::before, *::after {
  box-sizing: inherit;
}

body {
  overflow-x: hidden !important;
  width: 100% !important;
  max-width: 100vw !important;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

body.mobile-drawer-open {
  overflow: hidden !important;
  touch-action: none;
}

/* 2. FLUID CONTAINERS & TYPOGRAPHY */
.container, .page-container {
  width: 100% !important;
  max-width: 100% !important;
  padding-left: 1rem !important;
  padding-right: 1rem !important;
  margin-left: auto !important;
  margin-right: auto !important;
  box-sizing: border-box !important;
}

@media (min-width: 768px) {
  .container, .page-container {
    padding-left: 1.5rem !important;
    padding-right: 1.5rem !important;
  }
}

@media (min-width: 1200px) {
  .container {
    max-width: 1360px !important;
    padding-left: 2rem !important;
    padding-right: 2rem !important;
  }
}

/* 3. TOP APPBAR ISTITUZIONALE RESPONSIVE */
.top-appbar {
  height: 60px !important;
  position: sticky !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 9980 !important;
  background: rgba(6, 10, 20, 0.92) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.appbar-inner {
  max-width: 1360px !important;
  width: 100% !important;
  height: 100% !important;
  padding: 0 1rem !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 0.5rem !important;
  box-sizing: border-box !important;
}

.brand-wrapper {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  text-decoration: none !important;
  min-width: 0 !important;
}

.brand-logo-img {
  width: 36px !important;
  height: 36px !important;
  border-radius: 8px !important;
  border: 1.5px solid var(--accent-gold) !important;
  box-shadow: 0 0 12px rgba(223, 177, 91, 0.3) !important;
  flex-shrink: 0 !important;
}

.brand-title {
  font-size: clamp(0.92rem, 3.8vw, 1.15rem) !important;
  font-weight: 800 !important;
  letter-spacing: 0.03em !important;
  white-space: nowrap !important;
  color: #fff !important;
}

.brand-title-gold {
  color: var(--accent-gold) !important;
}

.brand-claim {
  display: none !important;
}

@media (min-width: 680px) {
  .brand-claim {
    display: block !important;
    font-size: 0.72rem !important;
    color: #94a3b8 !important;
    white-space: nowrap !important;
  }
}

/* HAMBURGER TOGGLE BUTTON */
.nav-toggle {
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
  width: 44px !important;
  height: 44px !important;
  padding: 8px !important;
  background: rgba(14, 165, 233, 0.12) !important;
  border: 1px solid rgba(56, 189, 248, 0.3) !important;
  border-radius: 10px !important;
  cursor: pointer !important;
  touch-action: manipulation !important;
  transition: all 0.2s ease !important;
  gap: 5px !important;
  flex-shrink: 0 !important;
}

.nav-toggle:active {
  transform: scale(0.94);
  background: rgba(14, 165, 233, 0.22) !important;
}

.nav-toggle span {
  display: block !important;
  width: 22px !important;
  height: 2px !important;
  background: #38bdf8 !important;
  border-radius: 2px !important;
  transition: all 0.25s ease !important;
}

.nav-toggle.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg) !important;
}
.nav-toggle.open span:nth-child(2) {
  opacity: 0 !important;
  transform: scaleX(0) !important;
}
.nav-toggle.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg) !important;
}

@media (min-width: 1024px) {
  .nav-toggle {
    display: none !important;
  }
  .desktop-nav-tabs {
    display: flex !important;
  }
}

@media (max-width: 1023px) {
  .desktop-nav-tabs {
    display: none !important;
  }
  .top-scarcity-box {
    display: none !important;
  }
}

/* 4. NATIVE MOBILE BOTTOM APP BAR (THUMB NAVIGATION) */
.mobile-bottom-nav {
  display: flex !important;
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  z-index: 9990 !important;
  background: rgba(6, 10, 20, 0.94) !important;
  backdrop-filter: blur(24px) !important;
  -webkit-backdrop-filter: blur(24px) !important;
  border-top: 1px solid rgba(56, 189, 248, 0.25) !important;
  box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.6) !important;
  padding: 4px 6px max(6px, env(safe-area-inset-bottom, 0px)) !important;
  justify-content: space-around !important;
  align-items: center !important;
  box-sizing: border-box !important;
}

@media (min-width: 1024px) {
  .mobile-bottom-nav {
    display: none !important;
  }
}

.mobile-bottom-tab {
  flex: 1 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 6px 2px !important;
  text-decoration: none !important;
  color: #94a3b8 !important;
  background: transparent !important;
  border: none !important;
  cursor: pointer !important;
  touch-action: manipulation !important;
  transition: all 0.15s ease !important;
  border-radius: 8px !important;
  min-height: 48px !important;
  position: relative !important;
}

.mobile-tab-icon {
  font-size: 1.22rem !important;
  line-height: 1 !important;
  margin-bottom: 3px !important;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.mobile-tab-label {
  font-size: 0.68rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.02em !important;
  white-space: nowrap !important;
  transition: color 0.15s ease !important;
}

.mobile-bottom-tab:active .mobile-tab-icon {
  transform: scale(0.88) !important;
}

.mobile-bottom-tab.active {
  color: #38bdf8 !important;
}

.mobile-bottom-tab.active .mobile-tab-label {
  color: #38bdf8 !important;
  font-weight: 800 !important;
}

.mobile-bottom-tab.active::after {
  content: '' !important;
  position: absolute !important;
  top: 1px !important;
  width: 18px !important;
  height: 3px !important;
  border-radius: 2px !important;
  background: var(--brand-sky) !important;
  box-shadow: 0 0 8px var(--brand-sky) !important;
}

.mobile-bottom-tab.tab-gold.active {
  color: var(--accent-gold) !important;
}

.mobile-bottom-tab.tab-gold.active::after {
  background: var(--accent-gold) !important;
  box-shadow: 0 0 8px var(--accent-gold) !important;
}

/* 5. PRESTIGE OFF-CANVAS MOBILE DRAWER */
.mobile-drawer-backdrop {
  position: fixed !important;
  inset: 0 !important;
  background: rgba(2, 6, 16, 0.78) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  z-index: 100000 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.mobile-drawer-backdrop.active {
  opacity: 1 !important;
  pointer-events: auto !important;
}

.mobile-drawer-sheet {
  position: fixed !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: min(88vw, 390px) !important;
  max-width: 100vw !important;
  height: 100% !important;
  height: 100dvh !important;
  background: #080f22 !important;
  border-left: 1px solid rgba(56, 189, 248, 0.25) !important;
  box-shadow: -14px 0 45px rgba(0, 0, 0, 0.8) !important;
  z-index: 100001 !important;
  display: flex !important;
  flex-direction: column !important;
  transform: translateX(100%) !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.32s !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

.mobile-drawer-sheet.active {
  transform: translateX(0) !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

/* ANTI-OVERFLOW RULES FOR HERO, BG & CONTROLS */
html, body {
  overflow-x: hidden !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

*, *::before, *::after {
  box-sizing: border-box !important;
}

.dynamic-bg-wrapper {
  overflow: hidden !important;
  max-width: 100vw !important;
  width: 100% !important;
}
.bg-slide {
  max-width: 100vw !important;
}
.hero-super-canvas, .hero-col-content, .hero-col-interactive {
  max-width: 100% !important;
  width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}
.hero-pill-badge {
  display: flex !important;
  flex-wrap: wrap !important;
  max-width: 100% !important;
  width: fit-content !important;
  border-radius: 12px !important;
  white-space: normal !important;
  word-break: break-word !important;
  line-height: 1.4 !important;
  box-sizing: border-box !important;
}
.hero-pill-badge span {
  white-space: normal !important;
  word-break: break-word !important;
  max-width: 100% !important;
}
.sales-conversion-hero-bar > div > div {
  min-width: 0 !important;
}
.sales-conversion-hero-bar {
  padding: 1.2rem 1rem !important;
}
.allocator-controls,
.slider-group,
.allocator-summary-panel {
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}

/* CRITERIA & BANDO ZERO-OVERFLOW RULES */
.bando-grid {
  grid-template-columns: minmax(0, 1fr) !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}
.bando-main, .bando-sidebar {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}
.interactive-card {
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}
.criteria-row {
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}
.criteria-left {
  min-width: 0 !important;
  flex: 1 1 0 !important;
}
.criteria-title, .criteria-desc {
  word-break: break-word !important;
  overflow-wrap: break-word !important;
}

.mobile-drawer-header {
  padding: 1rem 1.25rem !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  background: rgba(10, 18, 38, 0.9) !important;
  flex-shrink: 0 !important;
}

.mobile-drawer-brand {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
}

.mobile-drawer-brand img {
  width: 34px !important;
  height: 34px !important;
  border-radius: 8px !important;
  border: 1px solid var(--accent-gold) !important;
}

.mobile-drawer-close {
  width: 42px !important;
  height: 42px !important;
  border-radius: 10px !important;
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: #cbd5e1 !important;
  font-size: 1.15rem !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  touch-action: manipulation !important;
  transition: all 0.2s ease !important;
}

.mobile-drawer-close:active {
  background: rgba(239, 68, 68, 0.2) !important;
  color: #ef4444 !important;
  transform: scale(0.92);
}

.mobile-drawer-body {
  flex: 1 !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  padding: 1rem 1.25rem 2.5rem !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 1.25rem !important;
}

.drawer-section-title {
  font-size: 0.72rem !important;
  font-weight: 800 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.08em !important;
  color: var(--accent-gold) !important;
  margin-bottom: 0.5rem !important;
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
}

.drawer-nav-list {
  display: flex !important;
  flex-direction: column !important;
  gap: 0.35rem !important;
}

.drawer-link {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 0.7rem 0.9rem !important;
  border-radius: 10px !important;
  text-decoration: none !important;
  color: #e2e8f0 !important;
  font-size: 0.92rem !important;
  font-weight: 600 !important;
  background: rgba(255, 255, 255, 0.03) !important;
  border: 1px solid rgba(255, 255, 255, 0.05) !important;
  transition: all 0.18s ease !important;
  min-height: 46px !important;
}

.drawer-link:active, .drawer-link.active {
  background: rgba(14, 165, 233, 0.18) !important;
  border-color: rgba(56, 189, 248, 0.4) !important;
  color: #38bdf8 !important;
}

.drawer-link.highlight-gold {
  border-color: rgba(223, 177, 91, 0.4) !important;
  color: var(--accent-gold) !important;
  background: rgba(223, 177, 91, 0.08) !important;
}

.drawer-link-left {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
}

.drawer-link-icon {
  font-size: 1.15rem !important;
  width: 24px !important;
  text-align: center !important;
}

.drawer-link-badge {
  font-size: 0.65rem !important;
  padding: 2px 7px !important;
  border-radius: 999px !important;
  background: rgba(14, 165, 233, 0.2) !important;
  color: #38bdf8 !important;
  font-weight: 700 !important;
}

.drawer-footer-cta {
  padding-top: 0.5rem !important;
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
}

/* 6. FLOATING HUD & A11Y COLLISION SHIELD */
@media (max-width: 1023px) {
  .quick-nav-hud {
    bottom: calc(64px + max(8px, env(safe-area-inset-bottom, 0px))) !important;
    right: 14px !important;
    z-index: 9995 !important;
  }
  .a11y-fab-trigger {
    bottom: calc(64px + max(8px, env(safe-area-inset-bottom, 0px))) !important;
    left: 14px !important;
    z-index: 9995 !important;
    width: 42px !important;
    height: 42px !important;
    border-radius: 50% !important;
    justify-content: center !important;
    align-items: center !important;
    display: flex !important;
    padding: 0 !important;
  }
  .a11y-fab-trigger span {
    display: none !important;
  }
  .site-footer, .portal-footer {
    padding-bottom: calc(88px + max(8px, env(safe-area-inset-bottom, 0px))) !important;
  }
  #cookieBanner, .cookie-consent-card {
    bottom: calc(64px + max(8px, env(safe-area-inset-bottom, 0px))) !important;
    left: 10px !important;
    right: 10px !important;
    width: auto !important;
    max-width: 100% !important;
    border-radius: 14px !important;
    padding: 12px 14px !important;
    z-index: 10010 !important;
  }
}

/* 7. GRID BREAKPOINT HARMONIZATION */
@media (max-width: 768px) {
  .grid-2col,
  .grid-3col,
  .acts-grid,
  .comuni-detail-grid,
  .comuni-grid-2,
  .comuni-grid-4,
  .reasons-grid,
  .link-cards-grid,
  .hero-super-canvas,
  .video-feature-hero,
  .allocator-grid,
  .triad-cards-grid,
  .kpi-bento-grid,
  .footer-grid {
    grid-template-columns: 1fr !important;
  }
  .hero-trust-ribbon,
  .stats-counter-grid,
  .card-metrics-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 0.75rem !important;
  }
  .hero-grand-title {
    font-size: clamp(1.85rem, 7vw, 2.75rem) !important;
    line-height: 1.2 !important;
  }
  .hero-lead-text {
    font-size: 0.98rem !important;
    line-height: 1.6 !important;
  }
  .hero-actions-row {
    flex-direction: column !important;
    width: 100% !important;
    gap: 0.75rem !important;
  }
  .hero-actions-row button,
  .hero-actions-row a {
    width: 100% !important;
    min-height: 48px !important;
    justify-content: center !important;
    font-size: 0.95rem !important;
  }
  .cinema-modal-box,
  .doc-modal-container,
  .a11y-panel-box,
  .dao-modal-card {
    width: 95vw !important;
    max-width: 95vw !important;
    max-height: 90vh !important;
    margin: auto !important;
    padding: 1.25rem !important;
  }
  table {
    display: block !important;
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
  /* Prevent iOS zoom on inputs */
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="number"],
  input[type="search"],
  textarea,
  select {
    font-size: 16px !important;
  }
}

/* ==========================================================================
   MOBILE FIRST VERO SYSTEM (WCAG 2.1 AA & iOS/Android Native UX)
   Ergonomia Touch, Bottom App Bar, Off-Canvas Drawer, Fluid Typography & Anti-Overflow
   ========================================================================== */

/* 1. GLOBAL MOBILE RESETS & ANTI-OVERFLOW */
html {
  box-sizing: border-box;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

*, *::before, *::after {
  box-sizing: inherit;
}

body {
  overflow-x: hidden !important;
  width: 100% !important;
  max-width: 100vw !important;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

body.mobile-drawer-open {
  overflow: hidden !important;
  touch-action: none;
}

/* 2. FLUID CONTAINERS & TYPOGRAPHY */
.container, .page-container {
  width: 100% !important;
  max-width: 100% !important;
  padding-left: 1rem !important;
  padding-right: 1rem !important;
  margin-left: auto !important;
  margin-right: auto !important;
  box-sizing: border-box !important;
}

@media (min-width: 768px) {
  .container, .page-container {
    padding-left: 1.5rem !important;
    padding-right: 1.5rem !important;
  }
}

@media (min-width: 1200px) {
  .container {
    max-width: 1360px !important;
    padding-left: 2rem !important;
    padding-right: 2rem !important;
  }
}

/* 3. TOP APPBAR ISTITUZIONALE RESPONSIVE */
.top-appbar {
  height: 60px !important;
  position: sticky !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 9980 !important;
  background: rgba(6, 10, 20, 0.92) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.appbar-inner {
  max-width: 1360px !important;
  width: 100% !important;
  height: 100% !important;
  padding: 0 1rem !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 0.5rem !important;
  box-sizing: border-box !important;
}

.brand-wrapper {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  text-decoration: none !important;
  min-width: 0 !important;
}

.brand-logo-img {
  width: 36px !important;
  height: 36px !important;
  border-radius: 8px !important;
  border: 1.5px solid var(--accent-gold) !important;
  box-shadow: 0 0 12px rgba(223, 177, 91, 0.3) !important;
  flex-shrink: 0 !important;
}

.brand-title {
  font-size: clamp(0.92rem, 3.8vw, 1.15rem) !important;
  font-weight: 800 !important;
  letter-spacing: 0.03em !important;
  white-space: nowrap !important;
  color: #fff !important;
}

.brand-title-gold {
  color: var(--accent-gold) !important;
}

.brand-claim {
  display: none !important;
}

@media (min-width: 680px) {
  .brand-claim {
    display: block !important;
    font-size: 0.72rem !important;
    color: #94a3b8 !important;
    white-space: nowrap !important;
  }
}

/* HAMBURGER TOGGLE BUTTON */
.nav-toggle {
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
  width: 44px !important;
  height: 44px !important;
  padding: 8px !important;
  background: rgba(14, 165, 233, 0.12) !important;
  border: 1px solid rgba(56, 189, 248, 0.3) !important;
  border-radius: 10px !important;
  cursor: pointer !important;
  touch-action: manipulation !important;
  transition: all 0.2s ease !important;
  gap: 5px !important;
  flex-shrink: 0 !important;
}

.nav-toggle:active {
  transform: scale(0.94);
  background: rgba(14, 165, 233, 0.22) !important;
}

.nav-toggle span {
  display: block !important;
  width: 22px !important;
  height: 2px !important;
  background: #38bdf8 !important;
  border-radius: 2px !important;
  transition: all 0.25s ease !important;
}

.nav-toggle.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg) !important;
}
.nav-toggle.open span:nth-child(2) {
  opacity: 0 !important;
  transform: scaleX(0) !important;
}
.nav-toggle.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg) !important;
}

@media (min-width: 1024px) {
  .nav-toggle {
    display: none !important;
  }
  .desktop-nav-tabs {
    display: flex !important;
  }
}

@media (max-width: 1023px) {
  .desktop-nav-tabs {
    display: none !important;
  }
  .top-scarcity-box {
    display: none !important;
  }
}

/* 4. NATIVE MOBILE BOTTOM APP BAR (THUMB NAVIGATION) */
.mobile-bottom-nav {
  display: flex !important;
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  z-index: 9990 !important;
  background: rgba(6, 10, 20, 0.94) !important;
  backdrop-filter: blur(24px) !important;
  -webkit-backdrop-filter: blur(24px) !important;
  border-top: 1px solid rgba(56, 189, 248, 0.25) !important;
  box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.6) !important;
  padding: 4px 6px max(6px, env(safe-area-inset-bottom, 0px)) !important;
  justify-content: space-around !important;
  align-items: center !important;
  box-sizing: border-box !important;
}

@media (min-width: 1024px) {
  .mobile-bottom-nav {
    display: none !important;
  }
}

.mobile-bottom-tab {
  flex: 1 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 6px 2px !important;
  text-decoration: none !important;
  color: #94a3b8 !important;
  background: transparent !important;
  border: none !important;
  cursor: pointer !important;
  touch-action: manipulation !important;
  transition: all 0.15s ease !important;
  border-radius: 8px !important;
  min-height: 48px !important;
  position: relative !important;
}

.mobile-tab-icon {
  font-size: 1.22rem !important;
  line-height: 1 !important;
  margin-bottom: 3px !important;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.mobile-tab-label {
  font-size: 0.68rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.02em !important;
  white-space: nowrap !important;
  transition: color 0.15s ease !important;
}

.mobile-bottom-tab:active .mobile-tab-icon {
  transform: scale(0.88) !important;
}

.mobile-bottom-tab.active {
  color: #38bdf8 !important;
}

.mobile-bottom-tab.active .mobile-tab-label {
  color: #38bdf8 !important;
  font-weight: 800 !important;
}

.mobile-bottom-tab.active::after {
  content: '' !important;
  position: absolute !important;
  top: 1px !important;
  width: 18px !important;
  height: 3px !important;
  border-radius: 2px !important;
  background: var(--brand-sky) !important;
  box-shadow: 0 0 8px var(--brand-sky) !important;
}

.mobile-bottom-tab.tab-gold.active {
  color: var(--accent-gold) !important;
}

.mobile-bottom-tab.tab-gold.active::after {
  background: var(--accent-gold) !important;
  box-shadow: 0 0 8px var(--accent-gold) !important;
}

/* 5. PRESTIGE OFF-CANVAS MOBILE DRAWER */
.mobile-drawer-backdrop {
  position: fixed !important;
  inset: 0 !important;
  background: rgba(2, 6, 16, 0.78) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  z-index: 100000 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.mobile-drawer-backdrop.active {
  opacity: 1 !important;
  pointer-events: auto !important;
}

.mobile-drawer-sheet {
  position: fixed !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: min(88vw, 390px) !important;
  max-width: 100vw !important;
  height: 100% !important;
  height: 100dvh !important;
  background: #080f22 !important;
  border-left: 1px solid rgba(56, 189, 248, 0.25) !important;
  box-shadow: -14px 0 45px rgba(0, 0, 0, 0.8) !important;
  z-index: 100001 !important;
  display: flex !important;
  flex-direction: column !important;
  transform: translateX(100%) !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.32s !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

.mobile-drawer-sheet.active {
  transform: translateX(0) !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

/* ANTI-OVERFLOW RULES FOR HERO, BG & CONTROLS */
html, body {
  overflow-x: hidden !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

*, *::before, *::after {
  box-sizing: border-box !important;
}

.dynamic-bg-wrapper {
  overflow: hidden !important;
  max-width: 100vw !important;
  width: 100% !important;
}
.bg-slide {
  max-width: 100vw !important;
}
.hero-super-canvas, .hero-col-content, .hero-col-interactive {
  max-width: 100% !important;
  width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}
.hero-pill-badge {
  display: flex !important;
  flex-wrap: wrap !important;
  max-width: 100% !important;
  width: fit-content !important;
  border-radius: 12px !important;
  white-space: normal !important;
  word-break: break-word !important;
  line-height: 1.4 !important;
  box-sizing: border-box !important;
}
.hero-pill-badge span {
  white-space: normal !important;
  word-break: break-word !important;
  max-width: 100% !important;
}
.sales-conversion-hero-bar > div > div {
  min-width: 0 !important;
}
.sales-conversion-hero-bar {
  padding: 1.2rem 1rem !important;
}
.allocator-controls,
.slider-group,
.allocator-summary-panel {
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}

/* CRITERIA & BANDO ZERO-OVERFLOW RULES */
.bando-grid {
  grid-template-columns: minmax(0, 1fr) !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}
.bando-main, .bando-sidebar {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}
.interactive-card {
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}
.criteria-row {
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}
.criteria-left {
  min-width: 0 !important;
  flex: 1 1 0 !important;
}
.criteria-title, .criteria-desc {
  word-break: break-word !important;
  overflow-wrap: break-word !important;
}

.mobile-drawer-header {
  padding: 1rem 1.25rem !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  background: rgba(10, 18, 38, 0.9) !important;
  flex-shrink: 0 !important;
}

.mobile-drawer-brand {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
}

.mobile-drawer-brand img {
  width: 34px !important;
  height: 34px !important;
  border-radius: 8px !important;
  border: 1px solid var(--accent-gold) !important;
}

.mobile-drawer-close {
  width: 42px !important;
  height: 42px !important;
  border-radius: 10px !important;
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: #cbd5e1 !important;
  font-size: 1.15rem !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  touch-action: manipulation !important;
  transition: all 0.2s ease !important;
}

.mobile-drawer-close:active {
  background: rgba(239, 68, 68, 0.2) !important;
  color: #ef4444 !important;
  transform: scale(0.92);
}

.mobile-drawer-body {
  flex: 1 !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  padding: 1rem 1.25rem 2.5rem !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 1.25rem !important;
}

.drawer-section-title {
  font-size: 0.72rem !important;
  font-weight: 800 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.08em !important;
  color: var(--accent-gold) !important;
  margin-bottom: 0.5rem !important;
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
}

.drawer-nav-list {
  display: flex !important;
  flex-direction: column !important;
  gap: 0.35rem !important;
}

.drawer-link {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 0.7rem 0.9rem !important;
  border-radius: 10px !important;
  text-decoration: none !important;
  color: #e2e8f0 !important;
  font-size: 0.92rem !important;
  font-weight: 600 !important;
  background: rgba(255, 255, 255, 0.03) !important;
  border: 1px solid rgba(255, 255, 255, 0.05) !important;
  transition: all 0.18s ease !important;
  min-height: 46px !important;
}

.drawer-link:active, .drawer-link.active {
  background: rgba(14, 165, 233, 0.18) !important;
  border-color: rgba(56, 189, 248, 0.4) !important;
  color: #38bdf8 !important;
}

.drawer-link.highlight-gold {
  border-color: rgba(223, 177, 91, 0.4) !important;
  color: var(--accent-gold) !important;
  background: rgba(223, 177, 91, 0.08) !important;
}

.drawer-link-left {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
}

.drawer-link-icon {
  font-size: 1.15rem !important;
  width: 24px !important;
  text-align: center !important;
}

.drawer-link-badge {
  font-size: 0.65rem !important;
  padding: 2px 7px !important;
  border-radius: 999px !important;
  background: rgba(14, 165, 233, 0.2) !important;
  color: #38bdf8 !important;
  font-weight: 700 !important;
}

.drawer-footer-cta {
  padding-top: 0.5rem !important;
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
}

/* 6. FLOATING HUD & A11Y COLLISION SHIELD */
@media (max-width: 1023px) {
  .quick-nav-hud {
    bottom: calc(64px + max(8px, env(safe-area-inset-bottom, 0px))) !important;
    right: 14px !important;
    z-index: 9995 !important;
  }
  .a11y-fab-trigger {
    bottom: calc(64px + max(8px, env(safe-area-inset-bottom, 0px))) !important;
    left: 14px !important;
    z-index: 9995 !important;
    width: 42px !important;
    height: 42px !important;
    border-radius: 50% !important;
    justify-content: center !important;
    align-items: center !important;
    display: flex !important;
    padding: 0 !important;
  }
  .a11y-fab-trigger span {
    display: none !important;
  }
  .site-footer, .portal-footer {
    padding-bottom: calc(88px + max(8px, env(safe-area-inset-bottom, 0px))) !important;
  }
  #cookieBanner, .cookie-consent-card {
    bottom: calc(64px + max(8px, env(safe-area-inset-bottom, 0px))) !important;
    left: 10px !important;
    right: 10px !important;
    width: auto !important;
    max-width: 100% !important;
    border-radius: 14px !important;
    padding: 12px 14px !important;
    z-index: 10010 !important;
  }
}

/* 7. GRID BREAKPOINT HARMONIZATION */
@media (max-width: 768px) {
  .grid-2col,
  .grid-3col,
  .acts-grid,
  .comuni-detail-grid,
  .comuni-grid-2,
  .comuni-grid-4,
  .reasons-grid,
  .link-cards-grid,
  .hero-super-canvas,
  .video-feature-hero,
  .allocator-grid,
  .triad-cards-grid,
  .kpi-bento-grid,
  .footer-grid {
    grid-template-columns: 1fr !important;
  }
  .hero-trust-ribbon,
  .stats-counter-grid,
  .card-metrics-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 0.75rem !important;
  }
  .hero-grand-title {
    font-size: clamp(1.85rem, 7vw, 2.75rem) !important;
    line-height: 1.2 !important;
  }
  .hero-lead-text {
    font-size: 0.98rem !important;
    line-height: 1.6 !important;
  }
  .hero-actions-row {
    flex-direction: column !important;
    width: 100% !important;
    gap: 0.75rem !important;
  }
  .hero-actions-row button,
  .hero-actions-row a {
    width: 100% !important;
    min-height: 48px !important;
    justify-content: center !important;
    font-size: 0.95rem !important;
  }
  .cinema-modal-box,
  .doc-modal-container,
  .a11y-panel-box,
  .dao-modal-card {
    width: 95vw !important;
    max-width: 95vw !important;
    max-height: 90vh !important;
    margin: auto !important;
    padding: 1.25rem !important;
  }
  table {
    display: block !important;
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
  /* Prevent iOS zoom on inputs */
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="number"],
  input[type="search"],
  textarea,
  select {
    font-size: 16px !important;
  }
}

/* 8. UI/UX PRO MAX & ULTIMATE PERFORMANCE TOKENS */
:focus-visible {
  outline: 2px solid var(--accent-gold, #dfb15b) !important;
  outline-offset: 3px !important;
}

button, .btn, .mobile-bottom-tab, .drawer-link, .interactive-card, .criteria-row {
  transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

button:active, .btn:active, .mobile-bottom-tab:active {
  transform: scale(0.97) !important;
}

/* Fluid image rendering without layout shift */
img {
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}

/* Video container optimization */
video {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
}
