﻿:root {
  /* Nuova palette Regione Lombardia */
  --rl-blue: #005f9b;
  --rl-green: #63b032;
  --rl-light-green: #c3dc9c;
  
  /* Sistema Colori Light */
  --bg-app: #f8fafc;
  --bg-surface: #ffffff;
  --bg-alt: #eff3f7;
  
  --text-main: #1e293b;
  --text-muted: #475569;
  
  --border-light: #e2e8f0;
  
  --color-primary: var(--rl-blue);
  --color-primary-hover: #004d80;
  --color-secondary: var(--rl-green);
  --color-accent: var(--rl-light-green);
  
  /* Typography */
  --font-family: 'Work Sans', sans-serif;
  --fs-xs: 0.875rem;
  --fs-sm: 1rem;
  --fs-base: 1.125rem;
  --fs-lg: 1.5rem;
  --fs-xl: 2.25rem;
  --fs-2xl: 3rem;
  
  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-24: 6rem;
  
  /* Shadows & Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 24px;
  
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.12);
  
  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

[data-theme="dark"] {
  --bg-app: #0f172a;
  --bg-surface: #1e293b;
  --bg-alt: #334155;
  
  --text-main: #f8fafc;
  --text-muted: #cbd5e1;
  
  --border-light: #334155;
  
  --color-primary: #3b82f6; /* A lighter blue for dark mode readability */
  --color-primary-hover: #60a5fa;
  --color-secondary: var(--rl-light-green);
  --color-accent: var(--rl-green);
  
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.2);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.3);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.4);
}

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

html {
  scroll-behavior: smooth;
  font-family: var(--font-family);
  color: var(--text-main);
  background-color: var(--bg-app);
  font-size: 16px;
  line-height: 1.6;
}

body {
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Typography */
h1, h2, h3, h4 {
  font-weight: 600;
  line-height: 1.2;
  color: var(--text-main);
}
h1 { font-size: clamp(var(--fs-xl), 5vw, var(--fs-2xl)); letter-spacing: -0.02em; }
h2 { font-size: clamp(var(--fs-lg), 4vw, var(--fs-xl)); letter-spacing: -0.01em; margin-bottom: var(--space-6); }
h3 { font-size: var(--fs-lg); margin-bottom: var(--space-4); }

p { margin-bottom: var(--space-4); color: var(--text-muted); }
p.lead { font-size: var(--fs-base); color: var(--text-muted); }
.small { font-size: var(--fs-sm); }
.eyebrow {
  display: inline-block;
  font-size: var(--fs-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-primary);
  margin-bottom: var(--space-2);
}

/* Layout */
.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}
section {
  padding: var(--space-16) 0;
}
.section-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto var(--space-12) auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  transition: var(--transition);
}
[data-theme="dark"] .site-header {
  background-color: rgba(30, 41, 59, 0.9);
}
.nav-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 72px;
}
.brand {
  font-size: var(--fs-lg);
  font-weight: 600;
  text-decoration: none;
  color: var(--color-primary);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.logo-dot {
  width: 12px;
  height: 12px;
  background-color: var(--color-secondary);
  border-radius: 50%;
  display: inline-block;
}
.nav-links {
  display: none;
  gap: var(--space-6);
}
@media (min-width: 768px) {
  .nav-links { display: flex; }
}
.nav-links a {
  text-decoration: none;
  color: var(--text-main);
  font-weight: 500;
  font-size: var(--fs-sm);
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--color-primary); }

.nav-controls {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}
.toggle-group {
  display: flex;
  background: var(--bg-alt);
  border-radius: var(--radius-sm);
  padding: 2px;
}
.toggle-group button {
  border: none;
  background: transparent;
  padding: var(--space-1) var(--space-2);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.toggle-group button[aria-pressed="true"] {
  background: var(--bg-surface);
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
}

.theme-btn {
  background: none;
  border: none;
  color: var(--text-main);
  cursor: pointer;
  padding: var(--space-2);
  display: flex;
  align-items: center;
  border-radius: var(--radius-sm);
  background-color: var(--bg-alt);
  transition: var(--transition);
}
.theme-btn:hover { background-color: var(--border-light); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2) var(--space-6);
  border-radius: var(--radius-sm);
  font-weight: 500;
  text-decoration: none;
  transition: var(--transition);
  cursor: pointer;
  border: 2px solid transparent;
  font-size: var(--fs-base);
}
.btn.primary {
  background-color: var(--color-primary);
  color: #ffffff;
}
.btn.primary:hover {
  background-color: var(--color-primary-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
[data-theme="dark"] .btn.primary { color: #0f172a; }

.btn.ghost {
  background-color: transparent;
  border-color: var(--border-light);
  color: var(--text-main);
}
.btn.ghost:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

/* Hero Section */
.hero {
  padding-top: var(--space-16);
  padding-bottom: var(--space-16);
  display: grid;
  gap: var(--space-12);
  align-items: center;
}
@media (min-width: 992px) {
  .hero {
    grid-template-columns: 1fr 1fr;
    padding-top: var(--space-24);
  }
}
.hero-content .cta-row {
  display: flex;
  gap: var(--space-4);
  margin-top: var(--space-8);
  flex-wrap: wrap;
}
.hero-visual {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: linear-gradient(135deg, var(--bg-alt) 0%, var(--bg-surface) 100%);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Decorazione Lombarda nel visual */
.hl-decorator {
  position: absolute;
  width: 150%;
  height: 150%;
  background: radial-gradient(circle at center, var(--rl-light-green) 0%, transparent 60%);
  opacity: 0.15;
  top: -25%;
  left: -25%;
}

/* Feature Cards Grid (Home Bullets) */
.features-grid {
  display: grid;
  gap: var(--space-6);
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  margin-top: var(--space-12);
}
.feature-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  transition: var(--transition);
}
.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-secondary);
}
.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-alt);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-4);
}
.feature-icon svg { width: 24px; height: 24px; }

/* The Vs Section (Problem/Solution) */
.vs-section {
  background-color: var(--bg-alt);
  border-radius: var(--radius-lg);
  padding: var(--space-12);
  display: grid;
  gap: var(--space-8);
}
@media (min-width: 768px) {
  .vs-section { grid-template-columns: 1fr 1fr; }
}
.vs-col h3 {
  border-bottom: 2px solid var(--border-light);
  padding-bottom: var(--space-2);
  margin-bottom: var(--space-6);
}
.vs-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.vs-list li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  background: var(--bg-surface);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.vs-icon.bad { color: #ef4444; }
.vs-icon.good { color: var(--color-secondary); }
.vs-icon svg { width: 24px; height: 24px; }

/* Product Cards */
.products-wrapper {
  display: grid;
  gap: var(--space-6);
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}
.product-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  display: flex;
  flex-direction: column;
  position: relative;
  transition: var(--transition);
}
.product-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
}
.product-card.popular {
  border: 2px solid var(--color-primary);
  transform: scale(1.02);
}
.product-card.popular:hover {
  transform: scale(1.02) translateY(-8px);
}
.badge-popular {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--color-primary);
  color: #fff;
  padding: 4px 16px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.product-price {
  font-size: var(--fs-xl);
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: var(--space-6);
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.product-price span { font-size: var(--fs-sm); color: var(--text-muted); font-weight: 400; }
.product-features { list-style: none; margin-bottom: var(--space-8); flex-grow: 1; }
.product-features li {
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-muted);
}
.product-features li:last-child { border-bottom: none; }

/* Bento Layout per Business / Info */
.bento-grid {
  display: grid;
  gap: var(--space-6);
  grid-template-columns: 1fr;
}
@media (min-width: 768px) {
  .bento-grid { grid-template-columns: repeat(3, 1fr); grid-auto-rows: minmax(200px, auto); }
  .bento-card.wide { grid-column: 1 / -1; }
  .bento-card.tall { grid-row: span 2; }
}
.bento-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: var(--transition);
}
.bento-card:hover {
  box-shadow: var(--shadow-md);
}

/* Forms */
.form-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  box-shadow: var(--shadow-lg);
  max-width: 600px;
  margin: 0 auto;
}
.form-group { margin-bottom: var(--space-4); }
.form-group label {
  display: block;
  font-size: var(--fs-sm);
  font-weight: 500;
  margin-bottom: var(--space-2);
  color: var(--text-main);
}
.form-control {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background-color: var(--bg-app);
  color: var(--text-main);
  font-family: inherit;
  font-size: var(--fs-base);
  transition: border-color 0.2s;
}
.form-control:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(0, 95, 155, 0.1);
}
select.form-control { cursor: pointer; }
.form-success {
  display: none;
  margin-top: var(--space-4);
  padding: var(--space-4);
  background-color: rgba(99, 176, 50, 0.1);
  color: var(--color-secondary);
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-secondary);
  font-weight: 500;
}
.form-success.visible { display: block; }

/* Footer */
.site-footer {
  background-color: var(--bg-alt);
  padding: var(--space-8) 0;
  border-top: 1px solid var(--border-light);
  text-align: center;
  color: var(--text-muted);
}

/* Animations */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  animation: revealUp 0.8s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}
@keyframes revealUp {
  to { opacity: 1; transform: translateY(0); }
}
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
