/* ============================================================
   3R Paga — BNI 24 Monza Brianza
   Design system: rosso BNI + grigio antracite + bianco.
   Font: Montserrat (titoli) · Inter (testo)
   ============================================================ */

:root {
  /* Brand BNI */
  --red-600: #C8102E;
  --red-700: #A50D26;
  --red-050: #FCEEF0;
  --ink: #26221F;
  --grey-700: #3E3E40;
  --grey-600: #4E4F51;
  --grey-400: #7C7C79;
  --grey-100: #F5F4F2;
  --white: #FFFFFF;

  /* Bordi ben visibili */
  --line: #B9B9B3;        /* bordi interattivi e input */
  --line-soft: #D2D2CC;   /* bordi di card e divisori */

  /* Semantici */
  --ok-600: #1B6E30;
  --ok-050: #EAF6EC;
  --warn-700: #7D5712;
  --warn-050: #FCF3E1;
  --warn-line: #DEC58C;
  --danger-600: #C8102E;
  --danger-050: #FCEEF0;

  --font-display: "Montserrat", "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, sans-serif;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow-1: 0 1px 3px rgba(38, 34, 31, .08), 0 6px 18px rgba(38, 34, 31, .09);
  --shadow-2: 0 10px 30px rgba(38, 34, 31, .16);
  --speed: 180ms;
  --ease: cubic-bezier(.2, .7, .3, 1);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--grey-100);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.2; margin: 0 0 .5em; color: var(--ink); }
h1 { font-size: clamp(1.5rem, 4vw, 2.1rem); font-weight: 800; }
h2 { font-size: clamp(1.22rem, 3vw, 1.5rem); font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0 0 1em; }
a { color: var(--red-600); }
img, svg { max-width: 100%; }
.muted { color: var(--grey-600); }
.small { font-size: .84rem; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--red-600); outline-offset: 2px; border-radius: 3px; }

.container { max-width: 1080px; margin-inline: auto; padding-inline: clamp(1rem, 4vw, 1.75rem); }

/* ---------- Header pubblico ---------- */
.site-header {
  background: var(--white);
  border-bottom: 2px solid var(--line-soft);
  border-top: 4px solid var(--red-600);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  min-height: 68px;
}
.brand { display: inline-flex; align-items: center; gap: .7rem; text-decoration: none; color: inherit; }
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; border-radius: 10px; flex: none;
  background: var(--red-600); color: var(--white);
  font-family: var(--font-display); font-weight: 800; font-size: 1.1rem; letter-spacing: .02em;
}
.brand-text { line-height: 1.15; }
.brand-text strong { display: block; font-family: var(--font-display); font-weight: 800; font-size: 1.05rem; }
.brand-text small { display: block; color: var(--grey-600); font-size: .78rem; font-weight: 500; letter-spacing: .02em; }
.header-note { font-size: .84rem; font-weight: 500; color: var(--grey-600); text-align: right; line-height: 1.45; }

/* ---------- Hero pubblico ---------- */
.hero {
  background: linear-gradient(120deg, var(--red-600), var(--red-700));
  color: var(--white);
  padding: clamp(1.5rem, 5vw, 2.6rem) 0;
}
.hero h1 { color: var(--white); margin-bottom: .25em; }
.hero p { color: #FFF; font-weight: 500; margin: 0; max-width: 42rem; font-size: 1.02rem; }

/* ---------- Wizard ---------- */
.wizard { padding: clamp(1.2rem, 4vw, 2rem) 0 3rem; }

.steps {
  display: flex; gap: .5rem; margin: 0 0 1.4rem; padding: 0; list-style: none;
  counter-reset: step;
}
.steps li {
  flex: 1; display: flex; align-items: center; gap: .55rem;
  padding: .6rem .85rem; border-radius: 999px;
  background: var(--white); border: 2px solid var(--line-soft);
  font-size: .9rem; font-weight: 600; color: var(--grey-600);
}
.steps li::before {
  counter-increment: step; content: counter(step);
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--grey-100); border: 2px solid var(--line);
  color: var(--grey-600);
  font-family: var(--font-display); font-weight: 700; font-size: .82rem;
}
.steps li.attivo { border-color: var(--red-600); color: var(--ink); background: var(--white); }
.steps li.attivo::before { background: var(--red-600); border-color: var(--red-600); color: var(--white); }
.steps li.fatto { color: var(--ink); }
.steps li.fatto::before { content: "✓"; background: var(--ok-600); border-color: var(--ok-600); color: var(--white); }

.step-panel { display: none; }
.step-panel.attivo { display: block; }

.card {
  background: var(--white); border: 1.5px solid var(--line-soft);
  border-radius: var(--radius); box-shadow: var(--shadow-1);
  padding: clamp(1.1rem, 3vw, 1.6rem);
}

/* Scelta prodotto */
.scelte { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: .9rem; }
.scelta { position: relative; }
.scelta input { position: absolute; opacity: 0; pointer-events: none; }
.scelta label {
  position: relative;
  display: block; cursor: pointer; height: 100%;
  background: var(--white); border: 2px solid var(--line); border-radius: var(--radius);
  padding: 1rem 3.2rem .95rem 1.1rem;
  transition: border-color var(--speed) var(--ease), box-shadow var(--speed) var(--ease), transform var(--speed) var(--ease), background var(--speed) var(--ease);
}
/* Cerchio di selezione: rende evidente che la card è un'opzione da scegliere */
.scelta label::after {
  content: "";
  position: absolute; top: 50%; right: 1rem; transform: translateY(-50%);
  width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid var(--line); background: var(--white);
  display: flex; align-items: center; justify-content: center;
  font: 700 .9rem/1 var(--font-body); color: var(--white);
  transition: border-color var(--speed) var(--ease), background var(--speed) var(--ease);
}
.scelta label:hover { border-color: var(--grey-700); transform: translateY(-2px); box-shadow: var(--shadow-1); }
.scelta label:hover::after { border-color: var(--grey-700); }
.scelta input:checked + label {
  border-color: var(--red-600);
  background: #FFF9FA;
  box-shadow: 0 0 0 3px var(--red-050), var(--shadow-1);
}
.scelta input:checked + label::after {
  content: "✓";
  border-color: var(--red-600); background: var(--red-600);
}
.scelta input:focus-visible + label { outline: 3px solid var(--red-600); outline-offset: 2px; }
.scelta .tipo {
  display: inline-block; font-size: .74rem; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; color: var(--red-600); margin-bottom: .3rem;
}
.scelta .nome {
  display: block; font-family: var(--font-display); font-weight: 800; font-size: 1.55rem;
  line-height: 1.1; white-space: nowrap;
}
.scelta .sotto-nome { display: block; font-size: .82rem; font-weight: 500; color: var(--grey-600); margin-top: .1rem; }
.scelta .prezzo { display: block; font-family: var(--font-display); font-weight: 800; font-size: 1.35rem; margin-top: .4rem; }
.scelta .prezzo small { font-family: var(--font-body); font-weight: 500; font-size: .76rem; color: var(--grey-600); display: block; margin-top: .15rem; }

.toggle-ritardo {
  display: flex; align-items: flex-start; gap: .7rem; margin-top: 1rem;
  background: var(--warn-050); border: 1.5px solid var(--warn-line); border-radius: var(--radius-sm);
  padding: .85rem 1rem; font-size: .92rem;
}
.toggle-ritardo input { width: 22px; height: 22px; margin-top: .1rem; accent-color: var(--red-600); flex: none; }
.toggle-ritardo strong { display: block; }
.toggle-ritardo .muted { font-size: .84rem; }

/* Form */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 1.1rem; }
.campo { display: flex; flex-direction: column; gap: .32rem; }
.campo-full { grid-column: 1 / -1; }
.campo label { font-weight: 600; font-size: .92rem; }
.campo label .req { color: var(--red-600); }
.campo input, .campo select {
  font: inherit; color: var(--ink);
  min-height: 50px; padding: .6rem .85rem;
  border: 2px solid var(--line); border-radius: var(--radius-sm);
  background: var(--white);
  transition: border-color var(--speed) var(--ease);
  width: 100%;
}
.campo input:hover, .campo select:hover { border-color: var(--grey-700); }
.campo input:focus, .campo select:focus { outline: none; border-color: var(--red-600); box-shadow: 0 0 0 3px var(--red-050); }
.campo .errore { display: none; font-size: .84rem; color: var(--danger-600); font-weight: 600; }
.campo.invalid input, .campo.invalid select { border-color: var(--danger-600); background: #FFFBFB; }
.campo.invalid .errore { display: block; }
.campo .aiuto { font-size: .82rem; color: var(--grey-600); }

/* Riepilogo + metodi */
.riepilogo-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 1rem; align-items: start; }
.riepilogo table { width: 100%; border-collapse: collapse; font-size: .96rem; }
.riepilogo td { padding: .55rem 0; border-bottom: 1.5px solid var(--line-soft); }
.riepilogo td:last-child { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.riepilogo tr.tot td {
  border-bottom: 0; border-top: 2px solid var(--ink); padding-top: .8rem;
  font-family: var(--font-display); font-weight: 800; font-size: 1.3rem;
}
.riepilogo .nota-uniforme {
  margin-top: .9rem; font-size: .84rem; color: var(--grey-700);
  background: var(--grey-100); border: 1.5px solid var(--line-soft);
  border-radius: var(--radius-sm); padding: .65rem .85rem;
}

.metodi { display: flex; flex-direction: column; gap: .65rem; }
.metodo { position: relative; }
.metodo input { position: absolute; opacity: 0; pointer-events: none; }
.metodo label {
  display: flex; align-items: center; gap: .8rem; cursor: pointer;
  border: 2px solid var(--line); border-radius: var(--radius-sm);
  padding: .75rem .9rem; min-height: 58px;
  background: var(--white);
  transition: border-color var(--speed) var(--ease), box-shadow var(--speed) var(--ease), background var(--speed) var(--ease);
}
/* Cerchio di selezione a destra di ogni metodo */
.metodo label::after {
  content: "";
  flex: none;
  width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid var(--line); background: var(--white);
  display: flex; align-items: center; justify-content: center;
  font: 700 .9rem/1 var(--font-body); color: var(--white);
  transition: border-color var(--speed) var(--ease), background var(--speed) var(--ease);
}
.metodo label:hover { border-color: var(--grey-700); }
.metodo label:hover::after { border-color: var(--grey-700); }
.metodo input:checked + label { border-color: var(--red-600); background: #FFF9FA; box-shadow: 0 0 0 3px var(--red-050); }
.metodo input:checked + label::after {
  content: "✓";
  border-color: var(--red-600); background: var(--red-600);
}
.metodo input:focus-visible + label { outline: 3px solid var(--red-600); outline-offset: 2px; }
.metodo .icona {
  width: 42px; height: 42px; flex: none; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--grey-100); border: 1.5px solid var(--line-soft); color: var(--grey-700);
}
.metodo .icona svg { width: 22px; height: 22px; }
.metodo .testo { flex: 1; }
.metodo .testo strong { display: block; font-size: .97rem; }
.metodo .testo small { display: block; color: var(--grey-600); font-size: .82rem; }
.metodo.nascosto { display: none; }

.badge-demo {
  display: inline-block; font-size: .64rem; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--warn-700);
  background: var(--warn-050); border: 1.5px solid var(--warn-line);
  border-radius: 999px; padding: .1rem .5rem; margin-left: .4rem; vertical-align: middle;
}

/* Bottoni */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font: 700 1.02rem var(--font-body);
  min-height: 52px; padding: .7rem 1.6rem;
  border-radius: var(--radius-sm); border: 2px solid transparent; cursor: pointer;
  text-decoration: none;
  transition: background var(--speed) var(--ease), transform var(--speed) var(--ease), border-color var(--speed) var(--ease);
}
.btn:active { transform: scale(.98); }
.btn-primario { background: var(--red-600); color: var(--white); box-shadow: 0 2px 8px rgba(200, 16, 46, .3); }
.btn-primario:hover { background: var(--red-700); }
.btn-secondario { background: var(--white); color: var(--ink); border-color: var(--line); }
.btn-secondario:hover { border-color: var(--grey-700); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-blocco { width: 100%; }

.azioni-step { display: flex; justify-content: space-between; gap: 1rem; margin-top: 1.3rem; }
.azioni-step .btn-primario { min-width: 46%; }

/* ---------- Pagina conferma ---------- */
.esito { max-width: 640px; margin-inline: auto; }
.esito-icona {
  width: 68px; height: 68px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1rem;
}
.esito-icona.ok { background: var(--ok-050); border: 2px solid var(--ok-600); color: var(--ok-600); }
.esito-icona.attesa { background: var(--warn-050); border: 2px solid var(--warn-line); color: var(--warn-700); }
.esito-icona svg { width: 34px; height: 34px; }
.esito h1 { text-align: center; }
.esito .sotto { text-align: center; color: var(--grey-600); font-size: 1.02rem; margin-bottom: 1.4rem; }

.box-bonifico {
  background: var(--grey-100); border: 2px dashed var(--line);
  border-radius: var(--radius-sm); padding: 1rem 1.1rem; margin: 1rem 0;
}
.box-bonifico dl { margin: 0; display: grid; grid-template-columns: auto 1fr auto; gap: .5rem .85rem; align-items: center; }
.box-bonifico dt { font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--grey-600); }
.box-bonifico dd { margin: 0; font-family: "Consolas", monospace; font-size: .95rem; font-weight: 500; word-break: break-all; }
.btn-copia {
  font: 600 .78rem var(--font-body); color: var(--red-600);
  background: var(--white); border: 1.5px solid var(--line); border-radius: 6px;
  padding: .35rem .7rem; cursor: pointer; min-height: 34px; white-space: nowrap;
}
.btn-copia:hover { border-color: var(--red-600); }

/* ---------- Pulsante assistenza WhatsApp ---------- */
.whatsapp-fab {
  position: fixed; right: 18px; bottom: 18px; z-index: 90;
  width: 58px; height: 58px; border-radius: 50%;
  background: #25D366; color: #FFFFFF;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .28);
  transition: transform var(--speed) var(--ease), box-shadow var(--speed) var(--ease);
}
.whatsapp-fab:hover { transform: scale(1.07); color: #FFFFFF; box-shadow: 0 8px 22px rgba(0, 0, 0, .32); }
.whatsapp-fab svg { width: 30px; height: 30px; }

/* ---------- Badge stato ---------- */
.badge {
  display: inline-block; font-size: .78rem; font-weight: 600;
  border-radius: 999px; padding: .2rem .65rem; white-space: nowrap;
  border: 1.5px solid transparent;
}
.badge-ok { background: var(--ok-050); color: var(--ok-600); border-color: #BCDFC4; }
.badge-warn { background: var(--warn-050); color: var(--warn-700); border-color: var(--warn-line); }
.badge-danger { background: var(--danger-050); color: var(--danger-600); border-color: #EFB9C2; }
.badge-muted { background: var(--grey-100); color: var(--grey-600); border-color: var(--line-soft); }

/* ---------- Footer pubblico ---------- */
.site-footer {
  border-top: 2px solid var(--line-soft); background: var(--white);
  padding: 1.1rem 0; margin-top: 2rem;
}
.site-footer .container { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: .84rem; color: var(--grey-600); }

/* ============================================================
   Area amministrazione
   ============================================================ */
.admin-body { background: var(--grey-100); }
.admin-topbar {
  background: var(--ink); color: var(--white);
  display: flex; align-items: center; justify-content: space-between; gap: .8rem;
  padding: .6rem clamp(1rem, 3vw, 1.6rem);
  border-top: 4px solid var(--red-600);
  flex-wrap: wrap;
}
.admin-topbar .brand-text strong { color: var(--white); }
.admin-topbar .brand-text small { color: #B9B9B5; }
.admin-nav { display: flex; align-items: center; gap: .2rem; flex-wrap: wrap; }
.admin-nav a {
  color: #D8D8D4; text-decoration: none; font-weight: 600; font-size: .92rem;
  padding: .55rem .85rem; border-radius: var(--radius-sm); min-height: 44px; display: inline-flex; align-items: center;
  transition: background var(--speed) var(--ease), color var(--speed) var(--ease);
}
.admin-nav a:hover { background: rgba(255, 255, 255, .12); color: var(--white); }
.admin-nav a[aria-current="page"] { background: var(--red-600); color: var(--white); }
.admin-nav .nav-esci { color: #B9B9B5; margin-left: .4rem; }

.admin-main { max-width: 1440px; margin-inline: auto; padding: clamp(1rem, 3vw, 1.8rem); }
.admin-main h1 { margin-bottom: 1rem; }
.admin-footer { text-align: center; font-size: .82rem; color: var(--grey-600); padding: 1.2rem 1rem 1.6rem; }

/* KPI */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .9rem; margin-bottom: 1.3rem; }
.kpi {
  background: var(--white); border: 1.5px solid var(--line-soft); border-radius: var(--radius);
  box-shadow: var(--shadow-1); padding: 1rem 1.1rem;
}
.kpi .kpi-label { font-size: .78rem; font-weight: 700; color: var(--grey-600); text-transform: uppercase; letter-spacing: .05em; }
.kpi .kpi-valore { font-family: var(--font-display); font-weight: 800; font-size: 1.75rem; margin-top: .2rem; font-variant-numeric: tabular-nums; }
.kpi .kpi-sub { font-size: .82rem; color: var(--grey-600); margin-top: .15rem; }
.kpi.rosso { border-top: 4px solid var(--red-600); }

/* Tabelle admin */
.tabella-wrap {
  background: var(--white); border: 1.5px solid var(--line-soft); border-radius: var(--radius);
  box-shadow: var(--shadow-1); overflow-x: auto; -webkit-overflow-scrolling: touch; margin-bottom: 1.4rem;
}
.tabella-wrap h2 { font-size: 1.05rem; padding: 1rem 1.1rem 0; margin: 0; }
table.admin { width: 100%; border-collapse: collapse; font-size: .92rem; min-width: 720px; }
table.admin th { white-space: nowrap;
  text-align: left; font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--grey-700); background: var(--grey-100);
  padding: .7rem 1.1rem; border-bottom: 2px solid var(--line-soft);
}
table.admin td { padding: .7rem 1.1rem; border-bottom: 1.5px solid var(--line-soft); vertical-align: middle; white-space: nowrap; }
table.admin tr:last-child td { border-bottom: 0; }
table.admin tbody tr:hover td { background: #FAFAF8; }
table.admin td.num, table.admin th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* Date (prima colonna) e azioni (ultima colonna) sempre su una riga */
table.admin td:first-child, table.admin td:last-child { white-space: nowrap; }
table.admin td.wrap { white-space: normal; }
table.admin .vuoto { text-align: center; color: var(--grey-600); padding: 1.6rem; }

/* Modifica scadenza inline (elenco membri) */
.form-scadenza { display: flex; align-items: center; gap: .35rem; white-space: nowrap; }
.form-scadenza input[type="date"] {
  font: inherit; font-size: .86rem; color: var(--ink);
  padding: .25rem .45rem; min-height: 34px;
  border: 1.5px solid var(--line); border-radius: 6px; background: var(--white);
}
.form-scadenza input[type="date"]:focus { outline: none; border-color: var(--red-600); box-shadow: 0 0 0 2px var(--red-050); }

/* Listino modificabile */
.mono { font-family: "Consolas", ui-monospace, monospace; }
.campo-listino {
  font: inherit; color: var(--ink);
  padding: .3rem .5rem; min-height: 36px;
  border: 1.5px solid var(--line); border-radius: 6px; background: var(--white);
}
.campo-listino:hover { border-color: var(--grey-700); }
.campo-listino:focus { outline: none; border-color: var(--red-600); box-shadow: 0 0 0 2px var(--red-050); }
.campo-nome { width: 100%; min-width: 260px; }
.campo-importo { width: 110px; text-align: right; font-variant-numeric: tabular-nums; }
.switch-attiva { display: inline-flex; align-items: center; gap: .45rem; cursor: pointer; font-size: .88rem; font-weight: 600; }
.switch-attiva input { width: 20px; height: 20px; accent-color: var(--red-600); cursor: pointer; }

.btn-elimina {
  font: 600 .78rem var(--font-body); color: var(--danger-600);
  background: var(--white); border: 1.5px solid var(--line); border-radius: 6px;
  padding: .35rem .7rem; cursor: pointer; min-height: 34px; white-space: nowrap;
  transition: border-color var(--speed) var(--ease), background var(--speed) var(--ease);
}
.btn-elimina:hover { border-color: var(--danger-600); background: var(--danger-050); }

/* Filtri */

.filtri { display: flex; gap: .7rem; flex-wrap: wrap; margin-bottom: 1rem; align-items: flex-end; }
.filtri .campo { min-width: 170px; flex: 1; max-width: 260px; }
.filtri .campo input, .filtri .campo select { min-height: 46px; }
.filtri .btn { min-height: 46px; padding: .5rem 1.2rem; }

/* Login */
.login-wrap { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 1.5rem; }
.login-card { width: 100%; max-width: 400px; }
.login-card .brand { justify-content: center; margin-bottom: 1.2rem; display: flex; }
.login-card h1 { text-align: center; font-size: 1.25rem; }
.avviso-errore {
  background: var(--danger-050); color: var(--danger-600); border: 1.5px solid #EFB9C2;
  border-radius: var(--radius-sm); padding: .7rem .95rem; font-size: .92rem; font-weight: 600; margin-bottom: .9rem;
}
.avviso-ok {
  background: var(--ok-050); color: var(--ok-600); border: 1.5px solid #BCDFC4;
  border-radius: var(--radius-sm); padding: .7rem .95rem; font-size: .92rem; font-weight: 600; margin-bottom: .9rem;
}

/* Impostazioni */
.impostazioni-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: start; }

/* ============================================================
   Responsive — tablet e cellulare
   ============================================================ */

/* Tablet (fino a 1024px) */
@media (max-width: 1024px) {
  .scelte { grid-template-columns: 1fr 1fr; }
  .riepilogo-grid { gap: .9rem; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-main { padding: 1rem; }
}

/* Tablet verticale / telefoni grandi */
@media (max-width: 900px) {
  .riepilogo-grid { grid-template-columns: 1fr; }
  .impostazioni-grid { grid-template-columns: 1fr; }
  .admin-topbar { flex-direction: column; align-items: stretch; }
  .admin-topbar .brand { align-self: flex-start; }
  .admin-nav { width: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: .2rem; }
  .admin-nav a { white-space: nowrap; }
  .admin-nav .nav-esci { margin-left: auto; }
}

/* Cellulare */
@media (max-width: 640px) {
  body { font-size: 15.5px; }
  .form-grid { grid-template-columns: 1fr; gap: .85rem; }
  .scelte { grid-template-columns: 1fr; }
  .steps { gap: .4rem; }
  .steps li { padding: .5rem; justify-content: center; font-size: 0; gap: 0; }
  .steps li::before { width: 34px; height: 34px; font-size: .9rem; }
  .steps li.attivo { flex: 2.2; font-size: .9rem; gap: .5rem; padding: .5rem .8rem; }
  .azioni-step { flex-direction: column-reverse; }
  .azioni-step .btn { width: 100%; }
  .header-note { display: none; }
  .hero p { font-size: .95rem; }
  .box-bonifico dl { grid-template-columns: 1fr auto; }
  .box-bonifico dt { grid-column: 1 / -1; margin-top: .55rem; }
  .box-bonifico dt:first-child { margin-top: 0; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: .6rem; }
  .kpi { padding: .8rem .9rem; }
  .kpi .kpi-valore { font-size: 1.4rem; }
  .filtri { gap: .5rem; }
  .filtri .campo { min-width: calc(50% - .5rem); max-width: none; }
  .filtri .btn { width: 100%; }
  table.admin { font-size: .88rem; }
  .site-footer .container { flex-direction: column; gap: .3rem; }
}

/* Telefoni piccoli */
@media (max-width: 400px) {
  .container { padding-inline: .85rem; }
  .card { padding: 1rem .9rem; }
  .kpi-grid { grid-template-columns: 1fr; }
  .metodo label { padding: .65rem .7rem; gap: .6rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
