/* ============================
   CALMA CONSULENZE - MAIN CSS
   Roma | Commercialisti SRL/SRLS
   ============================ */

:root {
  --primary: #1a3a5c;
  --primary-dark: #0e2340;
  --primary-light: #2d5986;
  --accent: #c8a84b;
  --accent-dark: #a88a3a;
  --accent-light: #e4c97a;
  --white: #ffffff;
  --off-white: #f8f6f1;
  --light-gray: #f2f0eb;
  --gray: #8a8a8a;
  --dark: #1a1a1a;
  --text: #2c2c2c;
  --text-light: #666666;
  --border: #e0ddd8;
  --success: #2e7d52;
  --error: #c0392b;
  --shadow-sm: 0 2px 8px rgba(26,58,92,0.08);
  --shadow-md: 0 8px 30px rgba(26,58,92,0.12);
  --shadow-lg: 0 20px 60px rgba(26,58,92,0.18);
  --radius: 8px;
  --radius-lg: 16px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* RESET & BASE */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
/*
  OVERFLOW-X: entrambi html e body devono avere overflow-x:hidden.
  Su Android Chrome, se solo body ha il valore, html può comunque
  espandersi e mostrare scroll orizzontale. Entrambi devono averlo.
*/
html {
  scroll-behavior: smooth;
  font-size: 16px;
  overflow-x: hidden; /* CRITICO per Android Chrome */
}
body {
  font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
  color: var(--text);
  background: var(--white);
  line-height: 1.6;
  overflow-x: hidden;
  /*
    NON usare max-width:100vw — su Android Chrome, 100vw include
    la larghezza della scrollbar verticale (~15px), causando overflow.
    width:100% è relativo al containing block e non causa problemi.
  */
  width: 100%;
}
img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea { font-family: inherit; }
h1,h2,h3,h4,h5,h6 { line-height: 1.25; font-weight: 700; }

/* TYPOGRAPHY */
.text-primary { color: var(--primary); }
.text-accent { color: var(--accent); }
.text-white { color: var(--white); }
.text-light { color: var(--text-light); }
.font-light { font-weight: 300; }
.font-regular { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.text-center { text-align: center; }
.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.text-4xl { font-size: 2.25rem; }
.text-5xl { font-size: 3rem; }

/* LAYOUT */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.container-sm { max-width: 800px; margin: 0 auto; padding: 0 24px; }
.section { padding: 90px 0; }
.section-sm { padding: 60px 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }

/* SECTION HEADER */
.section-tag {
  display: inline-block;
  background: rgba(200,168,75,0.15);
  color: var(--accent-dark);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 6px 16px;
  border-radius: 100px;
  margin-bottom: 16px;
  border: 1px solid rgba(200,168,75,0.3);
}
.section-title {
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  color: var(--primary);
  margin-bottom: 16px;
  font-weight: 800;
}
.section-subtitle {
  font-size: 1.05rem;
  color: var(--text-light);
  max-width: 580px;
  line-height: 1.7;
}
.section-header { margin-bottom: 56px; }
.section-header.centered { text-align: center; }
.section-header.centered .section-subtitle { margin: 0 auto; }

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  transition: var(--transition);
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent);
  color: var(--primary-dark);
  box-shadow: 0 4px 16px rgba(200,168,75,0.35);
}
.btn-primary:hover {
  background: var(--accent-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(200,168,75,0.45);
}
.btn-outline {
  border: 2px solid var(--white);
  color: var(--white);
  background: transparent;
}
.btn-outline:hover {
  background: var(--white);
  color: var(--primary);
}
.btn-outline-primary {
  border: 2px solid var(--primary);
  color: var(--primary);
  background: transparent;
}
.btn-outline-primary:hover {
  background: var(--primary);
  color: var(--white);
}
.btn-ghost {
  color: var(--accent);
  padding: 14px 0;
  font-weight: 600;
}
.btn-ghost:hover { color: var(--accent-dark); }
.btn-lg { padding: 18px 40px; font-size: 1.05rem; }
.btn-sm { padding: 10px 22px; font-size: 0.85rem; }
.btn-full { width: 100%; justify-content: center; }

/* ========================
   NAVBAR
   ======================== */
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: transparent;
  transition: var(--transition);
}
#navbar.scrolled {
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
}
.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  max-width: 1200px;
  margin: 0 auto;
}
/* ========================
   LOGO NAVBAR — SOLUZIONE DEFINITIVA
   ─────────────────────────────────────────────
   FILE USATO: logo-calma-nero.png (logo ufficiale, sfondo bianco opaco)

   TECNICA: mix-blend-mode: multiply
   Su sfondo SCURO (navy): multiply rende il bianco pienamente
   trasparente perché bianco × colore_scuro = colore_scuro → invisibile.
   Gli elementi neri (icona + testo) restano scuri ma sul blu diventano
   visibili per contrasto. Aggiungiamo filter:invert(1) brightness(2)
   per convertire il nero in bianco brillante sul dark background.

   Su sfondo CHIARO (navbar scrollata): mix-blend-mode:normal,
   filter:none → logo nero su bianco, classico e nitido.

   RISULTATO: zero riquadri, zero box grigi, logo organico all'header.
   ======================== */
.navbar-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
  background: transparent;
}

/* ── LOGO: unica immagine, due modalità via CSS ── */
.navbar-logo-img-white,
.navbar-logo-img-dark {
  height: 44px;
  width: auto;
  max-width: 240px;
  flex-shrink: 0;
  object-fit: contain;
  transition: filter 0.35s ease;
}

/*
  Su hero scuro (default):
  - invert(1): nero → bianco
  - brightness(1.15): leggermente più luminoso
  - mix-blend-mode: normal: nessun blending, il bianco è già visibile
  Usiamo solo un'immagine: navbar-logo-img-dark (l'originale nera)
  La classe -white è nascosta (era la versione JPEG con sfondo grigio)
*/
.navbar-logo-img-white {
  display: none; /* nascosta: è il JPEG con sfondo grigio indesiderato */
}

.navbar-logo-img-dark {
  display: block;
  /*
    TECNICA DEFINITIVA su sfondo scuro:
    1. invert(1): nero → bianco (testo e icona diventano bianchi)
    2. mix-blend-mode: screen: il nero residuo (ex sfondo bianco → nero
       dopo invert) sparisce perché nero × qualsiasi = nero → invisibile
    Risultato: logo bianco su sfondo trasparente, ZERO riquadri.
  */
  filter: invert(1) brightness(1.15);
  mix-blend-mode: screen;
}

/* Dopo scroll (navbar bianca): logo nero originale, nessun filtro, nessun blend */
#navbar.scrolled .navbar-logo-img-dark {
  filter: none;
  mix-blend-mode: normal;
}

/* ── FOOTER LOGO ── sfondo sempre scuro → invert + screen */
.footer-logo-img-official {
  height: 52px;
  width: auto;
  max-width: 260px;
  display: block;
  margin-bottom: 16px;
  object-fit: contain;
  filter: invert(1) brightness(1.15);
  mix-blend-mode: screen;
}

/* ── MOBILE MENU LOGO ── sfondo scuro del drawer → invert + screen */
.mobile-logo-img-official {
  height: 40px;
  width: auto;
  max-width: 210px;
  display: block;
  object-fit: contain;
  filter: invert(1) brightness(1.15);
  mix-blend-mode: screen;
}

/* Rimuovere stili SVG obsoleti */
.navbar-logo-svg,
.footer-logo-svg,
.mobile-logo-svg {
  display: none;
}

/* Rimuovere stili vecchi */
.navbar-logo-img,
.footer-logo-img,
.navbar-logo-img-official {
  display: none;
}

/* Manteniamo le variabili testo logo per eventuale uso futuro */
.navbar-logo-text { display: none; }
.navbar-logo-name,
.navbar-logo-sub  { display: none; }

/* Mantenuto per compatibilità */
.logo-icon {
  width: 40px;
  height: 40px;
  background: var(--accent);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1.1rem;
  color: var(--primary-dark);
  flex-shrink: 0;
}
.logo-text-main {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--white);
  transition: var(--transition);
  line-height: 1.1;
}
.logo-text-sub {
  font-size: 0.65rem;
  font-weight: 500;
  color: rgba(255,255,255,0.75);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: var(--transition);
}
#navbar.scrolled .logo-text-main { color: var(--primary); }
#navbar.scrolled .logo-text-sub { color: var(--text-light); }

.navbar-menu {
  display: flex;
  align-items: center;
  gap: 32px;
}
.nav-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(255,255,255,0.9);
  transition: var(--transition);
  position: relative;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.3s;
}
.nav-link:hover::after, .nav-link.active::after { width: 100%; }
.nav-link:hover, .nav-link.active { color: var(--white); }
#navbar.scrolled .nav-link { color: var(--text); }
#navbar.scrolled .nav-link:hover, #navbar.scrolled .nav-link.active { color: var(--primary); }

.navbar-cta {
  display: flex;
  align-items: center;
  gap: 12px;
}
.nav-phone {
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(255,255,255,0.9);
  font-size: 0.85rem;
  font-weight: 600;
  transition: var(--transition);
}
#navbar.scrolled .nav-phone { color: var(--primary); }
.nav-phone:hover { color: var(--accent); }

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
}
.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: var(--transition);
}
#navbar.scrolled .hamburger span { background: var(--primary); }
.hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* Mobile menu */
.mobile-menu {
  display: none;
  position: fixed;
  top: 0;
  right: -110%; /* Oltre il 100% per garantire che sia sempre fuori schermo */
  width: min(300px, 85vw); /* Mai più di 85vw — evita overflow su schermi stretti */
  height: 100vh;
  height: 100dvh; /* dynamic viewport height su mobile */
  background: var(--primary-dark);
  z-index: 999;
  transition: right 0.35s cubic-bezier(0.4,0,0.2,1);
  padding: 100px 28px 32px;
  flex-direction: column;
  gap: 8px;
  /* CRITICO: il menu non deve mai contribuire alla larghezza del documento */
  overflow-x: hidden;
}
.mobile-menu.open { right: 0; display: flex; }
.mobile-nav-link {
  color: var(--white);
  font-size: 1rem;
  font-weight: 500;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  transition: var(--transition);
}
.mobile-nav-link:hover { color: var(--accent); padding-left: 8px; }
.mobile-menu-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 998;
}
.mobile-menu-overlay.open { display: block; }

/* ========================
   HERO
   ======================== */
#hero {
  position: relative;
  min-height: 100vh;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 55%, var(--primary-light) 100%);
  display: flex;
  align-items: center;
  /* overflow: hidden rimosso: causava clipping del testo su mobile.
     Il clipping delle decorazioni geometriche è gestito via clip sul singolo elemento. */
  overflow: visible;
}
.hero-bg-pattern {
  position: absolute;
  inset: 0;
  overflow: hidden; /* overflow spostato qui: contiene solo i gradienti decorativi */
  pointer-events: none;
  background-image: 
    radial-gradient(circle at 20% 80%, rgba(200,168,75,0.12) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(200,168,75,0.08) 0%, transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(255,255,255,0.03) 0%, transparent 60%);
}
.hero-geometric {
  position: absolute;
  right: -80px;
  top: 50%;
  transform: translateY(-50%);
  width: 600px;
  height: 600px;
  border-radius: 50%;
  border: 1px solid rgba(200,168,75,0.15);
  animation: slowRotate 30s linear infinite;
  /* CRITICO: questo elemento assoluto non deve allargare il contenitore */
  pointer-events: none;
}
.hero-geometric::before {
  content: '';
  position: absolute;
  inset: 40px;
  border-radius: 50%;
  border: 1px solid rgba(200,168,75,0.1);
}
.hero-geometric::after {
  content: '';
  position: absolute;
  inset: 100px;
  border-radius: 50%;
  border: 1px solid rgba(200,168,75,0.08);
}
@keyframes slowRotate { to { transform: translateY(-50%) rotate(360deg); } }

.hero-content {
  position: relative;
  z-index: 2;
  padding: 120px 0 80px;
  max-width: 1200px;
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 64px;
  align-items: center;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(200,168,75,0.2);
  border: 1px solid rgba(200,168,75,0.4);
  color: var(--accent-light);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 8px 16px;
  border-radius: 100px;
  margin-bottom: 24px;
}
.hero-badge .dot {
  width: 6px;
  height: 6px;
  background: var(--accent-light);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

.hero-title {
  font-size: clamp(2.2rem, 4.5vw, 3.5rem);
  color: var(--white);
  line-height: 1.15;
  margin-bottom: 24px;
  font-weight: 800;
}
.hero-title .accent-line {
  color: var(--accent);
  display: block;
  /* Leggero incremento dimensionale sulla chiusura dorata:
     rafforza la gerarchia visiva senza rompere l'armonia */
  font-size: 1.08em;
  letter-spacing: -0.02em;
}
.hero-subtitle {
  font-size: 1.1rem;
  color: rgba(255,255,255,0.8);
  line-height: 1.75;
  margin-bottom: 0; /* spacing gestito da .hero-closing */
  max-width: 560px;
}
.hero-subtitle strong { color: var(--white); }

/* Closing statement hero — frase finale ad alto impatto */
.hero-closing {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--white);
  line-height: 1.5;
  margin-top: 20px;
  margin-bottom: 40px;
  padding-top: 20px;
  border-top: 1px solid rgba(200, 168, 75, 0.35); /* linea oro sottile come separatore */
  letter-spacing: -0.01em;
}
.hero-ctas {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 48px;
}
.hero-stats {
  display: flex;
  gap: 40px;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.15);
}
.stat-item {}
.stat-number {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}
.stat-label {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.65);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Hero card */
.hero-card {
  background: rgba(255,255,255,0.97);
  border-radius: var(--radius-lg);
  padding: 36px;
  box-shadow: var(--shadow-lg);
  position: relative;
}
.hero-card-tag {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-dark);
  margin-bottom: 8px;
}
.hero-card-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 8px;
}
.hero-card-subtitle {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 24px;
  line-height: 1.5;
}
.hero-card-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-group label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--primary);
}
.form-input, .form-select, .form-textarea {
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  color: var(--text);
  background: var(--white);
  transition: var(--transition);
  outline: none;
  width: 100%;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,58,92,0.08);
}
.form-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238a8a8a' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
.form-textarea { resize: vertical; min-height: 80px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.privacy-note {
  font-size: 0.72rem;
  color: var(--text-light);
  margin-top: 4px;
  text-align: center;
  line-height: 1.5;
}
.privacy-note a { color: var(--primary); text-decoration: underline; }

/* ========================
   PROBLEMA / SOLUZIONE
   ======================== */
#problema {
  background: var(--off-white);
  padding: 80px 0;
}
.problema-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.problema-side {
  padding: 48px;
  background: var(--white);
}
.problema-side.soluzione {
  background: var(--primary);
  color: var(--white);
}
.problema-label {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--error);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.problema-label.sol { color: var(--accent); }
.problema-side.soluzione .problema-label { color: var(--accent); }
.problema-heading {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 24px;
  line-height: 1.3;
}
.soluzione .problema-heading { color: var(--white); }
.problema-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  line-height: 1.5;
}
.soluzione .problema-list li { border-color: rgba(255,255,255,0.1); color: rgba(255,255,255,0.85); }
.problema-list li:last-child { border-bottom: none; }
.list-icon { width: 20px; flex-shrink: 0; margin-top: 2px; }

/* ========================
   SERVIZI
   ======================== */
#servizi { background: var(--white); }
.servizi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.servizio-card {
  background: var(--off-white);
  border-radius: var(--radius-lg);
  padding: 36px 28px;
  transition: var(--transition);
  cursor: pointer;
  border: 1.5px solid transparent;
  position: relative;
  overflow: hidden;
}
.servizio-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s;
}
.servizio-card:hover::before, .servizio-card.featured::before { transform: scaleX(1); }
.servizio-card:hover {
  background: var(--white);
  border-color: rgba(200,168,75,0.3);
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}
.servizio-card.featured {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
  transform: scale(1.02);
}
.servizio-icon {
  width: 52px;
  height: 52px;
  background: rgba(200,168,75,0.15);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 20px;
  transition: var(--transition);
}
.servizio-card.featured .servizio-icon { background: rgba(200,168,75,0.2); }
.servizio-card:hover .servizio-icon { background: var(--accent); }
.servizio-card.featured:hover .servizio-icon { background: rgba(200,168,75,0.3); }
.servizio-nome {
  font-size: 1rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 10px;
}
.servizio-card.featured .servizio-nome { color: var(--white); }
.servizio-desc {
  font-size: 0.85rem;
  color: var(--text-light);
  line-height: 1.65;
  margin-bottom: 20px;
}
.servizio-card.featured .servizio-desc { color: rgba(255,255,255,0.75); }
.servizio-link {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent-dark);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}
.servizio-card.featured .servizio-link { color: var(--accent-light); }
.servizio-link:hover { gap: 10px; }
.servizio-badge {
  display: inline-block;
  background: var(--accent);
  color: var(--primary-dark);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 100px;
  margin-bottom: 8px;
}

/* ========================
   FINANZA AGEVOLATA SPOTLIGHT
   ======================== */
#finanza {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  padding: 90px 0;
  position: relative;
  overflow: hidden;
}
#finanza::before {
  content: '';
  position: absolute;
  top: -100px;
  right: -100px;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(200,168,75,0.12), transparent 70%);
  /* Il padre ha overflow:hidden — questo rimane contenuto */
  pointer-events: none;
}
.finanza-inner { display: grid; grid-template-columns: 1fr 420px; gap: 64px; align-items: center; }
.finanza-tag {
  display: inline-block;
  background: rgba(200,168,75,0.2);
  border: 1px solid rgba(200,168,75,0.4);
  color: var(--accent-light);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 6px 16px;
  border-radius: 100px;
  margin-bottom: 16px;
}
.finanza-title {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800;
  color: var(--white);
  margin-bottom: 16px;
  line-height: 1.25;
}
.finanza-title .hl { color: var(--accent); }
.finanza-text {
  font-size: 0.95rem;
  color: rgba(255,255,255,0.8);
  line-height: 1.75;
  margin-bottom: 32px;
}
.bandi-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 36px;
}
.bando-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius);
  padding: 14px 16px;
  transition: var(--transition);
}
.bando-item:hover { background: rgba(200,168,75,0.12); border-color: rgba(200,168,75,0.3); }
.bando-dot {
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  flex-shrink: 0;
}
.bando-text { font-size: 0.875rem; color: rgba(255,255,255,0.9); font-weight: 500; }

.finanza-cta-box {
  background: rgba(255,255,255,0.97);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow-lg);
}
.finanza-cta-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 8px;
  line-height: 1.3;
}
.finanza-cta-sub {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 24px;
  line-height: 1.5;
}
.checklist {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}
.checklist-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.875rem;
  color: var(--text);
  font-weight: 500;
}
.check-icon {
  width: 20px;
  height: 20px;
  background: rgba(46,125,82,0.12);
  color: var(--success);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  flex-shrink: 0;
  font-weight: 700;
}

/* ========================
   NUMERI / SOCIAL PROOF
   ======================== */
#numeri {
  background: var(--off-white);
  padding: 70px 0;
}
.numeri-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
}
.numero-item {
  text-align: center;
  padding: 32px 20px;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.numero-item:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.numero-value {
  font-size: 3rem;
  font-weight: 900;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 4px;
}
.numero-value .num-accent { color: var(--accent); }
.numero-label {
  font-size: 0.825rem;
  color: var(--text-light);
  font-weight: 500;
  margin-top: 8px;
  line-height: 1.4;
}

/* ========================
   PERCHÉ CALMA
   ======================== */
#perche { background: var(--white); }
.perche-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}
.perche-visual {
  position: relative;
}
.perche-main-card {
  background: var(--primary);
  border-radius: var(--radius-lg);
  padding: 40px;
  color: var(--white);
  position: relative;
  overflow: hidden;
}
.perche-main-card::before {
  content: '';
  position: absolute;
  bottom: -40px;
  right: -40px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: rgba(200,168,75,0.12);
}
.perche-card-value {
  font-size: 3.5rem;
  font-weight: 900;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 8px;
}
.perche-card-label {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 8px;
}
.perche-card-sub { font-size: 0.85rem; color: rgba(255,255,255,0.7); line-height: 1.5; }

.perche-mini-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}
.perche-mini {
  background: var(--off-white);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  transition: var(--transition);
}
.perche-mini:hover { background: var(--light-gray); }
.perche-mini-icon { font-size: 1.5rem; margin-bottom: 8px; }
.perche-mini-text { font-size: 0.78rem; font-weight: 600; color: var(--primary); line-height: 1.3; }

.perche-points {
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.perche-point {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}
.perche-point-num {
  width: 44px;
  height: 44px;
  background: rgba(200,168,75,0.12);
  border: 2px solid rgba(200,168,75,0.3);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 900;
  color: var(--accent-dark);
  flex-shrink: 0;
}
.perche-point-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 6px;
}
.perche-point-text { font-size: 0.875rem; color: var(--text-light); line-height: 1.65; }

/* ========================
   PROCESSO
   ======================== */
#processo { background: var(--off-white); }
.processo-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  position: relative;
}
.processo-steps::before {
  content: '';
  position: absolute;
  top: 40px;
  left: calc(12.5% + 20px);
  right: calc(12.5% + 20px);
  height: 2px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-light) 100%);
  z-index: 0;
}
.step-item {
  position: relative;
  z-index: 1;
  text-align: center;
}
.step-num {
  width: 80px;
  height: 80px;
  background: var(--white);
  border: 3px solid var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--primary);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.step-item:hover .step-num {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--primary-dark);
  transform: scale(1.1);
  box-shadow: 0 8px 24px rgba(200,168,75,0.4);
}
.step-title { font-size: 0.95rem; font-weight: 700; color: var(--primary); margin-bottom: 8px; }
.step-text { font-size: 0.82rem; color: var(--text-light); line-height: 1.6; }
.step-cta { margin-top: 12px; }
.step-chip {
  display: inline-block;
  background: var(--accent);
  color: var(--primary-dark);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 100px;
}

/* ========================
   TEAM
   ======================== */
#team { background: var(--white); }
.team-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.team-card {
  background: var(--off-white);
  border-radius: var(--radius-lg);
  padding: 28px 22px;
  text-align: center;
  transition: var(--transition);
  border: 1.5px solid transparent;
}
.team-card:hover {
  background: var(--white);
  border-color: var(--border);
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}
.team-avatar {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--white);
  border: 3px solid var(--accent);
}
.team-name { font-size: 0.95rem; font-weight: 700; color: var(--primary); margin-bottom: 4px; }
.team-role { font-size: 0.78rem; color: var(--accent-dark); font-weight: 600; margin-bottom: 8px; }
.team-exp { font-size: 0.78rem; color: var(--text-light); line-height: 1.5; }

/* ========================
   TESTIMONIANZE
   ======================== */
#testimonianze { background: var(--off-white); }
.testi-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.testi-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  position: relative;
  border: 1.5px solid transparent;
}
.testi-card:hover {
  border-color: rgba(200,168,75,0.3);
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}
.testi-quote {
  font-size: 2rem;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 12px;
}
.testi-text {
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.7;
  font-style: italic;
  margin-bottom: 24px;
}
.testi-stars { color: var(--accent); font-size: 0.8rem; margin-bottom: 12px; }
.testi-author { display: flex; align-items: center; gap: 12px; }
.testi-avatar {
  width: 44px;
  height: 44px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--white);
  flex-shrink: 0;
}
.testi-name { font-size: 0.875rem; font-weight: 700; color: var(--primary); }
.testi-company { font-size: 0.75rem; color: var(--text-light); }
.testi-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(200,168,75,0.12);
  color: var(--accent-dark);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 100px;
}

/* ========================
   APPUNTAMENTO / CTA FINALE
   ======================== */
#appuntamento {
  background: var(--white);
  padding: 90px 0;
}
.appuntamento-inner {
  display: grid;
  grid-template-columns: 1fr 520px;
  gap: 64px;
  align-items: start;
}
.appuntamento-left {}
.appointment-types {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 36px;
}
.apt-type {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--off-white);
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  border: 2px solid transparent;
}
.apt-type:hover, .apt-type.selected {
  background: var(--white);
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}
.apt-type-icon {
  width: 44px;
  height: 44px;
  background: var(--primary);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.apt-type-title { font-size: 0.9rem; font-weight: 700; color: var(--primary); }
.apt-type-sub { font-size: 0.78rem; color: var(--text-light); margin-top: 2px; }

.guarantees {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.guarantee-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--text-light);
}
.guarantee-icon { color: var(--success); font-size: 1rem; }

/* Full CTA form */
.cta-form-box {
  background: var(--off-white);
  border-radius: var(--radius-lg);
  padding: 40px;
  border: 1.5px solid var(--border);
}
.cta-form-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 6px;
}
.cta-form-sub {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 28px;
  line-height: 1.5;
}
.cta-form { display: flex; flex-direction: column; gap: 14px; }

/* ========================
   BANNER CTA
   ======================== */
#banner-cta {
  background: linear-gradient(135deg, var(--accent-dark) 0%, var(--accent) 100%);
  padding: 70px 0;
  text-align: center;
}
#banner-cta .container { max-width: 700px; }
.banner-cta-title {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 900;
  color: var(--primary-dark);
  margin-bottom: 12px;
  line-height: 1.25;
}
.banner-cta-sub {
  font-size: 1rem;
  color: rgba(14,35,64,0.75);
  margin-bottom: 32px;
  line-height: 1.6;
}
.banner-cta-buttons { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; }
.btn-dark {
  background: var(--primary-dark);
  color: var(--white);
  box-shadow: 0 4px 16px rgba(14,35,64,0.35);
}
.btn-dark:hover {
  background: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(14,35,64,0.45);
}
.btn-white-outline {
  border: 2px solid var(--primary-dark);
  color: var(--primary-dark);
  background: transparent;
}
.btn-white-outline:hover {
  background: var(--primary-dark);
  color: var(--white);
}

/* ========================
   FOOTER
   ======================== */
#footer {
  background: var(--primary-dark);
  color: var(--white);
  padding: 64px 0 32px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 48px;
  margin-bottom: 48px;
}
.footer-logo { margin-bottom: 16px; }
.footer-desc {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.6);
  line-height: 1.7;
  margin-bottom: 20px;
}
.footer-badges { display: flex; gap: 8px; flex-wrap: wrap; }
.footer-badge {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.7);
  font-size: 0.65rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 100px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.footer-heading {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 20px;
}
.footer-links { display: flex; flex-direction: column; gap: 10px; }
.footer-link {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.65);
  transition: var(--transition);
}
.footer-link:hover { color: var(--accent); padding-left: 4px; }
.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.7);
  line-height: 1.5;
}
.contact-item .ci-icon { font-size: 0.9rem; margin-top: 2px; flex-shrink: 0; color: var(--accent); }
.footer-divider { border: none; border-top: 1px solid rgba(255,255,255,0.1); margin-bottom: 28px; }

/* ── BLOCCO ISTITUZIONALE FOOTER ── */
.footer-institutional {
  text-align: center;
  padding: 24px 0 20px;
  border-top: 1px solid rgba(200,168,75,0.2); /* linea oro tenue — separa dal grid */
  margin-bottom: 20px;
}
.footer-inst-name {
  font-size: 0.82rem;
  font-weight: 800;
  color: rgba(255,255,255,0.9);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.footer-inst-subtitle {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--accent-light);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.footer-inst-data {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 10px;
  font-size: 0.76rem;
  color: rgba(255,255,255,0.5);
  margin-bottom: 14px;
  line-height: 1.6;
}
.footer-inst-sedi {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 6px 10px;
  font-size: 0.74rem;
  color: rgba(255,255,255,0.45);
  line-height: 1.6;
}
.footer-inst-sede {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: baseline;
}
.footer-inst-label {
  font-weight: 700;
  color: rgba(255,255,255,0.65);
  margin-right: 3px;
}
.footer-inst-sep {
  color: rgba(255,255,255,0.2);
  font-size: 0.8rem;
}
.footer-inst-link {
  color: rgba(255,255,255,0.6);
  text-decoration: underline;
  transition: color 0.2s;
}
.footer-inst-link:hover { color: var(--accent-light); }

/* ── FOOTER BOTTOM ── */
.footer-bottom {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.07);
}
.footer-legal {
  font-size: 0.73rem;
  color: rgba(255,255,255,0.35);
  line-height: 1.6;
  text-align: center;
}
.footer-legal a { color: rgba(255,255,255,0.5); text-decoration: underline; }
.footer-piva { font-size: 0.75rem; color: rgba(255,255,255,0.4); }

/* ========================
   CHATBOT AI
   ======================== */
#chatbot-trigger {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 900;
}
.chatbot-btn {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--accent-dark), var(--accent));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  box-shadow: 0 8px 24px rgba(200,168,75,0.5);
  transition: var(--transition);
  color: var(--primary-dark);
  position: relative;
}
.chatbot-btn:hover { transform: scale(1.1); box-shadow: 0 12px 32px rgba(200,168,75,0.6); }
.chatbot-pulse {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 16px;
  height: 16px;
  background: #e53e3e;
  border-radius: 50%;
  border: 2px solid var(--white);
  animation: chatPulse 2s ease-in-out infinite;
}
@keyframes chatPulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.2); opacity: 0.8; } }

.chatbot-tooltip {
  position: absolute;
  bottom: 70px;
  right: 0;
  background: var(--white);
  border-radius: var(--radius);
  padding: 10px 14px;
  box-shadow: var(--shadow-md);
  white-space: nowrap; /* su desktop va bene */
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
  pointer-events: none;
  max-width: min(220px, 80vw); /* safety cap responsive */
}
.chatbot-tooltip::after {
  content: '';
  position: absolute;
  bottom: -6px;
  right: 22px;
  width: 12px;
  height: 12px;
  background: var(--white);
  transform: rotate(45deg);
  box-shadow: 2px 2px 4px rgba(0,0,0,0.08);
}

.chatbot-window {
  display: none;
  position: fixed;
  bottom: 100px;
  right: 28px;
  /* Larghezza fissa su desktop; ridimensionata nelle media query mobili */
  width: 360px;
  max-height: 520px;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 901;
  flex-direction: column;
  overflow: hidden;
  border: 1.5px solid var(--border);
}
.chatbot-window.open { display: flex; animation: slideUpIn 0.3s cubic-bezier(0.4,0,0.2,1); }
@keyframes slideUpIn { from { opacity: 0; transform: translateY(20px) scale(0.95); } to { opacity: 1; transform: translateY(0) scale(1); } }
.chat-header {
  background: var(--primary);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.chat-avatar {
  width: 36px;
  height: 36px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: var(--primary-dark);
  font-weight: 700;
  flex-shrink: 0;
}
.chat-header-info {}
.chat-header-name { font-size: 0.875rem; font-weight: 700; color: var(--white); }
.chat-header-status { font-size: 0.7rem; color: rgba(255,255,255,0.7); }
.chat-close {
  margin-left: auto;
  color: rgba(255,255,255,0.7);
  font-size: 1.2rem;
  cursor: pointer;
  transition: var(--transition);
  background: none;
  border: none;
  line-height: 1;
}
.chat-close:hover { color: var(--white); }
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 340px;
}
.chat-msg {
  max-width: 85%;
  animation: msgIn 0.25s ease;
}
@keyframes msgIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.chat-msg.bot { align-self: flex-start; }
.chat-msg.user { align-self: flex-end; }
.chat-bubble {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.84rem;
  line-height: 1.55;
}
.chat-msg.bot .chat-bubble {
  background: var(--off-white);
  color: var(--text);
  border-bottom-left-radius: 4px;
}
.chat-msg.user .chat-bubble {
  background: var(--primary);
  color: var(--white);
  border-bottom-right-radius: 4px;
}
.chat-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 16px 8px;
}
.chat-option-btn {
  background: rgba(26,58,92,0.08);
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 100px;
  border: 1.5px solid rgba(26,58,92,0.15);
  cursor: pointer;
  transition: var(--transition);
}
.chat-option-btn:hover { background: var(--primary); color: var(--white); border-color: var(--primary); }
.chat-input-area {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  align-items: center;
}
.chat-input {
  flex: 1;
  padding: 9px 14px;
  border: 1.5px solid var(--border);
  border-radius: 100px;
  font-size: 0.84rem;
  outline: none;
  transition: var(--transition);
}
.chat-input:focus { border-color: var(--primary); }
.chat-send {
  width: 36px;
  height: 36px;
  background: var(--primary);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  flex-shrink: 0;
}
.chat-send:hover { background: var(--accent); color: var(--primary-dark); }

/* ========================
   STICKY PHONE BAR
   ======================== */
.sticky-phone {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 850;
  background: var(--primary-dark);
  padding: 12px 20px;
  gap: 12px;
  justify-content: center;
  align-items: center;
}
.sticky-phone-text {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.75);
  text-align: center;
}
.sticky-phone a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: var(--primary-dark);
  font-size: 0.875rem;
  font-weight: 700;
  padding: 10px 20px;
  border-radius: var(--radius);
  white-space: nowrap;
}

/* ========================
   MODAL SUCCESSO
   ======================== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1100;
  align-items: center;
  justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 48px;
  max-width: 480px;
  width: 90%;
  text-align: center;
  animation: modalIn 0.35s cubic-bezier(0.4,0,0.2,1);
}
@keyframes modalIn { from { opacity: 0; transform: scale(0.85); } to { opacity: 1; transform: scale(1); } }
.modal-icon {
  width: 72px;
  height: 72px;
  background: rgba(46,125,82,0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin: 0 auto 24px;
}
.modal-title { font-size: 1.4rem; font-weight: 800; color: var(--primary); margin-bottom: 12px; }
.modal-text { font-size: 0.9rem; color: var(--text-light); line-height: 1.7; margin-bottom: 28px; }

/* ========================
   WHATSAPP BTN
   ======================== */
.wa-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #25d366;
  color: var(--white) !important;
  border-radius: var(--radius);
  padding: 14px 24px;
  font-weight: 700;
  font-size: 0.9rem;
  transition: var(--transition);
  box-shadow: 0 4px 16px rgba(37,211,102,0.35);
}
.wa-btn:hover { background: #1ebe5b; transform: translateY(-2px); box-shadow: 0 8px 24px rgba(37,211,102,0.45); }

/* Variante hero del wa-btn: più grande su desktop.
   Sostituisce gli inline styles che non rispondono alle media query. */
.wa-btn-hero {
  font-size: 1rem;
  padding: 18px 28px;
}

/* ========================
   ANIMATIONS & UTILITIES
   ======================== */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in.visible { opacity: 1; transform: translateY(0); }
.fade-in-delay-1 { transition-delay: 0.1s; }
.fade-in-delay-2 { transition-delay: 0.2s; }
.fade-in-delay-3 { transition-delay: 0.3s; }
.fade-in-delay-4 { transition-delay: 0.4s; }

/* ========================
   RESPONSIVE
   ======================== */

/* ── TABLET (≤1024px) ── */
@media (max-width: 1024px) {
  .hero-content { grid-template-columns: 1fr; gap: 48px; }
  .hero-geometric { display: none; }
  .hero-card { max-width: 480px; }
  .finanza-inner { grid-template-columns: 1fr; }
  .perche-grid { grid-template-columns: 1fr; }
  .appuntamento-inner { grid-template-columns: 1fr; }
  .team-grid { grid-template-columns: repeat(2, 1fr); }
  .numeri-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  /* Finanza cta box: limita larghezza su tablet */
  .finanza-cta-box { max-width: 100%; }
}

/* ══════════════════════════════════════════════
   MOBILE OTTIMIZZATO (≤768px)
   Revisione tecnica completa — responsive debug.
   Desktop: INVARIATO.
   ══════════════════════════════════════════════ */
@media (max-width: 768px) {

  /* ════ RESET GLOBALE MOBILE ════
     Fix definitivo overflow su device fisici Android/Chrome.
     Ogni regola qui ha una ragione tecnica precisa. */
  *, *::before, *::after {
    box-sizing: border-box;
  }
  html, body {
    overflow-x: hidden;
    /* max-width su html/body: previene espansione su Android Chrome
       anche quando un figlio assoluto/fixed sfora temporaneamente */
    max-width: 100%;
  }
  /* Word-wrap sui soli elementi di testo (NON su div generico:
     causerebbe problemi a position:absolute/fixed su Android) */
  h1, h2, h3, h4, h5, h6, p, li, span, a, label {
    overflow-wrap: break-word;
    word-break: normal;
  }
  /* Tutti i blocchi layout devono stare nel viewport */
  section, article, aside, header, footer, nav, main {
    max-width: 100%;
    overflow-x: hidden;
  }

  /* ════ 1. NAVBAR MOBILE ════ */
  .navbar-inner {
    padding: 14px 18px;
    gap: 0;
    min-height: 60px; /* altezza minima garantita */
  }
  .navbar-logo-img-white,
  .navbar-logo-img-dark {
    height: 36px;
    max-width: 190px;
    width: auto;
    flex-shrink: 0;
  }
  .navbar-menu { display: none; }
  .navbar-cta .btn { display: none; }
  .nav-phone {
    font-size: 0.8rem;
    gap: 5px;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .hamburger {
    display: flex;
    padding: 8px;
    gap: 5px;
    flex-shrink: 0;
  }
  .hamburger span { width: 22px; height: 2px; }

  /* Trust bar: scorrevole orizzontalmente */
  .trust-bar-inner {
    gap: 14px;
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0 18px;
  }
  .trust-bar-inner::-webkit-scrollbar { display: none; }
  .trust-sep { display: none; }

  /* ════ 2. HERO SECTION ════ */
  #hero {
    min-height: 100svh;
    min-height: 100vh; /* fallback */
    align-items: flex-start;
    overflow: visible; /* testo non clippato */
  }
  .hero-content {
    grid-template-columns: 1fr;
    padding: 94px 20px 60px;
    gap: 40px;
    width: 100%;
  }
  .hero-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    min-width: 0; /* previene overflow in flexbox */
  }

  /* Badge intro */
  .hero-badge {
    display: inline-flex;
    font-size: 0.65rem;
    letter-spacing: 0.07em;
    padding: 8px 14px;
    gap: 8px;
    margin-bottom: 20px;
    max-width: 100%;
    white-space: normal;
    line-height: 1.45;
    text-align: left;
    /* Previene il badge di strabordare lateralmente */
    box-sizing: border-box;
  }
  .hero-badge .dot {
    flex-shrink: 0;
    align-self: flex-start;
    margin-top: 4px;
  }

  /* Titolo principale */
  .hero-title {
    font-size: clamp(1.85rem, 7.5vw, 2.4rem);
    line-height: 1.2;
    margin-bottom: 18px;
    overflow-wrap: break-word;
    hyphens: manual;
    width: 100%;
  }
  .hero-title .accent-line {
    display: block;
    margin-top: 2px;
    overflow-wrap: break-word;
  }

  /* Paragrafo descrittivo */
  .hero-subtitle {
    font-size: 0.96rem;
    line-height: 1.75;
    margin-bottom: 0;
    color: rgba(255,255,255,0.82);
    max-width: 100%;
    width: 100%;
  }

  /* Closing statement */
  .hero-closing {
    font-size: 1.05rem;
    margin-top: 18px;
    margin-bottom: 32px;
    padding-top: 16px;
    width: 100%;
  }

  /* CTA Pulsanti: full-width, tap-friendly */
  .hero-ctas {
    flex-direction: column;
    gap: 12px;
    width: 100%;
    margin-bottom: 40px;
  }
  /* Rimuove white-space:nowrap dai bottoni su mobile */
  .btn { white-space: normal; }
  .hero-ctas .btn,
  .hero-ctas .wa-btn {
    width: 100%;
    justify-content: center;
    padding: 16px 20px;
    font-size: 0.95rem;
    min-height: 52px;
    white-space: normal;
    text-align: center;
  }

  /* Statistiche hero: 2 colonne */
  .hero-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px 16px;
    padding-top: 24px;
    width: 100%;
  }
  .stat-number { font-size: 1.65rem; }
  .stat-label  { font-size: 0.7rem; line-height: 1.35; }

  /* Hero card (form) */
  .hero-card {
    padding: 26px 20px;
    border-radius: 14px;
    max-width: 100%;
    width: 100%;
  }
  .hero-card-title { font-size: 1.05rem; }
  .hero-card-subtitle { font-size: 0.82rem; margin-bottom: 18px; }

  /* ════ 3. SEZIONI INTERNE ════ */
  .section { padding: 64px 0; }
  .section-sm { padding: 48px 0; }
  .container { padding: 0 20px; }
  .section-title { font-size: clamp(1.45rem, 5.8vw, 1.95rem); line-height: 1.25; }
  .section-subtitle { font-size: 0.93rem; line-height: 1.65; }
  .section-header { margin-bottom: 40px; }

  /* ════ 4. PROBLEMA / SOLUZIONE ════ */
  .problema-grid {
    grid-template-columns: 1fr;
    gap: 0; /* gap zero: le due metà si toccano con il gap del border-radius */
    overflow: visible; /* no clipping sul testo */
    border-radius: var(--radius-lg);
  }
  .problema-side {
    height: auto;
    min-height: 0;
    /* Rimuove border-radius interno che causava spazi vuoti */
    padding: 36px 24px;
  }
  .problema-side:first-child {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }
  .problema-side.soluzione {
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  }
  .problema-heading { font-size: 1.2rem; }
  .problema-list li { font-size: 0.88rem; }

  /* ════ 5. SERVIZI ════ */
  /* Due colonne compatte su 768px */
  .servizi-grid { grid-template-columns: 1fr 1fr; gap: 14px; }
  .servizio-card {
    padding: 20px 14px;
    overflow: visible; /* no clip del testo */
    height: auto;
    min-height: 0;
    /* Neutralizza il transform scale della .featured card che causa overflow */
    transform: none !important;
  }
  .servizio-card.featured { transform: none !important; }
  .servizio-icon {
    width: 44px;
    height: 44px;
    font-size: 1.6rem;
    margin-bottom: 12px;
  }
  .servizio-nome { font-size: 0.9rem; line-height: 1.3; }
  .servizio-desc { font-size: 0.8rem; line-height: 1.5; }

  /* ════ 6. FINANZA AGEVOLATA ════ */
  #finanza {
    /* overflow:hidden mantiene il ::before decorativo contenuto.
       Il contenuto testuale NON viene clippato perché è dentro
       .container che ha position:static e padding corretto. */
    overflow: hidden;
    /* Assicuriamo che la sezione non sfori in orizzontale */
    max-width: 100%;
  }
  .finanza-inner {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .finanza-title { font-size: clamp(1.4rem, 5.5vw, 1.8rem); }
  .finanza-cta-box {
    padding: 28px 22px; /* ridotto da 40px */
    width: 100%;
  }
  .finanza-benefit-box {
    flex-direction: column;
    gap: 12px;
    padding: 16px;
  }
  .finanza-benefit-icon { align-self: flex-start; }

  /* ════ 7. NUMERI / SOCIAL PROOF ════ */
  .numeri-grid { grid-template-columns: 1fr 1fr; gap: 16px; }
  /* Correzione: il CSS usava .numero-val ma l'HTML ha .numero-value */
  .numero-value { font-size: 2.2rem; }
  .numero-label { font-size: 0.8rem; }
  .numero-item { padding: 24px 16px; }

  /* ════ 8. PERCHÉ CALMA ════ */
  .perche-grid { grid-template-columns: 1fr; gap: 40px; }
  /* La card principale: teniamo overflow:hidden (come desktop)
     per contenere il cerchio decorativo ::before.
     Il testo non viene clippato perché il cerchio è in bottom-right
     e il testo è in alto-sinistra.
     IMPORTANTE: non usare overflow:visible qui o il cerchio
     decorativo sfora e allarga il documento su mobile. */
  .perche-main-card {
    overflow: hidden; /* ripristinato: necessario per contenere ::before */
    height: auto;
    padding: 32px 24px;
    /* Assicura che la card non sfori il contenitore */
    max-width: 100%;
    width: 100%;
  }
  .perche-card-value { font-size: 2.8rem; }
  .perche-point { gap: 16px; }
  .perche-point-num {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    font-size: 0.9rem;
  }
  .perche-point-title { font-size: 0.95rem; }
  .perche-point-text { font-size: 0.85rem; }
  /* Perché mini-cards: mantieni 2 colonne */
  .perche-mini-cards { grid-template-columns: 1fr 1fr; gap: 10px; }

  /* ════ 9. PROCESSO ════ */
  .processo-steps {
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }
  .processo-steps::before { display: none; }
  .step-num { width: 60px; height: 60px; font-size: 1.2rem; margin-bottom: 14px; }
  .step-title { font-size: 0.9rem; }
  .step-text { font-size: 0.8rem; }

  /* ════ 10. TEAM ════ */
  .team-grid { grid-template-columns: 1fr 1fr; gap: 16px; }
  .team-card {
    padding: 20px 14px;
    height: auto;
    min-height: 0;
    overflow: visible;
  }
  .team-name { font-size: 0.9rem; }
  .team-role { font-size: 0.73rem; line-height: 1.4; }
  /* Correzione: l'HTML usa .team-exp, non .team-bio */
  .team-exp { font-size: 0.78rem; line-height: 1.55; }
  .team-avatar { width: 64px; height: 64px; font-size: 1.2rem; }

  /* ════ 11. TESTIMONIANZE ════ */
  .testi-grid { grid-template-columns: 1fr; gap: 20px; }
  .testi-card { padding: 24px 20px; }
  .testi-text { font-size: 0.88rem; }

  /* ════ 12. APPUNTAMENTO / FORM CTA ════ */
  .appuntamento-inner { grid-template-columns: 1fr; gap: 40px; }
  .apt-type { padding: 14px 16px; gap: 12px; }
  .apt-type-icon { width: 38px; height: 38px; font-size: 1rem; }
  .apt-type-title { font-size: 0.88rem; }
  .apt-type-sub { font-size: 0.75rem; }
  /* CTA form box */
  .cta-form-box { padding: 28px 20px; }
  .cta-form-title { font-size: 1.15rem; }
  /* Form rows → single column */
  .form-row { grid-template-columns: 1fr; gap: 0; }
  /* Pulsanti nel blocco Appuntamento */
  #appuntamento .btn,
  #appuntamento .wa-btn {
    white-space: normal;
    min-height: 48px;
  }

  /* ════ 13. BANNER CTA ════ */
  #banner-cta { padding: 56px 0; }
  .banner-cta-title { font-size: clamp(1.35rem, 5.5vw, 1.8rem); }
  .banner-cta-sub { font-size: 0.92rem; }
  .banner-cta-buttons {
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }
  .banner-cta-buttons .btn {
    width: 100%;
    max-width: 340px;
    justify-content: center;
    white-space: normal;
    text-align: center;
  }

  /* ════ 14. FOOTER MOBILE ════ */
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .footer-logo-img-official { height: 40px; }
  .footer-desc { font-size: 0.83rem; }
  /* Footer istituzionale */
  .footer-institutional { padding: 20px 0 16px; }
  .footer-inst-name { font-size: 0.76rem; letter-spacing: 0.04em; }
  .footer-inst-subtitle { font-size: 0.72rem; }
  .footer-inst-data {
    flex-direction: column;
    gap: 4px;
    align-items: center;
    text-align: center;
  }
  .footer-inst-sep { display: none; }
  .footer-inst-sedi {
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
  }
  .footer-inst-sede {
    justify-content: center;
    text-align: center;
    flex-direction: column;
    align-items: center;
    gap: 2px;
  }
  .footer-bottom { flex-direction: column; text-align: center; gap: 10px; }
  /* Padding bottom footer: evita copertura da sticky bar */
  footer#footer {
    padding-bottom: max(36px, calc(72px + env(safe-area-inset-bottom)));
  }

  /* ════ 15. CHATBOT & STICKY PHONE ════ */

  /* Sticky phone bar: visibile (se attivata via JS) */
  /* N.B. L'HTML ha style="display:none;" in linea sul stickyPhone → questo
     CSS non la rende visibile automaticamente. Solo JS può togliere display:none
     inline. Il CSS qui è pronto nel caso venga attivata. */
  .sticky-phone {
    /* Non forzare display:flex: l'HTML ha display:none inline,
       la visibilità è controllata da JS */
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    z-index: 850;
  }

  /* Chatbot trigger: posizione di default (sticky bar nascosta) */
  #chatbot-trigger {
    bottom: 20px;
    right: 16px;
    transition: bottom 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  }

  /* Quando la sticky bar è visibile (JS aggiunge .sticky-visible al body),
     il chatbot si alza di 80px (altezza sticky bar ~64px + margine 16px)
     per non sovrapporsi mai al bottone WhatsApp della barra. */
  body.sticky-visible #chatbot-trigger,
  body.sticky-active #chatbot-trigger {
    bottom: 80px;
  }

  /* Finestra chat: si alza proporzionalmente quando la sticky bar è visibile */
  .chatbot-window {
    width: calc(100% - 32px);
    max-width: 340px;
    right: 16px;
    left: auto;
    bottom: 92px;
    max-height: 60svh;
    max-height: 60vh; /* fallback */
    transition: bottom 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  }
  body.sticky-visible .chatbot-window,
  body.sticky-active .chatbot-window {
    bottom: 152px; /* 80px (trigger alzato) + 60px (altezza trigger btn) + 12px margine */
  }

  /* Tooltip chat: no nowrap, si adatta al viewport */
  .chatbot-tooltip {
    white-space: normal;
    max-width: 200px;
    font-size: 0.75rem;
    padding: 8px 12px;
    right: 0;
    bottom: 70px;
  }

  /* Padding bottom sezione appuntamento:
     garantisce visibilità dei pulsanti senza copertura */
  #appuntamento { padding-bottom: 80px; }

  /* ════ 16. OVERFLOW ORIZZONTALE — SICUREZZA GLOBALE ════
     Elenco chirurgico dei contenitori che potrebbero eccedere.
     NON applicare max-width:100% a tutti i div genericamente:
     rompe position:absolute e fixed su Android Chrome. */

  /* Contenitori di layout strutturali */
  .section,
  .container,
  .container-sm {
    max-width: 100%;
    overflow-x: hidden; /* blocca eventuali figli che sfondano */
  }

  /* Contenitori di contenuto — possono crescere verticalmente */
  .hero-left,
  .hero-card,
  .hero-content,
  .servizio-card,
  .team-card,
  .testi-card,
  .numero-item,
  .step-item,
  .perche-point,
  .perche-points,
  .finanza-cta-box,
  .finanza-left,
  .cta-form-box,
  .appuntamento-left,
  .footer-grid,
  .footer-grid > * {
    max-width: 100%;
    min-width: 0; /* CRITICO: evita overflow in flex/grid figli */
    height: auto;
    min-height: 0;
  }

  /* Form elements: mai più larghi del parent */
  .form-input,
  .form-select,
  .form-textarea {
    max-width: 100%;
    width: 100%;
    min-width: 0;
  }

  /* Immagini: già gestite globalmente, rinforzo per sicurezza */
  img {
    max-width: 100%;
    height: auto;
  }
}

/* ══════════════════════════════════════════════
   SMALL MOBILE (≤480px) — refinements aggiuntivi
   ══════════════════════════════════════════════ */
@media (max-width: 480px) {

  /* Navbar ancora più compatta */
  .navbar-inner { padding: 12px 14px; }
  .navbar-logo-img-white,
  .navbar-logo-img-dark {
    height: 30px;
    max-width: 160px;
  }
  .nav-phone { font-size: 0.73rem; }

  /* Hero */
  .hero-content { padding: 86px 16px 52px; gap: 32px; }
  .hero-title {
    font-size: clamp(1.65rem, 7vw, 2rem);
    line-height: 1.22;
  }
  .hero-subtitle { font-size: 0.91rem; }
  .hero-closing {
    font-size: 1rem;
    margin-top: 14px;
    padding-top: 14px;
    margin-bottom: 28px;
  }
  .hero-badge {
    font-size: 0.6rem;
    padding: 6px 11px;
  }

  /* CTA full-width */
  .hero-ctas .btn,
  .hero-ctas .wa-btn {
    padding: 15px 18px;
    font-size: 0.9rem;
    min-height: 50px;
  }

  /* Stats */
  .hero-stats { gap: 16px 12px; }
  .stat-number { font-size: 1.45rem; }
  .stat-label  { font-size: 0.64rem; }

  /* Hero card */
  .hero-card { padding: 22px 16px; }
  .hero-card-title { font-size: 1rem; }

  /* Sezioni */
  .container { padding: 0 16px; }
  .section { padding: 52px 0; }
  .section-sm { padding: 40px 0; }
  .section-title { font-size: clamp(1.3rem, 5.5vw, 1.65rem); }
  .section-header { margin-bottom: 32px; }

  /* Problema/Soluzione */
  .problema-side { padding: 28px 18px; }
  .problema-heading { font-size: 1.1rem; }

  /* Servizi: 1 colonna su schermi <480px */
  .servizi-grid { grid-template-columns: 1fr; gap: 12px; }
  .servizio-card { padding: 20px 16px; }

  /* Finanza */
  .finanza-cta-box { padding: 22px 16px; }
  .finanza-title { font-size: clamp(1.3rem, 5.5vw, 1.6rem); }
  .bando-text { font-size: 0.82rem; }

  /* Numeri chiave */
  .numeri-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .numero-value { font-size: 2rem; }
  .numero-item { padding: 20px 12px; }
  .numero-label { font-size: 0.76rem; }

  /* Perché */
  .perche-main-card { padding: 26px 18px; }
  .perche-card-value { font-size: 2.5rem; }

  /* Processo: 1 colonna */
  .processo-steps { grid-template-columns: 1fr; gap: 16px; }
  .step-num { width: 56px; height: 56px; font-size: 1.1rem; }

  /* Team */
  .team-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .team-card { padding: 16px 12px; }
  .team-name { font-size: 0.85rem; }
  .team-role { font-size: 0.7rem; }
  .team-exp { font-size: 0.75rem; }
  .team-avatar { width: 56px; height: 56px; font-size: 1.1rem; margin-bottom: 12px; }

  /* Testimonianze */
  .testi-card { padding: 20px 16px; }
  .testi-text { font-size: 0.85rem; }

  /* Appuntamento */
  .cta-form-box { padding: 22px 16px; }
  .apt-type { padding: 12px 14px; }

  /* Banner CTA */
  .banner-cta-title { font-size: clamp(1.2rem, 5vw, 1.5rem); }

  /* Credenziali "Perché Calma" */
  .credenziali-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .credenziale-card { min-height: 130px; padding: 14px 10px 12px; }
  .credenziale-img-wrap { height: 56px; }
  .credenziale-photo-wrap { height: 56px; }
  .credenziale-label { font-size: 0.72rem; }

  /* Form */
  .form-row { grid-template-columns: 1fr; }

  /* Footer */
  .footer-logo-img-official { height: 34px; }
  .footer-badge { font-size: 0.65rem; padding: 3px 9px; }
  .footer-inst-name { font-size: 0.7rem; }
  .footer-inst-data { font-size: 0.72rem; }
  .footer-inst-sedi { font-size: 0.7rem; }

  /* Chatbot: posizione di default (sticky bar nascosta) */
  #chatbot-trigger {
    bottom: 18px;
    right: 14px;
    transition: bottom 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  }
  /* Con sticky bar visibile: alza il chatbot sopra la barra */
  body.sticky-visible #chatbot-trigger,
  body.sticky-active #chatbot-trigger {
    bottom: 78px;
  }
  .chatbot-window {
    /* NON usare 100vw: include scrollbar e causa overflow su Android */
    width: calc(100% - 28px);
    max-width: 320px;
    right: 14px;
    left: auto;
    bottom: 88px;
    transition: bottom 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  }
  body.sticky-visible .chatbot-window,
  body.sticky-active .chatbot-window {
    bottom: 148px;
  }
}

/* ========================
   CREDENZIALI GRID (4 quadranti "Perché Calma")
   ======================== */
.credenziali-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}

.credenziale-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 16px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  transition: var(--transition);
  min-height: 170px;
}
.credenziale-card:hover {
  border-color: rgba(200,168,75,0.4);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

/* Area immagine: altezza fissa per uniformità */
.credenziale-img-wrap {
  width: 100%;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.credenziale-img-wrap img {
  max-height: 80px;
  max-width: 100%;
  width: auto;
  object-fit: contain;
  display: block;
}

/* Wrap per icone SVG inline */
.credenziale-icon-wrap {
  background: rgba(192,57,43,0.06);
  border-radius: 50%;
  width: 80px;
  height: 80px;
  flex-shrink: 0;
}

/* Foto con bordo arrotondato — object-fit: contain per vederla intera */
.credenziale-photo-wrap {
  border-radius: 8px;
  overflow: hidden;
  width: 100%;
  height: 80px;
  background: transparent;
}
.credenziale-photo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

/* Fallback icona se img non carica */
.credenziale-icon-fallback {
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
}

/* Testo sotto l'immagine */
.credenziale-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--primary);
  text-align: center;
  line-height: 1.4;
}
/* Label più lunga (es. card Ordine Commercialisti) */
.credenziale-label.label-sm {
  font-size: 0.70rem;
  font-weight: 600;
}

/* Responsive credenziali: gestito nelle media query globali sopra */

/* ========================
   FINANZA BENEFIT BOX
   ======================== */
.finanza-benefit-box {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: rgba(200, 168, 75, 0.15);
  border: 1.5px solid rgba(200, 168, 75, 0.4);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 32px;
}
.finanza-benefit-icon {
  font-size: 1.6rem;
  flex-shrink: 0;
  line-height: 1;
  margin-top: 2px;
}
.finanza-benefit-title {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--accent-light);
  margin-bottom: 6px;
  line-height: 1.3;
}
.finanza-benefit-text {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.65;
}
.finanza-benefit-text strong {
  color: var(--accent-light);
}

/* ========================
   LOGO & BADGE IMAGES
   ======================== */
/* Logo nel footer (sfondo scuro) */
.footer-logo-img {
  height: 48px;
  width: auto;
  max-width: 200px;
  object-fit: contain;
  /* Il logo è nero su bianco → lo invertiamo per il footer scuro */
  filter: brightness(0) invert(1);
  margin-bottom: 16px;
  display: block;
}

/* .perche-mini-badge e .partner24-badge-img deprecati — ora usa .credenziali-grid */

/* Logo nel mobile menu */
.mobile-menu-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  margin-bottom: 8px;
}
.mobile-menu-logo img {
  height: 38px;
  width: auto;
  filter: brightness(0) invert(1);
}

/* ========================
   TRUST BAR
   ======================== */
.trust-bar {
  background: var(--off-white);
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
}
.trust-bar-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  flex-wrap: wrap;
}
.trust-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--primary);
  white-space: nowrap;
}
.trust-item img {
  height: 28px;
  width: auto;
  object-fit: contain;
}
.trust-sep {
  width: 1px;
  height: 20px;
  background: var(--border);
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--light-gray); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 3px; }

/* Selection */
::selection { background: rgba(200,168,75,0.25); color: var(--primary); }

/* ════════════════════════════════════════════════
   ANTI-OVERFLOW MOBILE — FIX DEFINITIVO CROSS-DEVICE
   ════════════════════════════════════════════════
   Target: Android Chrome, iOS Safari, foldables,
   Chrome mobile, Samsung Internet, Firefox Android.
   Principi:
   - NO 100vw (include scrollbar su Android → overflow)
   - NO overflow:clip (non supportato da iOS Safari <16)
   - NO max-width su tutti i div (rompe position:absolute/fixed)
   - Ogni regola è chirurgica e motivata
   ════════════════════════════════════════════════ */

@media (max-width: 768px) {

  /* ══════════════════════════════════════
     ROOT — PREVENZIONE OVERFLOW ASSOLUTA
     ══════════════════════════════════════ */

  /* html+body: entrambi necessari su Android Chrome.
     Solo body non è sufficiente: html può scrollare indipendentemente. */
  html {
    overflow-x: hidden;
    /* -webkit-overflow-scrolling non va su html: solo su elementi scrollabili */
  }
  body {
    overflow-x: hidden;
    width: 100%;
    /* position:relative assicura che i child absolute siano contenuti */
    position: relative;
  }

  /* ── 1. MOBILE MENU (drawer laterale) ──
     Il menu è posizionato right:-110% quando chiuso.
     Su alcuni Android con DPR alto, -110% potrebbe non portarlo
     abbastanza fuori: aggiungere visibility:hidden quando chiuso
     è il metodo più cross-browser per nasconderlo completamente. */
  .mobile-menu {
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    /* Quando chiuso: visibility hidden previene qualsiasi contributo al layout */
    visibility: hidden;
    /* transition anche su visibility per non perdere l'animazione */
    transition: right 0.35s cubic-bezier(0.4,0,0.2,1), visibility 0.35s;
  }
  .mobile-menu.open {
    visibility: visible;
  }
  .mobile-menu-overlay {
    overflow: hidden;
    max-width: 100%;
    /* inset:0 già impostato — assicura che l'overlay non espanda il doc */
    box-sizing: border-box;
  }

  /* ── 2. NAVBAR FIXED ──
     Gli elementi fixed con left:0 right:0 possono eccedere
     se il documento ha overflow laterale. max-width+overflow li contenono.
     NOTA: NON usare contain:layout su elementi con child position:fixed —
     creerebbe un nuovo containing block e romperebbe il positioning. */
  #navbar {
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
    /* transform: translateZ(0) forza compositing layer su Android Chrome */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
  }

  /* ── 3. HERO SECTION ──
     #hero ha overflow:visible per non clippare il testo.
     hero-bg-pattern ha overflow:hidden per i decorativi.
     hero-geometric è già nascosto a ≤1024px (display:none).
     NOTA: NON usare contain:layout — rompe position:fixed dei child. */
  #hero {
    max-width: 100%;
    /* overflow:visible mantiene il testo visibile */
  }
  .hero-bg-pattern {
    max-width: 100%;
    overflow: hidden;
    /* Decorativo: overflow:hidden lo isola correttamente */
  }
  /* Assicura che hero-geometric non sia MAI visibile su mobile */
  .hero-geometric {
    display: none !important;
    visibility: hidden !important;
  }

  /* ── 4. WA-BTN HERO — override degli inline styles ──
     La classe .wa-btn-hero (sostituisce gli inline styles)
     risponde correttamente alle media query. */
  .wa-btn-hero {
    font-size: 0.95rem;
    padding: 16px 20px;
    width: 100%;
    justify-content: center;
    text-align: center;
    white-space: normal;
    min-height: 52px;
    box-sizing: border-box;
  }

  /* ── 5. SEZIONE PROBLEMA/SOLUZIONE ──
     box-shadow + border-radius causano micro-overflow su Android.
     Usiamo overflow:hidden (supportato universalmente, incluso iOS Safari). */
  .problema-grid {
    overflow: hidden; /* universalmente supportato — no overflow:clip */
  }
  /* I lati della griglia devono restare dentro il container */
  .problema-side {
    overflow-wrap: break-word;
    word-break: normal;
    min-width: 0;
  }
  .problema-list li span {
    min-width: 0;
    overflow-wrap: break-word;
  }

  /* ── 6. FORM INPUTS E SELECT ──
     Su Android il padding-right della freccia select può sbordare
     se il parent è stretto. Riduciamo il padding a 26px (sicuro per 320px). */
  .form-select {
    padding-right: 26px;
    background-position: right 9px center;
    box-sizing: border-box;
    max-width: 100%;
    width: 100%;
  }
  .form-input,
  .form-textarea {
    box-sizing: border-box;
    max-width: 100%;
    width: 100%;
  }

  /* ── 7. STICKY PHONE BAR ──
     Elemento fixed: left:0 right:0 con box-sizing:border-box
     è il modo più sicuro di non aggiungere larghezza al documento. */
  .sticky-phone {
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    /* safe-area per iPhone con notch */
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    padding-left: max(20px, env(safe-area-inset-left));
    padding-right: max(20px, env(safe-area-inset-right));
  }

  /* ── 8. CHATBOT TRIGGER & WINDOW ──
     Il chatbot usa position:fixed. Assicuriamo che il pannello
     non superi la larghezza del viewport usando % invece di vw.
     La gestione bottom con sticky-visible è nel primo blocco 768px. */
  #chatbot-trigger {
    right: 16px;
    bottom: 20px;
    box-sizing: border-box;
    transition: bottom 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  }
  body.sticky-visible #chatbot-trigger,
  body.sticky-active #chatbot-trigger {
    bottom: 80px;
  }
  .chatbot-window {
    /* calc(100% ...) sul body = viewport width - margini */
    width: min(340px, calc(100% - 32px));
    max-width: calc(100% - 32px);
    right: 16px;
    left: auto;
    bottom: 92px;
    box-sizing: border-box;
    transition: bottom 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  }
  body.sticky-visible .chatbot-window,
  body.sticky-active .chatbot-window {
    bottom: 152px;
  }
  .chatbot-tooltip {
    white-space: normal;
    word-break: normal;
    overflow-wrap: break-word;
    max-width: min(200px, 70vw);
    font-size: 0.75rem;
    box-sizing: border-box;
  }

  /* ── 9. TRUST BAR ──
     Il contenitore esterno non deve scrollare (max-width+overflow:hidden).
     Il contenitore interno può scrollare orizzontalmente. */
  .trust-bar {
    overflow: hidden;
    max-width: 100%;
    box-sizing: border-box;
  }

  /* ── 10. SEZIONE FINANZA (testo lungo su sfondo blu) ──
     Flex child senza min-width:0 può sbordare dal suo container.
     Testo bianco su sfondo scuro: overflow-wrap impedisce testi lunghissimi. */
  .finanza-left,
  .finanza-inner > * {
    min-width: 0; /* CRITICO in flex/grid context */
    width: 100%;
    overflow-wrap: break-word;
    word-break: normal;
  }
  .finanza-text,
  .finanza-title,
  .bando-text,
  .bando-item {
    overflow-wrap: break-word;
    word-break: normal;
    max-width: 100%;
    min-width: 0;
  }
  /* Il decorativo ::before di #finanza è contenuto da overflow:hidden del padre */
  #finanza {
    overflow: hidden;
    max-width: 100%;
  }

  /* ── 11. SEZIONE NUMERI / SOCIAL PROOF ──
     Griglia 2 colonne con numeri grandi: ogni cella deve restare
     nel suo slot senza sbordare. */
  .numero-item {
    min-width: 0;
    overflow: hidden;
  }
  .numero-value {
    overflow-wrap: break-word;
    word-break: break-all; /* numeri grandi tipo €2M+ */
  }

  /* ── 12. TEAM CARDS ──
     Bio testuali lunghe nel grid 2 colonne: min-width:0 su flex children. */
  .team-card {
    min-width: 0;
    overflow: hidden;
  }
  .team-exp,
  .team-name,
  .team-role {
    overflow-wrap: break-word;
    word-break: normal;
    min-width: 0;
  }

  /* ── 13. CREDENZIALI GRID ──
     Label testuali possono essere lunghe. */
  .credenziale-card {
    min-width: 0;
    overflow: hidden;
  }
  .credenziale-label {
    overflow-wrap: break-word;
    word-break: normal;
    max-width: 100%;
  }

  /* ── 14. SEZIONE APPUNTAMENTO ──
     Flex items nei tipi di appuntamento con testo lungo. */
  .apt-type {
    min-width: 0;
    overflow: hidden;
  }
  .apt-type-title,
  .apt-type-sub {
    overflow-wrap: break-word;
    min-width: 0;
  }
  /* Bottoni nel form: mai più larghi del container */
  #appuntamento .btn,
  #appuntamento .wa-btn,
  .cta-form .btn {
    max-width: 100%;
    box-sizing: border-box;
    white-space: normal;
    word-break: normal;
  }

  /* ── 15. FOOTER ISTITUZIONALE ──
     Testo lungo (indirizzi, P.IVA, email PEC) su righe strette. */
  .footer-inst-data,
  .footer-inst-sedi,
  .footer-inst-data span,
  .footer-inst-sede span,
  .footer-inst-link {
    overflow-wrap: break-word;
    word-break: normal;
    max-width: 100%;
  }
  /* footer ha già padding-bottom per sticky bar */
  footer#footer {
    overflow: hidden;
    box-sizing: border-box;
  }

  /* ── 16. BANNER CTA ──
     Titolo molto lungo su background oro. */
  .banner-cta-title,
  .banner-cta-sub {
    overflow-wrap: break-word;
    word-break: normal;
    max-width: 100%;
  }
  /* Bottoni banner: full-width con max per leggibilità */
  .banner-cta-buttons .btn {
    box-sizing: border-box;
    white-space: normal;
    word-break: normal;
  }

  /* ── 17. SEZIONE SERVIZI ──
     Card con nomi servizi lunghi e descrizioni. */
  .servizio-card {
    min-width: 0;
    box-sizing: border-box;
  }
  .servizio-nome,
  .servizio-desc {
    overflow-wrap: break-word;
    min-width: 0;
  }

  /* ── 18. SEZIONE PROCESSO ──
     Step grid 2 colonne: ogni step deve restare nel suo slot. */
  .step-item {
    min-width: 0;
    overflow: hidden;
  }
  .step-title,
  .step-text {
    overflow-wrap: break-word;
    min-width: 0;
  }

  /* ── 19. SEZIONE TESTIMONIANZE ──
     Testi corsivi lunghi su card strette. */
  .testi-card {
    min-width: 0;
    overflow: hidden;
  }
  .testi-text,
  .testi-name,
  .testi-company {
    overflow-wrap: break-word;
    min-width: 0;
  }

  /* ── 20. SEZIONE PERCHÉ CALMA ──
     Punti testuali con titoli e descrizioni. */
  .perche-point-body {
    min-width: 0;
    overflow-wrap: break-word;
  }
  .perche-point-title,
  .perche-point-text {
    overflow-wrap: break-word;
    min-width: 0;
  }

  /* ── 21. GRID GENERICI ──
     Tutti i grid/flex container su mobile devono avere figli
     con min-width:0 per prevenire overflow. */
  .grid-2 > *,
  .grid-3 > *,
  .grid-4 > *,
  .finanza-inner > *,
  .appuntamento-inner > *,
  .perche-grid > *,
  .numeri-grid > *,
  .team-grid > *,
  .servizi-grid > *,
  .processo-steps > *,
  .testi-grid > * {
    min-width: 0;
  }

  /* ── 22. IMMAGINI ──
     Tutte le immagini devono restare dentro il loro container. */
  img {
    max-width: 100%;
    height: auto;
    display: block;
  }

  /* ── 23. SEZIONI GENERALI ──
     Blocco di sicurezza finale: nessuna sezione o container
     deve eccedere la larghezza del viewport. */
  section,
  .section,
  .container,
  .container-sm,
  header,
  footer {
    max-width: 100%;
    box-sizing: border-box;
  }
}

/* ════════════════════════════════════════════════
   iOS SAFARI — FIX SPECIFICI
   @supports (-webkit-touch-callout: none) è disponibile
   SOLO su iOS Safari → target preciso senza false positive.
   ════════════════════════════════════════════════ */
@supports (-webkit-touch-callout: none) {

  /* ── Navbar: GPU layer per rendering fluido ──
     transform:translateZ(0) promuove l'elemento su un layer
     compositing separato, migliorando le performance di scroll
     su iOS Safari. NON usiamo contain:layout (rompe fixed children). */
  #navbar {
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
  }

  /* ── Hero: viewport height ──
     Su iOS Safari 100vh include la barra URL.
     -webkit-fill-available esclude la UI del browser. */
  #hero {
    min-height: -webkit-fill-available;
  }

  /* ── Input font-size: previene auto-zoom su iOS ──
     iOS Safari fa zoom automatico su input con font-size < 16px.
     Forziamo 16px minimo su tutti i campi form. */
  .form-input,
  .form-select,
  .form-textarea,
  .chat-input {
    font-size: max(16px, 0.875rem);
    /* -webkit-appearance:none rimuove stili nativi iOS che possono causare layout issues */
  }
  .form-select {
    -webkit-appearance: none;
  }

  /* ── Safe-area: per iPhone con notch e Dynamic Island ──
     env(safe-area-inset-*) richiede viewport-fit=cover nel meta viewport.
     Il meta è già aggiornato con viewport-fit=cover. */
  .sticky-phone {
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }
  #chatbot-trigger {
    right: max(16px, env(safe-area-inset-right));
    bottom: max(20px, calc(env(safe-area-inset-bottom) + 8px));
  }
  .chatbot-window {
    right: max(16px, env(safe-area-inset-right));
  }
  footer#footer {
    padding-bottom: max(36px, calc(env(safe-area-inset-bottom) + 36px));
  }
  .mobile-menu {
    padding-right: max(28px, env(safe-area-inset-right));
  }

  /* ── Scrolling fluido su iOS ── */
  .chat-messages,
  .trust-bar-inner,
  .mobile-menu {
    -webkit-overflow-scrolling: touch;
  }

  /* ── Fixed positioning fix ──
     Su iOS Safari, gli elementi position:fixed possono
     avere problemi con il momentum scrolling. */
  #navbar,
  .sticky-phone,
  #chatbot-trigger {
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
  }
}
