/* =============================================================
   Gestire il mio stipendio — Foglio di stile
   Design rassicurante e pratico: sfondo chiaro, accenti verde
   salvia, blu petrolio e arancione tenue, card morbide, barre
   semplici, alta leggibilità e piena accessibilità da smartphone.
   ============================================================= */

/* ----------------------- Variabili ------------------------- */
:root {
  /* Sfondi chiari */
  --bg: #f3f7f4;
  --bg-soft: #e9f0eb;
  --surface: #ffffff;
  --surface-2: #f8fbf9;

  /* Testo ad alto contrasto su sfondo chiaro */
  --text: #1d2a2c;
  --text-soft: #45575a;
  --text-muted: #6a7a7c;

  /* Verde salvia — risparmio, conferme, serenità */
  --sage: #5f9c7d;
  --sage-dark: #3f7a5d;
  --sage-bg: #e6f1ea;

  /* Blu petrolio — colore guida, intestazioni, spese fisse */
  --petrol: #1f6b73;
  --petrol-dark: #134e54;
  --petrol-bg: #e1eef0;

  /* Arancione tenue — attenzione gentile, spese variabili */
  --orange: #db8a4e;
  --orange-dark: #b96a30;
  --orange-bg: #fbeede;

  /* Stati (toni morbidi, mai aggressivi) */
  --success: #2f7d57;
  --success-bg: #e6f3ec;
  --warn: #b9762e;
  --warn-bg: #fbf0e1;
  --error: #b5503f;
  --error-bg: #fbeae7;

  /* Bordi e ombre delicate */
  --border: #dde6e1;
  --border-strong: #c6d3cd;
  --shadow-sm: 0 1px 2px rgba(29, 42, 44, 0.06);
  --shadow: 0 8px 24px rgba(29, 42, 44, 0.08);
  --shadow-lg: 0 16px 44px rgba(31, 107, 115, 0.16);

  /* Forme */
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;

  /* Tipografia e spazi */
  --font: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  --font-num: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --maxw: 1080px;
  --gap: 20px;

  --focus-ring: 0 0 0 3px #ffffff, 0 0 0 6px var(--petrol);
}

/* ----------------------- Reset leggero --------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1100px 480px at 108% -8%, rgba(95, 156, 125, 0.12), transparent 60%),
    radial-gradient(960px 460px at -8% 0%, rgba(31, 107, 115, 0.10), transparent 55%),
    var(--bg);
  line-height: 1.6;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

h1, h2, h3, h4 { line-height: 1.25; color: var(--text); margin: 0 0 0.5em; }
h1 { font-size: clamp(1.6rem, 4vw, 2.3rem); }
h2 { font-size: clamp(1.3rem, 3vw, 1.7rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; color: var(--text-soft); }
ul { color: var(--text-soft); }

a { color: var(--petrol-dark); }

/* Numeri ben leggibili: cifre tabellari dove serve allinearle */
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }

/* ----------------------- Accessibilità --------------------- */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute;
  left: 12px; top: -60px;
  background: var(--surface);
  color: var(--petrol-dark);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--petrol);
  font-weight: 700;
  z-index: 1000;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 12px; outline: none; box-shadow: var(--focus-ring); }

:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: 8px;
}

/* ----------------------- Header ---------------------------- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.app-header__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
}
.brand__logo {
  font-size: 1.7rem;
  background: var(--petrol-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  width: 48px; height: 48px;
  display: grid; place-items: center;
  box-shadow: var(--shadow-sm);
}
.brand__text { display: flex; flex-direction: column; }
.brand__title { font-weight: 800; font-size: 1.05rem; letter-spacing: -0.01em; }
.brand__subtitle { font-size: 0.8rem; color: var(--text-muted); }

.main-nav__list {
  list-style: none;
  display: flex;
  gap: 6px;
  margin: 0; padding: 0;
}
.nav-btn {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-soft);
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 9px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-btn:hover { background: var(--petrol-bg); color: var(--petrol-dark); }
.nav-btn[aria-current="page"] {
  background: var(--petrol);
  color: #fff;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 46px; height: 46px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.menu-toggle__bar {
  display: block;
  width: 22px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* Barra di avanzamento globale */
.global-progress {
  height: 6px;
  background: var(--bg-soft);
  width: 100%;
  overflow: hidden;
}
.global-progress__fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--petrol), var(--sage));
  transition: width 0.4s ease;
}

/* ----------------------- Layout principale ----------------- */
.app-main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 28px 20px 56px;
}
.app-main:focus { outline: none; }

.view { animation: fade-in 0.3s ease both; }
@keyframes fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.section { margin-bottom: 28px; }
.lead { font-size: 1.05rem; color: var(--text-soft); max-width: 60ch; }
.muted { color: var(--text-muted); }
.center { text-align: center; }

/* ----------------------- Card ------------------------------ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: var(--gap); }
.card__head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.card__icon {
  font-size: 1.5rem;
  background: var(--bg-soft);
  border-radius: 12px;
  width: 46px; height: 46px;
  display: grid; place-items: center;
  flex: none;
}
.card__title { margin: 0; font-size: 1.2rem; }
.card__sub { margin: 2px 0 0; font-size: 0.9rem; color: var(--text-muted); }

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

/* ----------------------- Hero / intro ---------------------- */
.hero {
  background: linear-gradient(135deg, var(--petrol-bg), var(--sage-bg));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(24px, 5vw, 40px);
  box-shadow: var(--shadow-sm);
  margin-bottom: 28px;
}
.hero h1 { margin-bottom: 0.3em; }
.hero__lead { font-size: 1.12rem; color: var(--text-soft); max-width: 58ch; margin-bottom: 1.2em; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ----------------------- Pulsanti -------------------------- */
.btn {
  appearance: none;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  border-radius: 999px;
  padding: 12px 22px;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.12s ease, background 0.15s ease, box-shadow 0.15s ease;
  text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--petrol); color: #fff; box-shadow: var(--shadow-sm); }
.btn--primary:hover { background: var(--petrol-dark); }
.btn--sage { background: var(--sage); color: #fff; }
.btn--sage:hover { background: var(--sage-dark); }
.btn--ghost { background: var(--surface); color: var(--petrol-dark); border-color: var(--border-strong); }
.btn--ghost:hover { background: var(--petrol-bg); }
.btn--block { width: 100%; justify-content: center; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

.btn-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.btn-row--between { justify-content: space-between; }

.link-btn {
  background: none;
  border: none;
  color: var(--petrol-dark);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
  padding: 4px;
}
.link-btn:hover { color: var(--petrol); }

/* Chip / pulsanti esempio */
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  appearance: none;
  font: inherit;
  cursor: pointer;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text-soft);
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.chip:hover { background: var(--petrol-bg); border-color: var(--petrol); }

/* ----------------------- Passi (home) ---------------------- */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: var(--gap);
}
.step-card {
  position: relative;
  text-align: left;
  appearance: none;
  font: inherit;
  cursor: pointer;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.step-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--border-strong); }
.step-card__top { display: flex; align-items: center; justify-content: space-between; }
.step-card__num {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--petrol-dark);
  background: var(--petrol-bg);
  border-radius: 999px;
  padding: 3px 10px;
}
.step-card__icon { font-size: 1.8rem; }
.step-card__title { font-weight: 800; font-size: 1.05rem; margin: 6px 0 0; }
.step-card__desc { font-size: 0.9rem; color: var(--text-muted); margin: 0; }
.step-card__state {
  margin-top: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.step-card--done { border-color: var(--sage); background: linear-gradient(180deg, var(--sage-bg), var(--surface)); }
.step-card--done .step-card__state { color: var(--sage-dark); }
.step-card__state--todo { color: var(--text-muted); }

/* ----------------------- Campi modulo ---------------------- */
.field { margin-bottom: 16px; }
.field__label {
  display: block;
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 6px;
  color: var(--text);
}
.field__hint { font-size: 0.85rem; color: var(--text-muted); margin: 4px 0 0; }

.input, .select {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input:focus, .select:focus { outline: none; border-color: var(--petrol); box-shadow: 0 0 0 3px var(--petrol-bg); }
.input--invalid { border-color: var(--error); }

/* Campo con simbolo euro a sinistra */
.input-euro { position: relative; display: flex; align-items: center; }
.input-euro__symbol {
  position: absolute;
  left: 14px;
  font-weight: 700;
  color: var(--text-muted);
  pointer-events: none;
}
.input-euro .input { padding-left: 32px; font-variant-numeric: tabular-nums; }

.field__error {
  color: var(--error);
  font-size: 0.85rem;
  font-weight: 600;
  margin: 6px 0 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ----------------------- KPI / risultati ------------------- */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
}
.kpi {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
}
.kpi__value {
  font-size: clamp(1.4rem, 4vw, 1.8rem);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--petrol-dark);
  line-height: 1.1;
}
.kpi__value--sage { color: var(--sage-dark); }
.kpi__value--orange { color: var(--orange-dark); }
.kpi__label { font-size: 0.85rem; color: var(--text-muted); margin-top: 4px; }

/* ----------------------- Barre semplici -------------------- */
.bars { margin-top: 10px; }
.bar { margin-bottom: 14px; }
.bar__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 6px;
  font-size: 0.92rem;
}
.bar__label { font-weight: 600; display: inline-flex; align-items: center; gap: 7px; }
.bar__value { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text); }
.bar__track {
  height: 16px;
  background: var(--bg-soft);
  border-radius: 999px;
  overflow: hidden;
}
.bar__fill {
  height: 100%;
  border-radius: 999px;
  background: var(--petrol);
  width: 0%;
  transition: width 0.5s ease;
  min-width: 2px;
}
.bar__pct { font-size: 0.82rem; color: var(--text-muted); margin-top: 4px; }

/* Toni colore riutilizzabili per barre, badge, bordi */
.tone-petrol { --c: var(--petrol); --c-dark: var(--petrol-dark); --c-bg: var(--petrol-bg); }
.tone-sage   { --c: var(--sage);   --c-dark: var(--sage-dark);   --c-bg: var(--sage-bg); }
.tone-orange { --c: var(--orange); --c-dark: var(--orange-dark); --c-bg: var(--orange-bg); }
.bar .bar__fill { background: var(--c, var(--petrol)); }

/* Legenda */
.legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 6px; }
.legend__item { display: inline-flex; align-items: center; gap: 7px; font-size: 0.88rem; color: var(--text-soft); }
.legend__dot { width: 12px; height: 12px; border-radius: 4px; background: var(--c, var(--petrol)); flex: none; }

/* ----------------------- Righe budget ---------------------- */
.budget-group { margin-bottom: 18px; }
.budget-group__title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--c-dark, var(--petrol-dark));
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.budget-row {
  display: grid;
  grid-template-columns: 1fr 130px;
  gap: 12px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
}
.budget-row:last-child { border-bottom: none; }
.budget-row__label { display: flex; align-items: center; gap: 9px; font-weight: 600; }
.budget-row__label small { display: block; font-weight: 400; color: var(--text-muted); font-size: 0.78rem; }
.budget-row .input-euro .input { padding-top: 9px; padding-bottom: 9px; }

/* ----------------------- Riquadri informativi -------------- */
.callout {
  border-radius: var(--radius);
  padding: 16px 18px;
  border: 1px solid var(--border);
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.callout__icon { font-size: 1.3rem; flex: none; }
.callout p { margin: 0; }
.callout--info { background: var(--petrol-bg); border-color: #bcdce0; color: var(--petrol-dark); }
.callout--info p { color: var(--petrol-dark); }
.callout--success { background: var(--success-bg); border-color: #bfe3cd; }
.callout--success p { color: var(--sage-dark); }
.callout--warn { background: var(--warn-bg); border-color: #f0d6ab; }
.callout--warn p { color: var(--warn); }
.callout--note { background: var(--surface-2); }
.callout--note p { color: var(--text-soft); }

/* Disclaimer compatto */
.disclaimer {
  font-size: 0.85rem;
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-top: 14px;
}

/* ----------------------- Classificatore -------------------- */
.classifier-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
}
.classifier-item__label { font-weight: 700; display: flex; align-items: center; gap: 10px; font-size: 1.05rem; }
.classifier-item__choices { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.choice-btn {
  appearance: none;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  flex: 1 1 140px;
  min-height: 46px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 10px 16px;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.choice-btn:hover { background: var(--bg-soft); }
.choice-btn--correct { background: var(--success-bg); border-color: var(--sage); color: var(--sage-dark); }
.choice-btn--wrong { background: var(--error-bg); border-color: var(--error); color: var(--error); }
.choice-btn[disabled] { cursor: default; }
.classifier-item__feedback { margin-top: 12px; font-size: 0.92rem; }

/* ----------------------- Obiettivi ------------------------- */
.goal-result {
  margin-top: 16px;
  background: var(--sage-bg);
  border: 1px solid #bfe3cd;
  border-radius: var(--radius);
  padding: 18px;
  text-align: center;
}
.goal-result__big {
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  font-weight: 800;
  color: var(--sage-dark);
  font-variant-numeric: tabular-nums;
}

/* ----------------------- Scenari --------------------------- */
.scenario { margin-bottom: var(--gap); }
.scenario__situation { font-size: 1.02rem; color: var(--text-soft); }
.scenario__options { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.option-btn {
  appearance: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
  width: 100%;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.option-btn:hover:not([disabled]) { background: var(--bg-soft); border-color: var(--petrol); }
.option-btn[aria-pressed="true"] { border-color: var(--petrol); background: var(--petrol-bg); }
.option-btn[disabled] { cursor: default; }
.option-btn__marker {
  flex: none;
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  display: grid; place-items: center;
  font-size: 0.85rem;
  margin-top: 1px;
}
.option-btn[aria-pressed="true"] .option-btn__marker { border-color: var(--petrol); background: var(--petrol); color: #fff; }

.scenario__feedback {
  margin-top: 12px;
  border-left: 4px solid var(--c, var(--petrol));
  background: var(--c-bg, var(--petrol-bg));
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 12px 16px;
}
.scenario__feedback .quality {
  font-weight: 800;
  color: var(--c-dark, var(--petrol-dark));
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 4px;
}
.scenario__feedback p { margin: 0; color: var(--text-soft); }

/* ----------------------- Quiz ------------------------------ */
.quiz-progress { font-size: 0.9rem; color: var(--text-muted); font-weight: 600; margin-bottom: 8px; }
.quiz-question { font-size: 1.15rem; font-weight: 700; margin-bottom: 14px; }
.quiz-options { display: flex; flex-direction: column; gap: 10px; }
.quiz-feedback { margin-top: 16px; }

/* riusa .option-btn per le risposte; stati corretto/errato */
.option-btn--correct { border-color: var(--sage); background: var(--success-bg); }
.option-btn--correct .option-btn__marker { border-color: var(--sage); background: var(--sage); color: #fff; }
.option-btn--wrong { border-color: var(--error); background: var(--error-bg); }
.option-btn--wrong .option-btn__marker { border-color: var(--error); background: var(--error); color: #fff; }

/* ----------------------- Riepilogo piano ------------------- */
.plan-summary { display: grid; gap: var(--gap); }
.plan-balance {
  border-radius: var(--radius);
  padding: 18px;
  text-align: center;
  border: 1px solid var(--border);
}
.plan-balance--ok { background: var(--sage-bg); border-color: #bfe3cd; }
.plan-balance--warn { background: var(--warn-bg); border-color: #f0d6ab; }
.plan-balance__value { font-size: clamp(1.6rem, 5vw, 2.2rem); font-weight: 800; font-variant-numeric: tabular-nums; }
.plan-balance--ok .plan-balance__value { color: var(--sage-dark); }
.plan-balance--warn .plan-balance__value { color: var(--warn); }

.plan-list { list-style: none; margin: 0; padding: 0; }
.plan-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.plan-list li:last-child { border-bottom: none; }
.plan-list__name { display: inline-flex; align-items: center; gap: 9px; font-weight: 600; }
.plan-list__val { font-weight: 800; font-variant-numeric: tabular-nums; }

/* ----------------------- Badge / pill ---------------------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--c-bg, var(--petrol-bg));
  color: var(--c-dark, var(--petrol-dark));
}

/* ----------------------- Navigazione passi ----------------- */
.step-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 28px;
  flex-wrap: wrap;
}
.step-nav .btn { flex: 1 1 auto; justify-content: center; }
.step-nav__spacer { flex: 1 1 auto; }

/* ----------------------- Footer ---------------------------- */
.app-footer {
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.7);
  margin-top: 20px;
}
.app-footer__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 24px 20px 36px;
}
.app-footer__note { font-size: 0.88rem; color: var(--text-soft); margin: 0 0 8px; }
.app-footer__note--muted { color: var(--text-muted); }
.app-footer__actions { margin-top: 8px; }

/* Interruttore salvataggio */
.save-pref { margin-bottom: 16px; }
.switch { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; font-weight: 600; }
.switch__input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch__track {
  width: 46px; height: 26px;
  background: var(--border-strong);
  border-radius: 999px;
  position: relative;
  transition: background 0.2s ease;
  flex: none;
}
.switch__thumb {
  position: absolute;
  top: 3px; left: 3px;
  width: 20px; height: 20px;
  background: #fff;
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease;
}
.switch__input:checked + .switch__track { background: var(--sage); }
.switch__input:checked + .switch__track .switch__thumb { transform: translateX(20px); }
.switch__input:focus-visible + .switch__track { box-shadow: var(--focus-ring); }
.switch__label { font-size: 0.92rem; color: var(--text-soft); }
.save-pref__note { font-size: 0.82rem; color: var(--text-muted); margin: 8px 0 0; max-width: 70ch; }

/* ----------------------- Toast ----------------------------- */
.toast-container {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1000;
  width: min(92vw, 420px);
}
.toast {
  background: var(--text);
  color: #fff;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.93rem;
  animation: toast-in 0.25s ease both;
}
.toast--success { background: var(--sage-dark); }
.toast--warn { background: var(--warn); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* ----------------------- Responsive ------------------------ */
@media (max-width: 760px) {
  .menu-toggle { display: flex; }
  .main-nav {
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    display: none;
  }
  .main-nav.is-open { display: block; }
  .main-nav__list {
    flex-direction: column;
    gap: 4px;
    padding: 12px 16px 16px;
  }
  .nav-btn { width: 100%; text-align: left; }
  .grid--2, .grid--3 { grid-template-columns: 1fr; }
  .app-main { padding: 22px 16px 48px; }
  .card { padding: 18px; }
  .budget-row { grid-template-columns: 1fr 110px; }
  .step-nav { flex-direction: column; }
}

@media (max-width: 380px) {
  body { font-size: 16px; }
  .budget-row { grid-template-columns: 1fr 96px; }
}

/* Riduzione del movimento per chi lo preferisce */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
