/* ============================================================
   QuotaFacile — Design System
   Verde professionale + neutri, accento oro per la gamification.
   Signature: la "QuotaPass", tessera dell'intermediario.
   ============================================================ */

:root {
  --green-950: #0B2E1D;
  --green-900: #103E27;
  --green-800: #145233;   /* primary */
  --green-600: #2C8C5E;
  --green-100: #E3F2E9;
  --green-50:  #F1F8F4;
  --gold-500:  #E2A63D;   /* gamification */
  --gold-100:  #FBF0DC;

  /* Gli stessi due colori, ma per il testo.
     Verde 600 e oro 500 sono nati per sfondi, bordi e gradienti,
     dove il contrasto non è un problema. Usati come colore del
     testo su fondo chiaro arrivavano a 4.18:1 e 2.15:1, sotto il
     4.5:1 che le WCAG chiedono al livello AA — cioè faticosi da
     leggere per chi ha una vista non perfetta, e su un telefono
     al sole per chiunque.
     Sono volutamente due token separati e non due variabili
     ritoccate: cambiare --gold-500 avrebbe scurito anche i
     bottoni, le barre di avanzamento e la tessera QuotaPass, che
     non hanno alcun problema. Questi valori superano il 4.5:1 su
     tutti i fondi chiari del progetto (bianco, --bg, --green-50,
     --gold-100, --green-100). */
  --green-testo: #267A52;
  --gold-testo:  #8B6626;
  --ink:       #12291C;
  --ink-soft:  #4C5F55;
  --line:      #DCE5E0;
  --bg:        #F6F8F7;
  --card:      #FFFFFF;
  --danger:    #D64545;

  --font-display: "Bricolage Grotesque", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;

  --radius: 14px;
  --radius-lg: 22px;
  --shadow-soft: 0 2px 10px -2px rgba(20, 82, 51, .08);
  --shadow-med: 0 10px 30px -8px rgba(20, 82, 51, .16);
  --shadow-strong: 0 22px 60px -14px rgba(11, 46, 29, .3);
  --ease: cubic-bezier(.4, 0, .2, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom);
}
img { max-width: 100%; }
a { color: var(--green-800); text-decoration: none; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.08; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2.1rem, 5.5vw, 3.6rem); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 700; }
p { line-height: 1.6; }
.container { width: min(1120px, 100% - 2.5rem); margin-inline: auto; }
.muted { color: var(--ink-soft); }

:focus-visible { outline: 3px solid var(--green-600); outline-offset: 2px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font: 600 1rem var(--font-body);
  padding: .8rem 1.5rem; border-radius: 999px; border: 1.5px solid transparent;
  cursor: pointer; transition: transform .18s var(--ease), box-shadow .18s var(--ease), background .18s;
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--green-800); color: #fff; box-shadow: var(--shadow-soft); }
.btn-primary:hover { background: var(--green-900); box-shadow: var(--shadow-med); }
.btn-gold { background: var(--gold-500); color: var(--green-950); }
.btn-gold:hover { filter: brightness(1.06); }
.btn-outline { border-color: var(--green-800); color: var(--green-800); background: transparent; }
.btn-outline:hover { background: var(--green-50); }
.btn-ghost { color: var(--green-800); background: transparent; }
.btn-ghost:hover { background: var(--green-50); }
.btn-light { background: #fff; color: var(--green-800); }
.btn-sm { padding: .55rem 1.1rem; font-size: .9rem; }
.btn-block { width: 100%; }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 60;
  background: rgba(255, 255, 255, .88); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { display: flex; align-items: center; gap: 2rem; height: 64px; }
.brand { display: flex; align-items: center; gap: .55rem; font-family: var(--font-display); font-weight: 800; font-size: 1.2rem; color: var(--ink); }
.brand em { font-style: normal; color: var(--green-testo); }
.brand-mark {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--green-800), var(--green-600));
  color: #fff; font-size: 1.05rem;
}
.topnav { display: flex; gap: 1.4rem; margin-left: auto; }
.topnav a { font-weight: 500; font-size: .95rem; color: var(--ink-soft); padding: .35rem 0; border-bottom: 2px solid transparent; }
.topnav a:hover { color: var(--green-800); }
.topnav a.active { color: var(--green-800); border-bottom-color: var(--green-600); }
.topbar-cta { display: flex; gap: .6rem; }

/* ---------- Bottom tab bar (mobile app) ---------- */
.tabbar {
  display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 70;
  background: rgba(255, 255, 255, .95); backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  padding: .4rem .5rem calc(.4rem + env(safe-area-inset-bottom));
}
.tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: .15rem;
  font-size: .66rem; font-weight: 600; color: var(--ink-soft);
}
.tabbar a svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabbar a.active { color: var(--green-800); }
.tab-cta-btn {
  display: grid; place-items: center; width: 44px; height: 44px; margin-top: -20px;
  border-radius: 50%; background: linear-gradient(145deg, var(--green-600), var(--green-800));
  color: #fff; font-family: var(--font-display); font-weight: 800; font-size: 1.2rem;
  box-shadow: var(--shadow-med); border: 3px solid #fff;
}

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(160deg, var(--green-950) 0%, var(--green-800) 55%, var(--green-600) 130%);
  color: #fff; overflow: hidden; position: relative;
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(600px 300px at 85% 20%, rgba(226, 166, 61, .18), transparent 70%);
}
.hero-inner { display: grid; grid-template-columns: 1.15fr .85fr; gap: 3rem; align-items: center; padding: 4.5rem 0 5rem; position: relative; z-index: 1; }
.hero .eyebrow { display: inline-block; font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-500); margin-bottom: 1rem; }
.hero p.lead { font-size: 1.15rem; color: #DCEDE3; max-width: 34rem; }
.hero-actions { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: 1.6rem; }
.hero-trust { display: flex; gap: 1.6rem; margin-top: 2.2rem; flex-wrap: wrap; }
.hero-trust div strong { display: block; font-family: var(--font-display); font-size: 1.4rem; }
.hero-trust div span { font-size: .8rem; color: #B9D7C6; }

/* ---------- QuotaPass (signature card) ---------- */
.qpass {
  width: 100%; max-width: 380px; aspect-ratio: 1.586; border-radius: var(--radius-lg);
  background:
    radial-gradient(220px 140px at 82% -10%, rgba(226,166,61,.35), transparent 70%),
    linear-gradient(135deg, var(--green-900), var(--green-800) 55%, #1B6A43);
  color: #fff; padding: 1.35rem 1.5rem; position: relative;
  box-shadow: var(--shadow-strong);
  display: flex; flex-direction: column; justify-content: space-between;
  transform: rotate(-2deg); transition: transform .35s var(--ease);
}
.qpass:hover { transform: rotate(0deg) translateY(-4px); }
.qpass.flat { transform: none; }
.qpass-top { display: flex; justify-content: space-between; align-items: flex-start; }
.qpass-logo { font-family: var(--font-display); font-weight: 800; font-size: .95rem; letter-spacing: .02em; opacity: .95; }
.qpass-logo em { font-style: normal; color: var(--gold-500); }
.qpass-verified {
  display: inline-flex; align-items: center; gap: .3rem; font-size: .68rem; font-weight: 700;
  background: rgba(226,166,61,.16); color: var(--gold-500);
  border: 1px solid rgba(226,166,61,.5); padding: .25rem .6rem; border-radius: 999px;
}
.qpass-chip { width: 38px; height: 28px; border-radius: 6px; background: linear-gradient(135deg, #E9C77F, var(--gold-500)); position: relative; margin: .3rem 0; }
.qpass-chip::after { content: ""; position: absolute; inset: 6px 8px; border: 1px solid rgba(11,46,29,.35); border-radius: 3px; }
.qpass-identity { display: flex; align-items: center; gap: .8rem; }
.qpass-avatar {
  width: 52px; height: 52px; border-radius: 14px; flex-shrink: 0;
  display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; font-size: 1.3rem;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.25);
}
.qpass-name { font-family: var(--font-display); font-weight: 700; font-size: 1.12rem; line-height: 1.15; }
.qpass-role { font-size: .78rem; color: #BFE0CE; }
.qpass-bottom { display: flex; justify-content: space-between; align-items: flex-end; font-size: .7rem; }
.qpass-rui { letter-spacing: .14em; font-family: monospace; font-size: .82rem; color: #DCEDE3; }
.qpass-tags { display: flex; gap: .35rem; flex-wrap: wrap; justify-content: flex-end; }
.qpass-tags span { background: rgba(255,255,255,.12); padding: .18rem .55rem; border-radius: 999px; font-size: .64rem; font-weight: 600; }

/* ---------- Sections ---------- */
.section { padding: 4.2rem 0; }
.section-alt { background: #fff; border-block: 1px solid var(--line); }
.section-head { max-width: 40rem; margin-bottom: 2.4rem; }
.eyebrow { font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--green-testo); }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.2rem; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.5rem; box-shadow: var(--shadow-soft);
}
.step-num {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px;
  background: var(--green-100); color: var(--green-800);
  font-family: var(--font-display); font-weight: 800; font-size: 1.1rem; margin-bottom: .8rem;
}
.icon-dot {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px;
  background: var(--green-50); border: 1px solid var(--green-100); margin-bottom: .8rem; font-size: 1.3rem;
}

/* ---------- Directory intermediari ---------- */
.pass-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.6rem; justify-items: center; }
.pass-wrap { display: flex; flex-direction: column; gap: .8rem; width: 100%; max-width: 380px; }
/* flex:1 da solo non basta: un elemento flessibile non scende
   sotto la larghezza del proprio contenuto finché min-width resta
   su auto, e su uno schermo da 390px i due bottoni della tessera
   sforavano di cinque pixel — abbastanza per far scorrere l'intera
   pagina di lato. */
.pass-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.pass-actions .btn { flex: 1 1 8rem; min-width: 0; }

.filterbar { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1.8rem; }
.chip {
  border: 1.5px solid var(--line); background: #fff; color: var(--ink-soft);
  padding: .45rem 1rem; border-radius: 999px; font: 600 .85rem var(--font-body); cursor: pointer;
  transition: all .15s;
}
.chip.active, .chip:hover { border-color: var(--green-800); color: var(--green-800); background: var(--green-50); }
/* Alcune schede sono collegamenti, così l'indirizzo dice dove sei:
   devono restare identiche ai pulsanti. */
a.chip { display: inline-block; text-decoration: none; }

/* ---------- Bacheca Q&A ---------- */
.board-layout { display: grid; grid-template-columns: 1fr 320px; gap: 2rem; align-items: start; }
/* Area cliccabile estesa: il link è il titolo, ma il suo
   pseudo-elemento copre tutta la scheda, così chi usa il mouse
   continua a cliccare dove vuole e chi usa la tastiera arriva a
   un link solo — non a sei elementi diversi per la stessa
   destinazione. */
.qa-card { position: relative; margin-bottom: 1rem; cursor: pointer; transition: box-shadow .2s, transform .2s; }
.qa-title a { color: inherit; text-decoration: none; }
.qa-title a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
/* Il fuoco si vede sulla scheda intera, non su tre parole in
   mezzo: è la scheda che si sta per aprire. */
.qa-card:has(.qa-title a:focus-visible) { outline: 3px solid var(--green-600); outline-offset: 2px; }
.qa-title a:focus-visible { outline: none; }
.lead-row-link { position: relative; cursor: pointer; }
.lead-row-link .leader-info a { color: inherit; text-decoration: none; }
.lead-row-link .leader-info a::after { content: ""; position: absolute; inset: 0; }
.lead-row-link:has(a:focus-visible) { outline: 3px solid var(--green-600); outline-offset: 2px; border-radius: 6px; }
.lead-row-link .leader-info a:focus-visible { outline: none; }
.qa-card:hover { box-shadow: var(--shadow-med); transform: translateY(-2px); }
.qa-meta { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; font-size: .75rem; color: var(--ink-soft); margin-bottom: .5rem; }
.badge-cat { background: var(--green-100); color: var(--green-800); font-weight: 700; padding: .2rem .6rem; border-radius: 999px; font-size: .7rem; }
.qa-title { font-family: var(--font-display); font-weight: 700; font-size: 1.08rem; margin: 0 0 .4rem; }
.qa-excerpt { font-size: .9rem; color: var(--ink-soft); margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.qa-foot { display: flex; justify-content: space-between; align-items: center; margin-top: .9rem; font-size: .78rem; color: var(--ink-soft); }
.qa-author { display: flex; align-items: center; gap: .45rem; font-weight: 600; color: var(--green-800); }
.mini-avatar { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--green-800); color: #fff; font-size: .7rem; font-weight: 700; }
.pts { color: var(--gold-testo); font-weight: 700; }

.leader-card { position: sticky; top: 84px; }
.leader-row { display: flex; align-items: center; gap: .7rem; padding: .6rem 0; border-bottom: 1px dashed var(--line); }
.leader-row:last-child { border-bottom: 0; }
.leader-rank { font-family: var(--font-display); font-weight: 800; width: 1.4rem; color: var(--ink-soft); }
.leader-rank.gold { color: var(--gold-testo); }
.leader-info { flex: 1; min-width: 0; }
.leader-info strong { display: block; font-size: .88rem; }
.leader-info span { font-size: .72rem; color: var(--ink-soft); }
.leader-pts { font-weight: 700; color: var(--gold-testo); font-size: .88rem; white-space: nowrap; }
.level-badge { font-size: .64rem; font-weight: 700; padding: .15rem .5rem; border-radius: 999px; background: var(--gold-100); color: #8A5F11; }

/* Q&A dettaglio */
.answer { border-left: 3px solid var(--green-600); padding: .9rem 1.1rem; background: var(--green-50); border-radius: 0 var(--radius) var(--radius) 0; margin-top: 1rem; }
.answer-auto { border-left-color: var(--gold-500); background: #FDFAF3; }
.answer-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .4rem; flex-wrap: wrap; gap: .4rem; }
.vote-btn { border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: .3rem .8rem; font: 600 .78rem var(--font-body); cursor: pointer; color: var(--ink-soft); }
.vote-btn:hover { border-color: var(--gold-500); color: #8A5F11; }

/* Domanda del giorno */
.badge-daily { background: var(--gold-100); color: #8A5F11; }
.badge-auto { background: var(--gold-100); color: #8A5F11; }
.qa-daily { border-color: #F0DDB6; }
.mini-qf { background: linear-gradient(135deg, var(--gold-500), #C88A22); }
.daily-counter {
  display: flex; align-items: center; gap: 1.4rem; flex-wrap: wrap;
  margin-bottom: 1.6rem; padding: 1rem 1.3rem;
  border-color: #F0DDB6; background: linear-gradient(120deg, var(--gold-100), #fff);
}

/* Dashboard pro: lead */
.stats-row-4 { grid-template-columns: repeat(4, 1fr); }
.lead-row { display: flex; align-items: center; gap: .8rem; padding: .65rem 0; border-bottom: 1px dashed var(--line); }
.lead-row:last-child { border-bottom: 0; }
.lead-icon { display: grid; place-items: center; width: 34px; height: 34px; flex-shrink: 0; border-radius: 10px; background: var(--green-50); border: 1px solid var(--green-100); font-size: 1rem; }
@media (max-width: 560px) { .stats-row-4 { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.field { display: flex; flex-direction: column; gap: .35rem; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: .82rem; font-weight: 600; color: var(--ink-soft); }
.field input, .field select, .field textarea {
  font: 500 .95rem var(--font-body); color: var(--ink);
  padding: .75rem .9rem; border: 1.5px solid var(--line); border-radius: 10px; background: #fff;
  transition: border-color .15s;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--green-600); outline: none; }
.field textarea { resize: vertical; min-height: 96px; }

/* Stepper preventivo */
.stepper { display: flex; gap: .4rem; margin-bottom: 1.6rem; }
.stepper span { flex: 1; height: 5px; border-radius: 99px; background: var(--line); }
.stepper span.done { background: var(--green-600); }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .8rem; }
.choice {
  border: 1.5px solid var(--line); border-radius: var(--radius); background: #fff;
  padding: 1.1rem .8rem; text-align: center; cursor: pointer; transition: all .15s;
  font: 600 .9rem var(--font-body); color: var(--ink);
}
.choice .icon-dot { margin: 0 auto .5rem; }
.choice:hover { border-color: var(--green-600); }
.choice.selected { border-color: var(--green-800); background: var(--green-50); box-shadow: var(--shadow-soft); }

/* ---------- Area Pro ---------- */
.pro-layout { display: grid; grid-template-columns: 1fr 420px; gap: 2.4rem; align-items: start; }
.pro-preview { position: sticky; top: 90px; display: flex; flex-direction: column; gap: 1rem; align-items: center; }
.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; width: 100%; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem; text-align: center; }
.stat strong { display: block; font-family: var(--font-display); font-size: 1.3rem; color: var(--green-800); }
.stat span { font-size: .7rem; color: var(--ink-soft); }
.gami-banner {
  display: flex; align-items: center; gap: 1rem; background: linear-gradient(120deg, var(--gold-100), #fff);
  border: 1px solid #F0DDB6; border-radius: var(--radius); padding: 1rem 1.2rem; margin-bottom: 1.4rem;
}
.gami-banner .icon { font-size: 1.6rem; }
.progressbar { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; margin-top: .4rem; }
.progressbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold-500), #F2C979); border-radius: 99px; }

/* ---------- CTA band ---------- */
.cta-band {
  background: linear-gradient(140deg, var(--green-900), var(--green-800));
  color: #fff; border-radius: var(--radius-lg); padding: 3rem;
  display: grid; grid-template-columns: 1.2fr auto; gap: 2rem; align-items: center;
  box-shadow: var(--shadow-strong);
}
.cta-band p { color: #CBE5D6; margin: 0; }

/* ---------- Coming soon: app iPhone ---------- */
.appsoon { display: grid; grid-template-columns: 1.05fr .95fr; gap: 3rem; align-items: center; }
.store-badges { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; margin: 1.4rem 0 1.1rem; }
.store-badge {
  display: inline-flex; align-items: center; gap: .65rem;
  background: var(--green-950); color: #fff; border-radius: 12px; padding: .55rem 1.1rem;
}
.store-badge small { display: block; font-size: .62rem; opacity: .75; letter-spacing: .02em; }
.store-badge strong { font-family: var(--font-display); font-size: 1.02rem; line-height: 1.1; }
.store-icon {
  width: 22px; height: 26px; flex-shrink: 0;
  background: #fff;
  -webkit-mask: radial-gradient(circle 5px at 62% 4%, transparent 96%, #000 0) top/100% 40% no-repeat,
                radial-gradient(closest-side, #000 96%, transparent) bottom/100% 78% no-repeat;
          mask: radial-gradient(circle 5px at 62% 4%, transparent 96%, #000 0) top/100% 40% no-repeat,
                radial-gradient(closest-side, #000 96%, transparent) bottom/100% 78% no-repeat;
}
.soon-tag {
  font-size: .72rem; font-weight: 700; color: #8A5F11; background: var(--gold-100);
  border: 1px solid #F0DDB6; padding: .4rem .8rem; border-radius: 999px;
}
.notify-form { display: flex; gap: .6rem; max-width: 26rem; }
.notify-form input {
  flex: 1; min-width: 0; font: 500 .95rem var(--font-body);
  padding: .75rem 1rem; border: 1.5px solid var(--line); border-radius: 999px; background: #fff;
}
.notify-form input:focus { border-color: var(--green-600); outline: none; }

.phone-stage { position: relative; display: flex; justify-content: center; }
.phone-glow {
  position: absolute; inset: 12% 18%; z-index: 0; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(44,140,94,.28), rgba(226,166,61,.14), transparent 75%);
  filter: blur(12px);
}
.phone {
  position: relative; z-index: 1;
  width: min(290px, 78vw); aspect-ratio: 9 / 19.2;
  border-radius: 44px; padding: 10px;
  background: linear-gradient(160deg, #3B4A42, #10201800 40%), #17211C;
  box-shadow:
    inset 0 0 0 2px #39463F,
    0 30px 70px -20px rgba(11, 46, 29, .5),
    0 8px 22px -8px rgba(11, 46, 29, .35);
  transform: rotate(3deg); transition: transform .4s var(--ease);
}
.phone:hover { transform: rotate(0deg) translateY(-6px); }
.phone-island {
  position: absolute; top: 20px; left: 50%; transform: translateX(-50%);
  width: 84px; height: 22px; border-radius: 999px; background: #0B0F0D; z-index: 3;
}
.phone-screen {
  height: 100%; border-radius: 34px; overflow: hidden; background: var(--bg);
  display: flex; flex-direction: column; position: relative;
}
/* mini mockup interno */
.m-status { display: flex; justify-content: space-between; padding: .55rem 1.1rem .2rem; font-size: .58rem; font-weight: 700; color: var(--ink); }
.m-topbar { display: flex; align-items: center; gap: .35rem; padding: .45rem .8rem; background: #fff; border-bottom: 1px solid var(--line); }
.m-mark { display: grid; place-items: center; width: 17px; height: 17px; border-radius: 5px; background: linear-gradient(135deg, var(--green-800), var(--green-600)); color: #fff; font: 800 .58rem var(--font-display); }
.m-brand { font: 800 .66rem var(--font-display); color: var(--ink); }
.m-brand em { font-style: normal; color: var(--green-testo); }
.m-hero { margin: .55rem .55rem 0; padding: .75rem .7rem; border-radius: 14px; background: linear-gradient(150deg, var(--green-950), var(--green-800) 70%); color: #fff; }
.m-hero-title { font: 800 .72rem/1.15 var(--font-display); }
.m-hero-sub { font-size: .52rem; color: #CBE5D6; margin-top: .18rem; }
.m-hero-btn { display: inline-block; margin-top: .5rem; background: var(--gold-500); color: var(--green-950); font-size: .5rem; font-weight: 700; padding: .28rem .6rem; border-radius: 999px; }
.m-daily { margin: .5rem .55rem 0; padding: .55rem .65rem; border-radius: 12px; background: linear-gradient(120deg, var(--gold-100), #fff); border: 1px solid #F0DDB6; }
.m-daily-tag { font-size: .48rem; font-weight: 800; color: #9A6B14; }
.m-daily-q { font: 700 .6rem/1.25 var(--font-display); color: var(--ink); margin-top: .15rem; }
.m-daily-a { display: flex; align-items: center; gap: .3rem; font-size: .48rem; color: var(--ink-soft); margin-top: .3rem; }
.m-qf { display: grid; place-items: center; width: 13px; height: 13px; border-radius: 4px; background: linear-gradient(135deg, var(--gold-500), #C88A22); color: #fff; font-size: .4rem; font-weight: 800; }
.m-pass { margin: .5rem .55rem 0; padding: .55rem .65rem; border-radius: 12px; background: linear-gradient(135deg, var(--green-900), #1B6A43); color: #fff; }
.m-pass-top { display: flex; justify-content: space-between; font: 800 .5rem var(--font-display); }
.m-pass-top em { font-style: normal; color: var(--gold-500); }
.m-pass-ver { font-size: .42rem; color: var(--gold-500); border: 1px solid rgba(226,166,61,.5); border-radius: 999px; padding: .06rem .3rem; }
.m-pass-id { display: flex; align-items: center; gap: .4rem; margin-top: .4rem; }
.m-pass-av { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; background: rgba(255,255,255,.15); font: 800 .5rem var(--font-display); }
.m-pass-id b { display: block; font: 700 .56rem var(--font-display); }
.m-pass-id i { font-style: normal; font-size: .44rem; color: #BFE0CE; }
.m-tabbar { margin-top: auto; display: flex; justify-content: space-around; align-items: center; padding: .4rem .4rem .7rem; background: #fff; border-top: 1px solid var(--line); font-size: .62rem; color: var(--ink-soft); }
.m-tabbar .on { color: var(--green-800); }
.m-tab-cta { display: grid; place-items: center; width: 22px; height: 22px; margin-top: -12px; border-radius: 50%; background: linear-gradient(145deg, var(--green-600), var(--green-800)); color: #fff; font: 800 .6rem var(--font-display); border: 2px solid #fff; box-shadow: var(--shadow-soft); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 90px; transform: translate(-50%, 20px);
  background: var(--green-950); color: #fff; padding: .8rem 1.4rem; border-radius: 999px;
  font-size: .9rem; font-weight: 600; opacity: 0; pointer-events: none;
  transition: opacity .25s, transform .25s; z-index: 100; box-shadow: var(--shadow-strong);
  max-width: min(90vw, 420px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Footer ---------- */
.footer { background: var(--green-950); color: #A9C8B6; padding: 3.2rem 0 5.5rem; margin-top: 4rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 2rem; }
.footer h4 { color: #fff; font-family: var(--font-display); font-size: .95rem; margin: 0 0 .8rem; }
/* .22rem sopra e sotto davano un bersaglio alto 23px: uno in
   meno dei 24 che chiede il criterio 2.5.8 delle WCAG 2.2.
   Con .3rem si arriva a 25 e il footer non cambia aspetto. */
.footer a { display: block; color: #A9C8B6; font-size: .88rem; padding: .3rem 0; }
.footer a:hover { color: #fff; }
.footer-brand { color: #fff; margin-bottom: .6rem; }
.footer-brand em { color: var(--gold-500); }
.footer-tag { font-size: .85rem; max-width: 22rem; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); margin-top: 2.4rem; padding-top: 1.4rem; font-size: .78rem; }

/* ---------- Animations ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.rise { animation: rise .5s var(--ease) both; }
.rise-2 { animation: rise .5s .08s var(--ease) both; }
.rise-3 { animation: rise .5s .16s var(--ease) both; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero-inner { grid-template-columns: 1fr; padding: 3rem 0 3.5rem; }
  .hero .qpass { margin-inline: auto; }
  .appsoon { grid-template-columns: 1fr; gap: 2.2rem; }
  .phone { transform: rotate(0deg); }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .board-layout { grid-template-columns: 1fr; }
  .leader-card { position: static; }
  .pro-layout { grid-template-columns: 1fr; }
  .pro-preview { position: static; }
  .cta-band { grid-template-columns: 1fr; padding: 2rem; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .topnav, .topbar-cta .btn-ghost { display: none; }
  .tabbar { display: flex; }
  body { padding-bottom: 76px; }
  .footer { padding-bottom: 7rem; }
  .form-grid { grid-template-columns: 1fr; }
  .section { padding: 3rem 0; }
  .toast { bottom: 108px; }
}

/* ============================================================
   LEGALE / GDPR — pagine informative, banner cookie, consensi
   ============================================================ */

/* ---------- Pagine legali ---------- */
.legal-page { background: #fff; }
.legal-body { font-size: 1rem; line-height: 1.72; color: var(--ink); }
.legal-body h2 { font-size: 1.35rem; margin: 2.2rem 0 .6rem; padding-top: .4rem; border-top: 1px solid var(--line); }
.legal-body h2:first-child { border-top: 0; margin-top: 0; }
.legal-body h3 { font-size: 1.02rem; margin: 1.4rem 0 .4rem; color: var(--green-800); }
.legal-body ul { padding-left: 1.2rem; }
.legal-body li { margin-bottom: .45rem; line-height: 1.62; }
.legal-body code { background: var(--green-50); border: 1px solid var(--green-100); border-radius: 5px; padding: .05rem .35rem; font-size: .86em; }
.legal-callout {
  background: var(--green-50); border-left: 4px solid var(--green-600);
  border-radius: 0 var(--radius) var(--radius) 0; padding: 1rem 1.2rem; margin: 1.2rem 0;
}
.legal-warning {
  background: var(--gold-100); border: 1px solid var(--gold-500); border-radius: var(--radius);
  padding: 1rem 1.2rem; margin-bottom: 1.6rem; font-size: .9rem; line-height: 1.6;
}
.legal-todo { background: var(--gold-100); color: #8A5B0B; border-bottom: 2px dotted var(--gold-500); padding: 0 .2rem; font-weight: 600; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 1rem 0; }
.legal-table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: .88rem; }
.legal-table th, .legal-table td { text-align: left; padding: .7rem .8rem; border: 1px solid var(--line); vertical-align: top; }
.legal-table th { background: var(--green-50); font-family: var(--font-display); font-weight: 700; }
.legal-table tbody tr:nth-child(even) { background: #FAFCFB; }
.pill { display: inline-block; font-size: .68rem; font-weight: 700; border-radius: 999px; padding: .12rem .55rem; background: var(--green-100); color: var(--green-800); vertical-align: middle; }
.pill-on { background: var(--gold-100); color: #8A5B0B; }
.legal-nav { display: flex; flex-wrap: wrap; gap: .5rem 1.1rem; margin-top: 2.6rem; padding-top: 1.2rem; border-top: 1px solid var(--line); font-size: .88rem; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--green-800); cursor: pointer; text-decoration: underline; }

/* ---------- Cookie banner ---------- */
.cc-banner {
  position: fixed; z-index: 200; left: 1rem; right: 1rem; bottom: 1rem;
  max-width: 640px; margin-inline: auto;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-strong); padding: 1.5rem 1.6rem 1.2rem;
  animation: rise .35s var(--ease) both;
}
.cc-banner h2 { font-size: 1.15rem; margin-bottom: .4rem; }
.cc-banner p { font-size: .88rem; line-height: 1.6; color: var(--ink-soft); margin: 0 0 1rem; }
.cc-banner a { text-decoration: underline; }
.cc-actions { display: flex; gap: .6rem; flex-wrap: wrap; }
.cc-actions .btn { flex: 1 1 auto; min-width: 140px; padding: .7rem 1rem; font-size: .92rem; }
/* Niente opacity: --ink-soft su bianco sta a 6.8:1, ma al 80%
   di opacità il browser lo fonde col fondo e scende a 4.2:1,
   sotto la soglia. Su un testo di .74rem è proprio dove serve
   di più. */
.cc-note { font-size: .74rem !important; margin: .8rem 0 0 !important; }
.cc-x {
  position: absolute; top: .7rem; right: .8rem; width: 32px; height: 32px; border-radius: 50%;
  border: 0; background: var(--bg); color: var(--ink-soft); font-size: .85rem; cursor: pointer;
}
.cc-x:hover { background: var(--green-50); color: var(--green-800); }

/* ---------- Centro preferenze ---------- */
.cc-overlay {
  position: fixed; inset: 0; z-index: 210; background: rgba(11, 46, 29, .55);
  backdrop-filter: blur(3px); display: grid; place-items: center; padding: 1rem;
  animation: rise .25s var(--ease) both;
}
.cc-modal {
  background: #fff; border-radius: var(--radius-lg); width: min(600px, 100%);
  max-height: min(86vh, 760px); display: flex; flex-direction: column; box-shadow: var(--shadow-strong);
}
.cc-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 1.3rem 1.5rem .8rem; border-bottom: 1px solid var(--line); position: relative; }
.cc-modal-head h2 { margin: 0; font-size: 1.2rem; }
.cc-modal-head .cc-x { position: static; }
.cc-modal-body { padding: 1.1rem 1.5rem; overflow-y: auto; }
.cc-modal-foot { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: flex-end; padding: 1rem 1.5rem calc(1rem + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.cc-cat { display: flex; gap: 1rem; align-items: flex-start; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.cc-cat:last-of-type { border-bottom: 0; }
.cc-cat p { margin: .25rem 0 0; font-size: .85rem; line-height: 1.55; }
.cc-record { font-size: .76rem; color: var(--ink-soft); background: var(--bg); border-radius: 8px; padding: .5rem .7rem; margin-top: .6rem; }
.cc-switch { position: relative; flex-shrink: 0; width: 46px; height: 26px; display: inline-block; margin-top: .15rem; }
.cc-switch input { opacity: 0; width: 0; height: 0; }
.cc-slider { position: absolute; inset: 0; background: #C6D3CC; border-radius: 999px; cursor: pointer; transition: background .2s var(--ease); }
.cc-slider::before { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .2s var(--ease); box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.cc-switch input:checked + .cc-slider { background: var(--green-600); }
.cc-switch input:checked + .cc-slider::before { transform: translateX(20px); }
.cc-switch input:disabled + .cc-slider { background: var(--green-800); opacity: .55; cursor: not-allowed; }
.cc-switch input:focus-visible + .cc-slider { outline: 3px solid var(--green-600); outline-offset: 2px; }

/* ---------- Consenso nei form ---------- */
.consent-box {
  display: flex; gap: .7rem; align-items: flex-start;
  background: var(--green-50); border: 1px solid var(--green-100);
  border-radius: var(--radius); padding: .85rem 1rem; margin-top: .3rem;
}
.consent-box input[type="checkbox"] { width: 20px; height: 20px; flex-shrink: 0; margin-top: .12rem; accent-color: var(--green-800); }
.consent-box label { font-size: .84rem; line-height: 1.55; color: var(--ink-soft); font-weight: 400; }
.consent-box a { text-decoration: underline; }
.consent-req { color: var(--danger); font-weight: 700; }
.privacy-hint { font-size: .76rem; color: var(--ink-soft); line-height: 1.5; margin-top: .6rem; }

/* ---------- Segnalazione contenuti (DSA) ---------- */
.report-btn {
  background: none; border: 0; color: var(--ink-soft); font-size: .74rem; cursor: pointer;
  /* .4rem verticali portano il bersaglio da 23 a 26px: sotto i
     24 il criterio 2.5.8 delle WCAG 2.2 non è soddisfatto, e
     su un telefono si sbaglia a premere. L'opacity è via per
     lo stesso motivo del .cc-note qui sopra. */
  padding: .4rem .5rem; border-radius: 6px;
}
.report-btn:hover { background: var(--green-50); color: var(--danger); }
.answer-foot { display: flex; justify-content: flex-end; margin-top: .4rem; }

@media (max-width: 560px) {
  .cc-banner { left: .6rem; right: .6rem; bottom: .6rem; padding: 1.3rem 1.1rem 1rem; }
  .cc-actions .btn { flex: 1 1 100%; }
  .cc-modal-foot .btn { flex: 1 1 100%; }
}

/* ---------- Footer: link legali e disclaimer ---------- */
.footer-linkbtn {
  display: block; background: none; border: 0; padding: .3rem 0;
  color: #A9C8B6; font: inherit; font-size: .88rem; cursor: pointer; text-align: left;
}
.footer-linkbtn:hover { color: #fff; }
/* Un filo staccata dalle voci legali: non è una pagina del sito,
   è la porta di servizio. */
.footer-riservata {
  margin-top: .7rem; padding-top: .55rem;
  border-top: 1px solid rgba(255,255,255,.12);
  opacity: .72; font-size: .82rem;
}
.footer-riservata:hover { opacity: 1; }
.footer-bottom p { margin: 0 0 .6rem; }
.footer-bottom a { display: inline; text-decoration: underline; }
.footer-disclaimer { font-size: .74rem; line-height: 1.55; opacity: .75; max-width: 68ch; }

/* ---------- Domande Staff (guide SEO) ---------- */
.badge-staff { background: var(--gold-100); color: #8A5B0B; }
.qa-card.qa-staff { border-left: 3px solid var(--gold-500); }
.answer-rich { font-size: .98rem; line-height: 1.7; }
.answer-rich p { margin: .7rem 0; }
.answer-rich h4 {
  font-family: var(--font-display); font-size: 1.05rem; font-weight: 700;
  color: var(--green-800); margin: 1.4rem 0 .4rem;
}
.answer-rich ul, .answer-rich ol { padding-left: 1.3rem; margin: .6rem 0; }
.answer-rich li { margin-bottom: .5rem; line-height: 1.65; }
.answer-rich strong { color: var(--ink); }
.answer-rich em { color: var(--ink-soft); }

/* ---------- Campi di contenuto ancora da compilare ---------- */
.todo-field {
  background: rgba(226, 166, 61, .22); border-bottom: 1px dotted var(--gold-500);
  color: inherit; padding: 0 .2rem; border-radius: 3px;
}
.rui-pending { color: var(--gold-testo); font-family: var(--font-body); letter-spacing: 0; font-size: .74rem; }
.qpass-rui { font-size: .74rem; line-height: 1.35; max-width: 62%; }

/* ============================================================
   AREA ADMIN
   ============================================================ */
.admin-shell { background: var(--bg); }
.admin-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.4rem; flex-wrap: wrap; }
.admin-hint { font-size: .88rem; line-height: 1.6; color: var(--ink-soft); background: #fff; border: 1px solid var(--line); border-left: 3px solid var(--green-600); border-radius: var(--radius); padding: .9rem 1.1rem; margin: 0 0 1.2rem; }
.admin-hint a { text-decoration: underline; }
.notif { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 .3rem; border-radius: 999px; background: var(--danger); color: #fff; font-size: .68rem; font-weight: 700; margin-left: .25rem; }

/* Login */
.admin-login { max-width: 440px; margin-inline: auto; }
.admin-lock { font-size: 2.4rem; text-align: center; margin-bottom: .4rem; }

/* KPI */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .9rem; }
.kpi-tile { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; box-shadow: var(--shadow-soft); }
.kpi-tile strong { display: block; font-family: var(--font-display); font-size: 2rem; font-weight: 800; color: var(--green-800); line-height: 1; }
.kpi-tile span { display: block; font-size: .84rem; font-weight: 600; margin-top: .35rem; }
.kpi-tile em { display: block; font-style: normal; font-size: .74rem; color: var(--ink-soft); margin-top: .25rem; line-height: 1.4; }

.bar-row { display: grid; grid-template-columns: 5.5rem 1fr 2rem; align-items: center; gap: .6rem; margin: .5rem 0; font-size: .85rem; }
.bar-label { font-weight: 600; }
.bar-track { background: var(--green-50); border-radius: 999px; height: 10px; overflow: hidden; }
.bar-track i { display: block; height: 100%; background: linear-gradient(90deg, var(--green-600), var(--green-800)); border-radius: 999px; }
.bar-val { text-align: right; font-weight: 700; color: var(--green-800); }

/* Professionisti */
.admin-kv { width: 100%; border-collapse: collapse; font-size: .86rem; }
.admin-kv th { text-align: left; font-weight: 600; color: var(--ink-soft); padding: .3rem .8rem .3rem 0; white-space: nowrap; vertical-align: top; width: 8.5rem; }
.admin-kv td { padding: .3rem 0; }
.admin-actions { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .9rem; }

/* Moderazione */
.admin-q { margin-bottom: 1rem; }
/* Ciò che è stato rimosso resta visibile in console, in secondo
   piano: serve a ricostruire una decisione, non a riproporla. */
.admin-rimossa { opacity: .68; border-left: 3px solid var(--line); }
.admin-q-actions { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .8rem; }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: #FCEDED; }
.admin-a { border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem; margin-top: .6rem; background: #FCFDFC; }
.admin-a.best { border-color: var(--gold-500); background: #FFFDF8; }
.admin-a-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; flex-wrap: wrap; }
.admin-a-text { font-size: .88rem; line-height: 1.6; margin: .5rem 0; color: var(--ink-soft); }
.admin-a-actions { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }

/* Anteprima SERP */
.serp-preview { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem; margin-top: .6rem; }
.serp-url { font-size: .78rem; color: #4d5156; }
.serp-title { font-size: 1.1rem; color: #1a0dab; line-height: 1.3; margin: .2rem 0; }
.serp-desc { font-size: .84rem; color: #4d5156; line-height: 1.5; }

/* ---------- Area riservata: la porta ---------- */
.porta-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.2rem; margin-top: 1.4rem; }
.porta-card {
  display: block; background: #fff; border: 1.5px solid var(--line); border-radius: var(--radius);
  padding: 1.6rem 1.5rem; transition: border-color .18s var(--ease), transform .18s var(--ease), box-shadow .18s var(--ease);
}
.porta-card:hover { border-color: var(--green-600); transform: translateY(-3px); box-shadow: var(--shadow-med); }
.porta-icona { font-size: 1.9rem; line-height: 1; }
.porta-card h2 { font-family: var(--font-display); font-size: 1.3rem; margin: .7rem 0 .3rem; color: var(--ink); }
.porta-card > p { font-size: .9rem; color: var(--ink-soft); margin: 0 0 .8rem; }
.porta-card ul { list-style: none; padding: 0; margin: 0 0 1rem; }
.porta-card li { font-size: .84rem; color: var(--ink-soft); padding: .2rem 0 .2rem 1.1rem; position: relative; }
.porta-card li::before { content: "·"; position: absolute; left: .3rem; color: var(--green-600); font-weight: 800; }
.porta-cta { font-weight: 700; font-size: .9rem; color: var(--green-800); }

/* ---------- CRM ---------- */
.crm-indietro { display: block; font-size: .8rem; color: var(--ink-soft); margin-bottom: .3rem; }
.crm-indietro:hover { color: var(--green-800); }
.crm-avanzamento { margin-top: .8rem; }
.crm-passo {
  display: grid; grid-template-columns: 1.3rem 1fr; gap: .5rem; align-items: start;
  font-size: .86rem; padding: .3rem 0; color: var(--ink-soft);
}
.crm-passo.fatto { color: var(--green-800); font-weight: 600; }
/* Una sezione dichiarata "in arrivo" deve sembrare un progetto,
   non una pagina rotta. */
.crm-inarrivo { border-left: 3px solid var(--gold-500); }

/* Credenziali appena generate: si vedono una volta sola, quindi
   devono saltare all'occhio e la password dev'essere leggibile
   carattere per carattere. */
.credenziali { border-left: 3px solid var(--gold-500); background: #FFFDF8; margin-bottom: 1.2rem; }
.password-generata {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 1.05rem; letter-spacing: .06em; font-weight: 700;
  background: var(--gold-100); color: #7A5410; padding: .2rem .5rem; border-radius: 6px;
  user-select: all;
}

/* ---------- Lead locali ---------- */
.lead-categorie { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .4rem; }
.lead-categorie .chip { font-size: .78rem; padding: .3rem .7rem; }
.checkline { display: flex; align-items: flex-start; gap: .5rem; font-size: .85rem; line-height: 1.4; cursor: pointer; }
.checkline input { margin-top: .15rem; flex-shrink: 0; }

.lead-riga {
  display: grid; grid-template-columns: 1.4rem 1fr auto; gap: .7rem; align-items: start;
  padding: .7rem 0; border-bottom: 1px dashed var(--line); cursor: pointer;
}
.lead-riga:last-of-type { border-bottom: 0; }
/* Chi è già in archivio si vede ma non si riseleziona: sarebbe
   un doppione, e ricomincerebbe da capo una lavorazione avviata. */
.lead-riga.gia { opacity: .55; cursor: default; }
.lead-riga input { margin-top: .25rem; }
.lead-corpo { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.lead-corpo strong { font-size: .95rem; }
.lead-corpo > span { font-size: .82rem; color: var(--ink-soft); }
.lead-meta { font-size: .78rem !important; }

.lead-scheda {
  display: grid; grid-template-columns: 1fr auto; gap: 1rem; align-items: start;
  padding: .85rem 0; border-bottom: 1px dashed var(--line);
}
.lead-scheda:last-of-type { border-bottom: 0; }
.lead-lavorazione { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.lead-lavorazione select {
  font-size: .8rem; padding: .3rem .5rem; border-radius: 8px;
  border: 1.5px solid var(--line); background: #fff; font-family: var(--font-body);
}
@media (max-width: 700px) {
  .lead-scheda { grid-template-columns: 1fr; }
}

/* ---------- Pipeline ---------- */
/* Cinque colonne che scorrono di lato invece di stringersi: una
   colonna troppo stretta smette di far vedere quello per cui
   esiste, cioè dove si accumula il lavoro. */
.pl-colonne {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr);
  gap: .8rem; overflow-x: auto; padding-bottom: .6rem; margin-top: 1rem;
}
.pl-colonna { background: var(--green-50); border-radius: var(--radius); padding: .8rem; min-height: 120px; }
.pl-colonna h4 { font-size: .82rem; margin: 0 0 .6rem; display: flex; align-items: center; gap: .4rem; }
.pl-card {
  display: block; width: 100%; text-align: left; background: #fff; border: 1.5px solid var(--line);
  border-radius: 10px; padding: .6rem .7rem; margin-bottom: .5rem; cursor: pointer;
  font-family: var(--font-body); transition: border-color .15s, transform .15s;
}
.pl-card:hover { border-color: var(--green-600); transform: translateY(-1px); }
.pl-card.aperta { border-color: var(--green-800); box-shadow: 0 0 0 2px var(--green-100); }
.pl-card strong { display: block; font-size: .88rem; line-height: 1.25; }
.pl-card > span { display: block; font-size: .76rem; color: var(--ink-soft); }
.pl-piede { margin-top: .35rem; font-size: .72rem !important; }
.pl-etichette { display: flex; flex-wrap: wrap; gap: .2rem; margin: .35rem 0 0; }

.tag {
  display: inline-flex; align-items: center; gap: .25rem;
  font-size: .68rem; font-weight: 700; border-radius: 999px; padding: .1rem .5rem;
}
.tag-verde  { background: var(--green-100); color: var(--green-800); }
.tag-oro    { background: var(--gold-100);  color: #8A5B0B; }
.tag-rosso  { background: #FCEDED;          color: #9B2C2C; }
.tag-blu    { background: #E7EEF9;          color: #1F4E8C; }
.tag-grigio { background: #ECEFEE;          color: #4C5F55; }
.tag-x { background: none; border: 0; cursor: pointer; color: inherit; font-size: .7rem; padding: 0 0 0 .1rem; opacity: .6; }
.tag-x:hover { opacity: 1; }

.pl-dettaglio { margin-top: 1.2rem; border-left: 3px solid var(--green-600); }
.pl-attivita { border-bottom: 1px dashed var(--line); padding: .6rem 0; }
.pl-attivita:last-of-type { border-bottom: 0; }
.pl-attivita-capo { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; font-size: .82rem; }
.pl-attivita-capo .muted { font-size: .75rem; }
.pl-attivita p { font-size: .85rem; color: var(--ink-soft); margin: .3rem 0; line-height: 1.5; }

/* ---------- Posta ---------- */
/* Il corpo dell'anteprima si mostra come partirà davvero: a
   spaziatura fissa e con gli a capo rispettati, perché è quello
   che riceverà chi legge. */
.mail-corpo {
  background: #FCFDFC; border: 1px solid var(--line); border-radius: var(--radius);
  padding: .9rem 1rem; margin: .6rem 0 0; font-size: .84rem; line-height: 1.6;
  white-space: pre-wrap; word-break: break-word; font-family: ui-monospace, Menlo, Consolas, monospace;
  max-height: 380px; overflow-y: auto;
}

/* ---------- Produzione ---------- */
.prod-riga { display: grid; grid-template-columns: 1.8rem 34px 1fr auto; gap: .7rem; align-items: center; padding: .7rem 0; border-bottom: 1px dashed var(--line); }
.prod-riga:last-of-type { border-bottom: 0; }
.prod-info { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.prod-info > span { font-size: .78rem; color: var(--ink-soft); }
.prod-barra { display: block; background: var(--green-50); border-radius: 999px; height: 6px; overflow: hidden; margin: .15rem 0; }
.prod-barra i { display: block; height: 100%; background: linear-gradient(90deg, var(--green-600), var(--green-800)); border-radius: 999px; }
.prod-dettaglio { font-size: .74rem !important; }
@media (max-width: 620px) {
  .prod-riga { grid-template-columns: 1.5rem 1fr auto; }
  .prod-riga .mini-avatar { display: none; }
}

/* ---------- Documenti ---------- */
.doc-riga {
  display: grid; grid-template-columns: 2.2rem 1fr auto; gap: .8rem; align-items: start;
  padding: .8rem 0; border-bottom: 1px dashed var(--line);
}
.doc-riga:last-child { border-bottom: 0; }
.doc-icona { font-size: 1.3rem; line-height: 1.4; }
.doc-info { display: flex; flex-direction: column; gap: .12rem; min-width: 0; }
.doc-info strong { font-size: .95rem; word-break: break-word; }
.doc-info > span { font-size: .8rem; color: var(--ink-soft); }
.doc-note { font-style: italic; }
.doc-scadenza { font-size: .78rem; font-weight: 600; color: var(--ink-soft); }
.doc-scadenza.in-scadenza { color: #8A5B0B; }
.doc-scadenza.scaduto { color: var(--danger); }
.doc-azioni { display: flex; gap: .35rem; align-items: center; flex-wrap: wrap; }
@media (max-width: 620px) {
  .doc-riga { grid-template-columns: 2.2rem 1fr; }
  .doc-azioni { grid-column: 2; }
}

/* Segnalazioni */
.admin-seg { margin-bottom: .8rem; border-left: 3px solid var(--danger); }
.admin-seg.accolta { border-left-color: var(--green-600); }
.admin-seg.respinta { border-left-color: var(--line); opacity: .75; }

/* ---------- CTA presente ma non ancora attivabile ---------- */
.btn-disabled {
  opacity: .55; cursor: not-allowed; pointer-events: none;
  box-shadow: none;
}

/* ---------- Recapiti del professionista ---------- */
.recapiti-card { border-left: 3px solid var(--green-600); }
.recapiti-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .55rem 0; border-bottom: 1px solid var(--line); font-size: .9rem; flex-wrap: wrap; }
.recapiti-row:last-of-type { border-bottom: 0; }
.recapiti-row strong { font-family: var(--font-body); color: var(--green-800); }

/* ---------- Trasparenza: gestore del sito in vetrina ---------- */
.nota-gestore {
  font-size: .78rem; line-height: 1.5; margin: .1rem 0 0;
  background: var(--gold-100); border: 1px solid rgba(226,166,61,.45);
  border-radius: 10px; padding: .5rem .7rem; color: #7A5410;
}
.nota-gestore a { color: #7A5410; text-decoration: underline; }

/* ---------- Sezione E: intermediario per cui si opera ---------- */
.opera-per { font-size: .8rem; color: var(--ink-soft); margin: .1rem 0 0; }
.opera-per strong { color: var(--ink); font-weight: 600; }

/* ---------- Guide correlate (link interni) ---------- */
.correlate { margin-top: 2.2rem; padding-top: 1.4rem; border-top: 1px solid var(--line); }
.correlate h3 { font-size: 1.1rem; margin-bottom: .8rem; }
.correlata {
  display: block; background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: .9rem 1.1rem; margin-bottom: .6rem; transition: border-color .18s var(--ease), transform .18s var(--ease);
}
.correlata:hover { border-color: var(--green-600); transform: translateX(3px); }
.correlata-cat {
  display: inline-block; font-size: .68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--green-testo); margin-bottom: .2rem;
}
.correlata-titolo { display: block; font-family: var(--font-display); font-weight: 700; font-size: 1rem; color: var(--ink); line-height: 1.25; }
.correlata-meta { display: block; font-size: .82rem; color: var(--ink-soft); margin-top: .25rem; line-height: 1.5; }

/* Qualifica di chi ha firmato una risposta arrivata dal database */
.badge-qualifica { background: var(--green-50); color: var(--green-800); font-weight: 600; }

/* ---------- Mail Marketing ---------- */
/* La sidebar del modulo, con i tre stati che aveva su Lovable:
   aperta, ridotta a icone, nascosta del tutto. */
.mm-shell { display: grid; grid-template-columns: 13.5rem 1fr; gap: 1.4rem; align-items: start; }
.mm-shell.senza-menu { grid-template-columns: 1fr; }

.mm-menu {
  position: sticky; top: 1rem;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: .7rem; box-shadow: var(--shadow-soft);
}
.mm-menu.ridotta { width: 3.4rem; padding: .5rem .4rem; }
.mm-menu-testa { display: flex; align-items: center; justify-content: space-between; gap: .4rem; margin-bottom: .6rem; }
.mm-menu.ridotta .mm-menu-testa { justify-content: center; }
.mm-menu-bottoni { display: flex; gap: .15rem; }
.mm-menu-btn {
  width: 1.5rem; height: 1.5rem; display: inline-flex; align-items: center; justify-content: center;
  border: 0; background: none; border-radius: 6px; cursor: pointer;
  color: var(--ink-soft); font-size: .9rem; line-height: 1;
}
.mm-menu-btn:hover { background: var(--green-50); color: var(--green-800); }

.mm-riapri {
  position: sticky; top: 1rem; align-self: start;
  width: 2rem; height: 2.6rem; border: 1px solid var(--line); border-left: 0;
  border-radius: 0 8px 8px 0; background: var(--card); cursor: pointer; color: var(--ink-soft);
}
.mm-riapri:hover { background: var(--green-50); color: var(--green-800); }

.mm-mittente { display: block; margin-bottom: .6rem; }
.mm-mittente-eti { display: block; font-size: .68rem; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--ink-soft); margin-bottom: .2rem; }
.mm-mittente select { width: 100%; font-size: .8rem; padding: .35rem .4rem;
  border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); }

.mm-voci { display: flex; flex-direction: column; gap: .1rem; }
.mm-voce {
  display: flex; align-items: center; gap: .55rem;
  padding: .45rem .55rem; border-radius: 8px; text-decoration: none;
  font-size: .82rem; font-weight: 500; color: var(--ink-soft);
}
.mm-menu.ridotta .mm-voce { justify-content: center; padding: .5rem 0; }
.mm-voce:hover { background: var(--green-50); color: var(--green-800); }
.mm-voce.attiva { background: var(--green-100); color: var(--green-800); font-weight: 700; }
.mm-voce-ico { font-size: .95rem; line-height: 1; }

.mm-corpo { min-width: 0; }
.mm-avviso { margin-bottom: 1.2rem; }

/* I riquadri numerici della Dashboard */
.mm-riquadri { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: .8rem; margin-bottom: 1.2rem; }
.mm-riq {
  display: flex; flex-direction: column; gap: .1rem; text-align: left;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: .85rem .9rem; cursor: pointer; text-decoration: none; color: inherit;
  font: inherit; transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.mm-riq:hover { border-color: var(--green-600); box-shadow: var(--shadow-soft); }
.mm-riq-ico { font-size: 1rem; }
.mm-riq-num { font-family: var(--font-display); font-size: 1.55rem; font-weight: 800; color: var(--ink); line-height: 1.1; }
.mm-riq-num.parola { font-size: 1.05rem; font-weight: 700; line-height: 1.25; }
.mm-riq-eti { font-size: .78rem; color: var(--ink-soft); }
.mm-riq-sub { font-size: .7rem; color: var(--ink-soft); opacity: .75; }

.mm-griglia { display: grid; grid-template-columns: 2fr 1fr; gap: 1rem; margin-bottom: 1rem; align-items: start; }
.mm-griglia > * { min-width: 0; }
.mm-griglia .card { margin: 0; }
.mm-testata { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-bottom: .5rem; }
.mm-testata h3 { margin: 0; font-size: .98rem; }
.mm-link { font-size: .78rem; color: var(--green-800); text-decoration: none; font-weight: 600; }
.mm-link:hover { text-decoration: underline; }
.mm-vuoto { border: 1px dashed var(--line); border-radius: var(--radius);
  padding: 1.6rem .9rem; text-align: center; font-size: .85rem; margin: 0; }

/* Il grafico a barre dei quattordici giorni */
.mm-barre { display: flex; align-items: flex-end; gap: .3rem; height: 9rem; }
.mm-barra { flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: flex-end; height: 100%; gap: .25rem; }
.mm-barra-riemp { width: 100%; min-height: 2px; border-radius: 5px 5px 0 0;
  background: var(--green-600); }
.mm-barra-eti { font-size: .55rem; color: var(--ink-soft); white-space: nowrap; }

.mm-casella { border: 1px solid var(--line); border-radius: 10px; padding: .6rem .7rem; margin-bottom: .5rem; }
.mm-casella:last-child { margin-bottom: 0; }
.mm-quota { height: 5px; background: var(--green-50); border-radius: 999px; overflow: hidden; }
.mm-quota-riemp { height: 100%; background: var(--green-600); border-radius: 999px; }
.mm-quota-eti { font-size: .68rem; color: var(--ink-soft); margin: .3rem 0 0; }

.mm-elenco { list-style: none; margin: 0; padding: 0; }
.mm-elenco li { display: flex; align-items: flex-start; justify-content: space-between;
  gap: .7rem; padding: .5rem 0; border-top: 1px solid var(--line); }
.mm-elenco li:first-child { border-top: 0; }
.mm-elenco-testo { min-width: 0; display: flex; flex-direction: column; gap: .1rem; font-size: .84rem; }
.mm-elenco-testo span { font-size: .76rem; }
.mm-elenco-data { font-size: .7rem; color: var(--ink-soft); white-space: nowrap; }
.mm-errore { color: var(--danger); font-size: .76rem; margin: 0; }
.mm-card-errore { border-left: 3px solid var(--danger); }

/* Il dettaglio di un riquadro */
.mm-velo { position: fixed; inset: 0; z-index: 90; background: rgba(11, 46, 29, .45);
  display: flex; align-items: center; justify-content: center; padding: 1.2rem; }
.mm-dialogo { max-width: 34rem; width: 100%; margin: 0; }

@media (max-width: 860px) {
  .mm-shell, .mm-shell.senza-menu { grid-template-columns: 1fr; }
  .mm-menu, .mm-menu.ridotta { position: static; width: auto; }
  .mm-menu.ridotta .mm-voce { justify-content: flex-start; padding: .45rem .55rem; }
  .mm-voci { flex-direction: row; flex-wrap: wrap; }
  .mm-griglia { grid-template-columns: 1fr; }
  .mm-barra-eti { display: none; }
}

/* ---------- Mail Marketing · caselle di invio ---------- */
.mm-testata-sezione { align-items: flex-start; margin-bottom: 1.1rem; flex-wrap: wrap; }
.mm-testata-sezione > p { flex: 1 1 20rem; }
.mm-testata-sezione > .mm-azioni { flex: 0 0 auto; flex-wrap: nowrap; }
.mm-azioni { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
/* Il cestino sta da solo all'altro capo: cancellare non è
   un'azione da mettere accanto a quelle che si usano ogni giorno. */
.mm-azioni .danger { margin-left: auto; }

.mm-caselle { display: grid; grid-template-columns: repeat(auto-fill, minmax(24rem, 1fr)); gap: 1rem; }
.mm-casella-grande { margin: 0; display: flex; flex-direction: column; gap: .7rem; }
.mm-casella-grande.in-errore { border-left: 3px solid var(--danger); }

.mm-errore-box { background: #FDF0F0; border-radius: 8px; padding: .45rem .6rem; }
.mm-ok-box { color: var(--green-testo); font-size: .78rem; margin: 0; }

.mm-quota-riga { display: flex; justify-content: space-between; font-size: .72rem;
  color: var(--ink-soft); margin-bottom: .2rem; }
.mm-quota-riemp.quasi { background: var(--gold-500); }
.mm-quota-riemp.piena { background: var(--danger); }

.mm-dns-sunto { border: 1px solid var(--line); border-radius: 10px; padding: .55rem .7rem; }
.mm-dns-eti { font-size: .72rem; font-weight: 700; letter-spacing: .03em;
  text-transform: uppercase; color: var(--ink-soft); }
.mm-semafori { display: flex; gap: .9rem; font-size: .76rem; margin: .4rem 0 0; color: var(--ink-soft); }

.mm-firma > summary { cursor: pointer; font-size: .82rem; font-weight: 600; color: var(--ink-soft); }
.mm-firma > summary:hover { color: var(--green-800); }
.mm-firma textarea { width: 100%; margin-top: .5rem; font-family: var(--font-body);
  font-size: .8rem; padding: .5rem .6rem; border: 1px solid var(--line); border-radius: 8px;
  background: var(--card); color: var(--ink); resize: vertical; }
.mm-firma-piede { display: flex; justify-content: space-between; align-items: center;
  gap: .6rem; flex-wrap: wrap; margin-top: .4rem; font-size: .78rem; color: var(--ink-soft); }
.mm-firma-piede label { display: flex; align-items: center; gap: .35rem; }

/* Il modulo della casella */
.mm-dialogo-largo { max-width: 46rem; max-height: 88vh; overflow-y: auto; }
.mm-campi { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.mm-campo-largo { grid-column: 1 / -1; }
.mm-campi .field { margin: 0; }
.mm-campi .field > span { display: block; font-size: .74rem; font-weight: 700;
  letter-spacing: .03em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: .2rem; }
.mm-campi input, .mm-campi select { width: 100%; }
.mm-interruttore { display: flex; align-items: flex-start; gap: .55rem;
  border: 1px solid var(--line); border-radius: 10px; padding: .55rem .7rem; }
.mm-interruttore input { width: auto; margin-top: .15rem; }
.mm-interruttore span { font-size: .84rem; font-weight: 600; text-transform: none;
  letter-spacing: 0; color: var(--ink); }
.mm-interruttore em { display: block; font-style: normal; font-weight: 400;
  font-size: .76rem; color: var(--ink-soft); margin-top: .1rem; }

/* I record del dominio */
.mm-punteggio { border: 1px solid var(--line); border-radius: 10px; padding: .6rem .75rem; margin-bottom: .8rem; }
.mm-dns-blocco { border: 1px solid var(--line); border-radius: 10px; padding: .6rem .75rem; margin-bottom: .6rem; }
.mm-record { display: block; font-size: .72rem; background: var(--green-50);
  border-radius: 6px; padding: .4rem .5rem; word-break: break-all; margin-bottom: .25rem; }
.mm-consiglio { display: flex; gap: .4rem; align-items: flex-start; margin-top: .4rem; }
.mm-consiglio .mm-record { flex: 1; margin: 0; }
.mm-consiglio-testo { font-size: .76rem; color: var(--ink-soft); background: var(--green-50);
  border-radius: 6px; padding: .4rem .5rem; margin: .35rem 0 0; }

@media (max-width: 700px) {
  .mm-caselle { grid-template-columns: 1fr; }
  .mm-campi { grid-template-columns: 1fr; }
  .mm-consiglio { flex-direction: column; }
}

/* ---------- Mail Marketing · lead e liste ---------- */
.mm-tabella { overflow-x: auto; }
.mm-tabella table { width: 100%; border-collapse: collapse; font-size: .84rem; }
.mm-tabella th { text-align: left; font-weight: 600; font-size: .72rem;
  letter-spacing: .03em; text-transform: uppercase; color: var(--ink-soft);
  padding: .45rem .5rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.mm-tabella td { padding: .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.mm-tabella tr:last-child td { border-bottom: 0; }
.mm-tabella tr.gia-presente { opacity: .62; }
.mm-tabella tr.opposto { background: #FDF6F6; }
.mm-contatti { display: flex; flex-direction: column; gap: .1rem; font-size: .78rem; }
.mm-contatti a { color: var(--green-800); text-decoration: none; overflow-wrap: anywhere; }
.mm-contatti a:hover { text-decoration: underline; }

.mm-barra-scelta { display: flex; align-items: center; justify-content: space-between;
  gap: .8rem; flex-wrap: wrap; margin-top: .8rem; padding-top: .7rem;
  border-top: 1px solid var(--line); font-size: .84rem; font-weight: 600; }

.mm-liste-shell { display: grid; grid-template-columns: 15rem 1fr; gap: 1rem; align-items: start; }
/* In una griglia una colonna non si stringe sotto il proprio
   contenuto se non glielo si dice: senza questo, una tabella
   larga allarga la colonna e con lei tutta la pagina. */
.mm-liste-shell > * { min-width: 0; }
.mm-liste-elenco { display: flex; flex-direction: column; gap: .25rem; }
.mm-lista-voce { display: flex; align-items: center; justify-content: space-between;
  gap: .5rem; padding: .5rem .65rem; border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); text-decoration: none; color: var(--ink); font-size: .84rem; }
.mm-lista-voce:hover { border-color: var(--green-600); }
.mm-lista-voce.attiva { border-color: var(--green-800); background: var(--green-50); font-weight: 700; }
.mm-lista-nome { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mm-lista-contenuto { margin: 0; }

@media (max-width: 860px) {
  .mm-liste-shell { grid-template-columns: 1fr; }
  .mm-liste-elenco { flex-direction: row; flex-wrap: wrap; }
}

/* ---------- Mail Marketing · modelli e scrittura assistita ---------- */
.mm-segnaposto { margin: 0 0 1rem; padding: .7rem .9rem; }
.mm-segnaposto strong { font-size: .8rem; }
.mm-segnaposto p { margin: .3rem 0 0; font-size: .8rem; color: var(--ink-soft); }
.mm-segnaposto code { background: var(--green-50); border-radius: 5px; padding: .05rem .3rem; }

.mm-modello { margin: 0; display: flex; flex-direction: column; gap: .6rem; }
.mm-modello.spento { opacity: .62; }
.mm-modello-corpo {
  margin: 0; max-height: 11rem; overflow: auto;
  background: var(--green-50); border-radius: 8px; padding: .6rem .7rem;
  font-family: var(--font-body); font-size: .8rem; line-height: 1.5;
  white-space: pre-wrap; word-break: break-word;
}

/* ---------- Mail Marketing · posta in uscita ---------- */
.mm-riq.scelto { border-color: var(--green-800); background: var(--green-50); }
.mm-cerca { min-width: 15rem; padding: .4rem .6rem; font-size: .84rem;
  border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); }
.mm-tabella td a { color: var(--green-800); text-decoration: none; font-weight: 600; }
.mm-tabella td a:hover { text-decoration: underline; }
/* Cinque riquadri: su una riga sola, non quattro più uno. */
.mm-riquadri-cinque { grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); }

/* --- Send Log: lo stato della coda automatica ---
   Una riga sola in cima alla sezione. La spia è verde quando il
   cron ha appena girato e ambra quando tace da troppo: il colore
   dice in un colpo d'occhio quello che la data dice per esteso. */
.mm-coda-stato { border-left: 3px solid var(--green-600); }
.mm-coda-stato.ferma { border-left-color: #b45309; background: #fffbeb; }
.mm-coda-riga { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.mm-coda-riga > div:first-of-type { min-width: 0; flex: 1 1 12rem; }
.mm-coda-spia { width: .6rem; height: .6rem; border-radius: 50%;
  background: var(--green-600); flex: 0 0 auto; }
.mm-coda-stato.ferma .mm-coda-spia { background: #b45309; }
.mm-coda-attesa { display: flex; align-items: baseline; gap: .35rem; margin-left: auto; }
.mm-coda-num { font-family: var(--font-display); font-size: 1.3rem; font-weight: 800; color: var(--ink); }

/* Tre controlli di filtro non stanno su una riga sola di
   telefono. Il gruppo delle azioni normalmente non va a capo —
   lì dentro sono un campo e un pulsante — ma questo sì, e i
   controlli si stringono invece di sfondare la pagina. */
.mm-testata-sezione > .mm-azioni.mm-filtri { flex: 1 1 16rem; flex-wrap: wrap; min-width: 0; }
.mm-filtri > .mm-cerca { min-width: 0; flex: 1 1 9rem; }
/* «Partita» spezzato in due righe sembra un errore di stampa. */
.mm-esito { white-space: nowrap; }

/* I giri della coda stanno chiusi: servono quando qualcosa non
   torna, e il resto del tempo sono rumore. */
.mm-giri > summary { cursor: pointer; font-weight: 600; color: var(--ink); }
.mm-giri > summary::marker { color: var(--green-600); }

/* --- Blacklist & Compliance, Automazioni ---
   La scheda che spiega la regola sta in cima e si distingue dal
   resto: non è un elenco, è il motivo per cui l'elenco esiste. */
.mm-compliance { border-left: 3px solid var(--green-800); }

/* Riquadri che contano e basta: senza il bordo che si accende
   al passaggio, perché non c'è niente da premere. */
.mm-riq-fermo { cursor: default; }
.mm-riq-fermo:hover { border-color: var(--line); box-shadow: none; }

.mm-sequenza.accesa { border-left: 3px solid var(--green-600); }
.pill-ok { background: var(--green-50); color: var(--green-800); border-color: var(--green-600); }

/* I passi come una scaletta: quando parte ognuno, e cosa manda. */
.mm-passi { list-style: none; margin: .6rem 0 0; padding: 0;
  border-left: 2px solid var(--line); }
.mm-passi li { position: relative; padding: .3rem 0 .3rem .9rem;
  font-size: .86rem; display: flex; gap: .6rem; flex-wrap: wrap; align-items: baseline; }
.mm-passi li::before { content: ""; position: absolute; left: -5px; top: .75rem;
  width: 8px; height: 8px; border-radius: 50%; background: var(--green-600); }
.mm-passo-quando { font-size: .74rem; color: var(--ink-soft);
  background: var(--green-50); border-radius: 999px; padding: .1rem .5rem; white-space: nowrap; }

.mm-passo-mod { border: 1px solid var(--line); border-radius: 10px;
  padding: .7rem; margin-bottom: .6rem; background: var(--card); }

.mm-griglia-due { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: .6rem; }
.mm-griglia-due > * { min-width: 0; }

/* --- L'intestazione principale di una pagina di sezione ---
   Directory, bacheca e preventivo avevano un <h2> come titolo
   piu' alto: leggibile per una persona, ma per un motore di
   ricerca una pagina senza h1 e' una pagina che non dichiara di
   cosa parla. Ora e' un h1, e prende esattamente la misura che
   aveva prima da h2: cambia il significato del marcatore, non
   il disegno. */
.titolo-sezione { font-size: clamp(1.6rem, 3.4vw, 2.3rem); font-weight: 700; }

/* --- Elenco della pagina 404 ---
   Non un elenco puntato qualunque: sono le strade da cui
   ripartire, e vanno lette come tali. */
.lista-404 { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.lista-404 li { font-size: .92rem; color: var(--ink-soft); }
.lista-404 a { color: var(--green-800); font-weight: 600; text-decoration: none; }
.lista-404 a:hover { text-decoration: underline; }

/* --- Le domande di identità in home ---
   Chiuse di default: chi sa già cos'è QuotaFacile scorre, chi
   non lo sa apre quella che gli serve. Il testo resta nell'HTML
   anche da chiuso, quindi un motore lo legge comunque. */
.section-identita .identita-elenco { display: grid; gap: .7rem; max-width: 52rem; }
.identita-voce { border: 1px solid var(--line); border-radius: 12px;
  background: var(--card); padding: .9rem 1.1rem; }
.identita-voce > summary { cursor: pointer; font-weight: 700; color: var(--ink);
  font-size: 1rem; line-height: 1.35; list-style: none; display: flex;
  justify-content: space-between; align-items: center; gap: 1rem; }
.identita-voce > summary::-webkit-details-marker { display: none; }
.identita-voce > summary::after { content: "+"; color: var(--green-600);
  font-weight: 800; font-size: 1.3rem; line-height: 1; flex: 0 0 auto; }
.identita-voce[open] > summary::after { content: "–"; }
.identita-voce > p { margin: .7rem 0 0; font-size: .93rem; line-height: 1.65; color: var(--ink-soft); }
.identita-voce a { color: var(--green-800); font-weight: 600; }

/* ---------- Link dentro il testo ----------
   Il criterio 1.4.1 delle WCAG dice che il colore non può essere
   l'unico modo per distinguere qualcosa. Un link dentro un
   paragrafo che si riconosce solo perché è verde non lo vede chi
   non distingue quel verde dal nero — e non lo vede nessuno su
   una stampa in bianco e nero o con un filtro di lettura.

   Vale per il testo che si legge di seguito, non per la
   navigazione, i bottoni, le schede: lì la forma e la posizione
   dicono già che si può cliccare. Per questo la regola è
   circoscritta ai contenitori di prosa invece di stare su tutti
   gli <a> del sito. */
#app p a:not(.btn):not([class*="card"]),
#app li a:not(.btn):not([class*="card"]),
#app td a:not(.btn),
#app dd a:not(.btn),
#app .lead a:not(.btn),
#app .legal-callout a:not(.btn),
#app .privacy-hint a:not(.btn),
.cc-modal p a,
.footer-bottom p a {
  text-decoration: underline;
  text-underline-offset: .15em;
  text-decoration-thickness: from-font;
}

/* ---------- Accessibilità: fuoco e annunci ---------- */

/* Visibile solo a chi legge con uno screen reader. Non
   display:none e non visibility:hidden — quelli tolgono
   l'elemento anche dall'albero di accessibilità, che è il
   contrario di quello che serve qui. */
/* Niente margin negativo: il modo classico di nascondere un
   elemento lo sposta di un pixel fuori dal bordo sinistro, e un
   pixel fuori dal bordo è comunque una pagina che scorre di
   lato. Basta ritagliarlo dov'è. */
.solo-lettori {
  position: absolute; width: 1px; height: 1px;
  margin: 0; padding: 0; border: 0;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}

/* Fuori dallo schermo finché non riceve il fuoco, poi scende in
   alto a sinistra. Sta sopra la barra fissa (z-index 60). */
.skip-link {
  position: fixed; top: 0; left: 0; z-index: 200;
  transform: translateY(-120%);
  background: var(--green-800); color: #fff;
  padding: .7rem 1.1rem; border-radius: 0 0 var(--radius) 0;
  font-size: .9rem; font-weight: 600; text-decoration: none;
  transition: transform .15s var(--ease);
}
.skip-link:focus { transform: translateY(0); outline: 3px solid var(--gold-500); outline-offset: -3px; }

/* <main> riceve il fuoco a ogni cambio di rotta, ma disegnargli
   intorno un contorno grande quanto la pagina non aiuta nessuno:
   dice solo "sei qui", e quello lo dice già lo screen reader. */
#app:focus { outline: none; }

/* ---------- Magazine (area riservata) ---------- */

.mag-riepilogo {
  display: grid; gap: .8rem; margin-bottom: 1.2rem;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
}
.mag-riq { display: flex; flex-direction: column; gap: .15rem; padding: .9rem 1rem; }
.mag-riq-n {
  font-family: var(--font-display); font-weight: 800; font-size: 1.7rem;
  line-height: 1; color: var(--green-800); font-variant-numeric: tabular-nums;
}
.mag-riq span:last-child { font-size: .78rem; color: var(--ink-soft); }

/* La tabella può essere più larga dello schermo su un telefono:
   scorre lei, dentro la sua cornice, invece di far scorrere di
   lato tutta la pagina. */
.mag-tabella-cornice { overflow-x: auto; }
.mag-tabella { width: 100%; border-collapse: collapse; font-size: .9rem; }
.mag-tabella th {
  text-align: left; font-size: .68rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-soft); font-weight: 600; padding: .7rem .9rem;
  background: var(--bg); border-bottom: 1px solid var(--line);
}
.mag-tabella td { padding: .8rem .9rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.mag-tabella tr:last-child td { border-bottom: 0; }
.mag-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.mag-azioni { text-align: right; white-space: nowrap; }
.mag-azioni .btn + .btn, .mag-azioni a + a { margin-left: .35rem; }

.mag-titolo { display: block; font-weight: 600; color: var(--ink); text-decoration: none; }
.mag-titolo:hover { color: var(--green-800); text-decoration: underline; }
.mag-sotto { display: block; margin-top: .2rem; font-size: .78rem; color: var(--ink-soft); }

.mag-stato {
  display: inline-block; padding: .2rem .55rem; border-radius: 999px;
  font-size: .7rem; font-weight: 700; white-space: nowrap;
}
.mag-bozza { background: var(--gold-100); color: #8A5F11; }
.mag-online { background: var(--green-50); color: var(--green-800); }
.mag-ritirato { background: var(--bg); color: var(--ink-soft); border: 1px solid var(--line); }

/* L'editor: il testo a sinistra e tutto il resto in una colonna
   a parte. Su uno schermo stretto diventano una colonna sola,
   con il testo per primo — è quello per cui si è aperta la
   pagina. */
.mag-editor { display: grid; gap: 1.2rem; grid-template-columns: minmax(0, 1fr) 22rem; align-items: start; }
.mag-colonna { min-width: 0; display: flex; flex-direction: column; gap: 1rem; }
.mag-fianco { display: flex; flex-direction: column; gap: 1rem; }
.mag-fianco .card { padding: 1rem; }
@media (max-width: 900px) {
  .mag-editor { grid-template-columns: 1fr; }
}

.mag-corpo-testa { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
#mag-corpo {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: .87rem; line-height: 1.65; tab-size: 2;
}
.mag-lungo { color: var(--danger); font-weight: 600; }

.mag-preview {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card); padding: 1.2rem 1.4rem; max-height: 34rem; overflow-y: auto;
}
.mag-preview h2 { font-size: 1.35rem; margin: 1.4rem 0 .5rem; }
.mag-preview h3 { font-size: 1.1rem; margin: 1.1rem 0 .4rem; }
.mag-preview h4 { font-size: .96rem; margin: .9rem 0 .3rem; }
.mag-preview > :first-child { margin-top: 0; }
.mag-preview img { border-radius: var(--radius); }
.mag-preview blockquote {
  margin: 1rem 0; padding: .2rem 0 .2rem 1rem;
  border-left: 3px solid var(--green-600); color: var(--ink-soft);
}

.mag-cover-anteprima { margin-top: .6rem; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.mag-cover-anteprima img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.mag-cover-nota { display: block; padding: .3rem .5rem; font-size: .7rem; background: var(--bg); color: var(--ink-soft); }
.mag-cover-nota.ok { background: var(--green-50); color: var(--green-800); }
.mag-cover-nota.ko { background: #FCECEC; color: var(--danger); }

.mag-bottoni { display: flex; flex-direction: column; gap: .5rem; }

/* ---------- Magazine (pubblico) ---------- */

.mag-griglia {
  display: grid; gap: 1.1rem; margin-bottom: 2.2rem;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
}
.mag-griglia-pillar { grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr)); }

.mag-sezione-titolo {
  font-size: 1.15rem; font-weight: 700; margin: 0 0 .9rem;
  font-family: var(--font-display);
}

.mag-card {
  display: flex; flex-direction: column;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; text-decoration: none; color: inherit;
  transition: border-color .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease);
}
.mag-card:hover { border-color: var(--green-600); transform: translateY(-2px); box-shadow: var(--shadow-med); }
/* Il fuoco si vede sulla scheda intera, non sul testo dentro:
   è la scheda che si sta per aprire. */
.mag-card:focus-visible { outline: 3px solid var(--green-600); outline-offset: 2px; }

.mag-card-cover { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.mag-card-vuota { background: linear-gradient(135deg, var(--green-50), var(--gold-100)); }
.mag-card-grande .mag-card-cover { aspect-ratio: 21 / 9; }

.mag-card-corpo { display: flex; flex-direction: column; gap: .4rem; padding: 1rem 1.1rem 1.2rem; }
.mag-card-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: .45rem;
  font-size: .74rem; color: var(--ink-soft);
}
.mag-card-cat {
  background: var(--green-50); color: var(--green-800);
  padding: .1rem .5rem; border-radius: 999px; font-weight: 600;
}
.mag-pillar-tag {
  background: var(--gold-100); color: #8A5F11;
  padding: .1rem .5rem; border-radius: 999px; font-weight: 700;
}
.mag-card-titolo {
  font-family: var(--font-display); font-weight: 700; font-size: 1.05rem;
  line-height: 1.25; text-wrap: balance;
}
.mag-card-grande .mag-card-titolo { font-size: 1.3rem; }
.mag-card:hover .mag-card-titolo { color: var(--green-800); }
.mag-card-apertura { font-size: .88rem; line-height: 1.5; color: var(--ink-soft); }
.mag-card-pillar { border-left: 3px solid var(--gold-500); }

/* ----- la pagina di un articolo ----- */

.mag-briciole { font-size: .82rem; color: var(--ink-soft); margin-bottom: 1.1rem; }
.mag-briciole a { color: var(--ink-soft); text-decoration: underline; text-underline-offset: .15em; }
.mag-briciole a:hover { color: var(--green-800); }
.mag-briciole span { margin: 0 .35rem; }

.mag-testa-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem;
  font-size: .8rem; color: var(--ink-soft); margin-bottom: .7rem;
}
.mag-titolo-articolo {
  font-size: clamp(1.7rem, 4.4vw, 2.6rem); line-height: 1.12;
  text-wrap: balance; margin: 0 0 .7rem;
}
.mag-apertura { font-size: 1.08rem; color: var(--ink-soft); margin-bottom: 1.4rem; }
.mag-cover {
  display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover;
  border-radius: var(--radius-lg); margin-bottom: 1.6rem;
}

.mag-risale {
  background: var(--green-50); border-left: 3px solid var(--green-600);
  padding: .7rem 1rem; border-radius: 0 var(--radius) var(--radius) 0;
  font-size: .9rem; margin-bottom: 1.4rem;
}

.mag-indice {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg); padding: 1rem 1.2rem; margin-bottom: 1.8rem;
}
.mag-indice-titolo {
  font-family: var(--font-body); font-size: .72rem; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft);
  margin: 0 0 .5rem;
}
.mag-indice ol { margin: 0; padding-left: 1.1rem; font-size: .92rem; }
.mag-indice li { margin-bottom: .1rem; }
.mag-indice-sotto { margin-left: 1rem; font-size: .88rem; }
/* Le voci dell'indice sono link uno sotto l'altro: stretti come
   il testo che contengono restavano sotto i 24px che chiede il
   criterio 2.5.8, e su un telefono si sbaglia a premere. Il
   blocco con un po' di spazio sopra e sotto risolve senza
   allontanarle visivamente. */
.mag-indice a {
  display: block; padding: .28rem 0;
  color: var(--ink); text-decoration: none;
}
.mag-indice a:hover { color: var(--green-800); text-decoration: underline; }

/* Il testo dell'articolo. Misura vicina ai 68 caratteri: oltre,
   l'occhio perde la riga tornando a capo. */
.mag-prosa { font-size: 1.03rem; line-height: 1.72; }
.mag-prosa > :first-child { margin-top: 0; }
.mag-prosa h2 {
  font-size: clamp(1.3rem, 2.6vw, 1.6rem); line-height: 1.2;
  margin: 2.4rem 0 .7rem; scroll-margin-top: 5rem;
}
.mag-prosa h3 {
  font-size: 1.12rem; margin: 1.8rem 0 .5rem; scroll-margin-top: 5rem;
  font-family: var(--font-display); font-weight: 700;
}
.mag-prosa h4 {
  font-size: .98rem; margin: 1.3rem 0 .4rem;
  font-family: var(--font-body); font-weight: 700; color: var(--ink);
}
.mag-prosa p { margin: 0 0 1.1rem; }
.mag-prosa ul, .mag-prosa ol { margin: 0 0 1.2rem; padding-left: 1.3rem; }
.mag-prosa li { margin-bottom: .45rem; }
.mag-prosa a { color: var(--green-800); text-decoration: underline; text-underline-offset: .15em; }
.mag-prosa strong { font-weight: 700; }
.mag-prosa blockquote {
  margin: 1.4rem 0; padding: .3rem 0 .3rem 1.1rem;
  border-left: 3px solid var(--gold-500); color: var(--ink-soft); font-style: italic;
}
.mag-prosa blockquote p:last-child { margin-bottom: 0; }
.mag-prosa img { display: block; width: 100%; height: auto; border-radius: var(--radius); margin: 1.4rem 0; }
.mag-prosa hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }
.mag-prosa code {
  font-size: .9em; background: var(--bg); border: 1px solid var(--line);
  border-radius: 4px; padding: .05em .3em;
}
/* Una tabella larga scorre dentro di sé: la pagina no. */
.mag-prosa table { width: 100%; border-collapse: collapse; margin: 1.4rem 0; font-size: .92rem; display: block; overflow-x: auto; }
.mag-prosa th, .mag-prosa td { border: 1px solid var(--line); padding: .55rem .7rem; text-align: left; vertical-align: top; }
.mag-prosa th { background: var(--bg); font-weight: 600; }

.mag-firma { margin: 2rem 0 0; padding-top: 1.2rem; border-top: 1px solid var(--line); font-size: .9rem; color: var(--ink-soft); }
.mag-avvertenza { margin-top: 1rem; }

.mag-cta {
  margin: 2.4rem 0; padding: 1.4rem 1.5rem;
  background: var(--green-50); border: 1px solid var(--green-100);
  border-radius: var(--radius-lg);
}

.mag-correlati { margin-top: 2.8rem; }

@media (max-width: 560px) {
  .mag-griglia, .mag-griglia-pillar { grid-template-columns: 1fr; }
}

/* Il rimando al pillar in testa a un cluster: si legge prima del
   testo, perché serve a chi è arrivato qui da una ricerca stretta
   e non sa che esiste la guida completa. */
.mag-da-pillar {
  background: var(--gold-100); border-left: 3px solid var(--gold-500);
  padding: .7rem 1rem; border-radius: 0 var(--radius) var(--radius) 0;
  font-size: .9rem; margin: 0 0 1.6rem;
}
.mag-da-pillar a { color: #8A5F11; font-weight: 600; }
