:root {
  --sfondo: #f1f3ee;
  --carta: #ffffff;
  --inchiostro: #1b2a22;
  --tenue: #66736b;
  --linea: #dfe5db;
  --marca: #1f5a3f;
  --marca-chiara: #e7f1eb;
  --marca-scura: #11261c;
  --acceso: #2f9e5b;
  --spento: #8a948e;
  --errore: #b83232;
  --errore-sfondo: #fdecec;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--sfondo);
  color: var(--inchiostro);
  font: 17px/1.45 "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ---------------------------------------------------------------- testata */
.testa {
  background: var(--marca-scura);
  color: #fff;
  padding: calc(14px + env(safe-area-inset-top)) 16px 14px;
}
.testa-dentro { max-width: 460px; margin: 0 auto; display: flex; align-items: center; gap: 12px; }
.logo { height: 46px; width: auto; flex: none; background: #fff; border-radius: 10px; padding: 4px 7px; }
.nomi { flex: 1; min-width: 0; }
.marchio { font-weight: 700; font-size: 17px; letter-spacing: .01em; line-height: 1.2; }
.sotto { font-size: 11.5px; opacity: .75; text-transform: uppercase; letter-spacing: .12em; margin-top: 3px; }
.sito {
  flex: none;
  display: inline-flex; align-items: center; gap: 5px;
  color: #fff; text-decoration: none;
  font-size: 13px; font-weight: 600; white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, .32);
  border-radius: 999px;
  padding: 7px 11px;
}
.sito:hover, .sito:focus-visible { background: rgba(255, 255, 255, .12); }
.sito svg { width: 13px; height: 13px; }
@media (max-width: 430px) {
  .sito { padding: 7px 9px; }
  .sito span { max-width: 4.2em; white-space: normal; line-height: 1.15; text-align: center; }
}

/* ---------------------------------------------------------------- pagina */
main { flex: 1; width: 100%; max-width: 460px; margin: 0 auto; padding: 20px 16px; display: flex; flex-direction: column; gap: 16px; }

.scheda {
  background: var(--carta);
  border: 1px solid var(--linea);
  border-radius: 18px;
  padding: 22px 20px;
  box-shadow: 0 1px 2px rgba(17, 38, 28, .05), 0 8px 24px rgba(17, 38, 28, .07);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.centro { align-items: center; }

h1 { font-size: 23px; line-height: 1.2; margin: 0; }
h2 { font-size: 18px; line-height: 1.25; margin: 0 0 2px; }
.saluto { margin: 0 0 6px; color: var(--marca); font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .12em; }
.guida { margin: 0; color: var(--tenue); }
.etichetta { font-size: 12.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--tenue); font-weight: 700; }

/* ---------------------------------------------------------------- accesso */
form { display: flex; flex-direction: column; gap: 8px; }
label { font-weight: 600; font-size: 15px; margin-top: 6px; }
input {
  font: inherit;
  font-size: 22px;
  font-variant-numeric: tabular-nums;
  letter-spacing: .06em;
  padding: 13px 14px;
  border: 2px solid var(--linea);
  border-radius: 12px;
  background: #fff;
  color: var(--inchiostro);
  width: 100%;
}
input:focus { outline: none; border-color: var(--marca); box-shadow: 0 0 0 4px rgba(31, 90, 63, .15); }
.sotto-campo { margin: 2px 0 0; font-size: 13.5px; color: var(--tenue); }
#verifica { min-height: 0; margin-top: 8px; }

.bottone {
  font: inherit;
  font-weight: 700;
  border: 0;
  border-radius: 14px;
  padding: 15px 18px;
  cursor: pointer;
  width: 100%;
  transition: transform .05s, opacity .15s;
}
.bottone:active { transform: translateY(1px); }
.bottone:disabled { opacity: .5; cursor: not-allowed; }
.bottone:focus-visible { outline: 3px solid rgba(31, 90, 63, .4); outline-offset: 2px; }
.primario { background: var(--marca); color: #fff; margin-top: 10px; }
.grande { font-size: 19px; padding: 20px 18px; background: var(--marca); color: #fff; }
.grande[data-azione="OFF"] { background: #fff; color: var(--errore); border: 2px solid var(--errore); }
.leggero { background: transparent; color: var(--tenue); font-weight: 600; padding: 10px; }

/* ---------------------------------------------------------------- piazzola */
.riga-titolo { display: flex; align-items: center; gap: 14px; }
.numero {
  width: 62px; height: 62px; flex: none;
  border-radius: 16px;
  background: var(--marca);
  color: #fff;
  display: grid; place-items: center;
  font-size: 22px; font-weight: 750; font-variant-numeric: tabular-nums;
}

.stato, .riquadro {
  border: 1px solid var(--linea);
  border-radius: 14px;
  padding: 16px;
  background: #f8faf6;
}
.stato { display: flex; align-items: center; gap: 14px; }
.spia { width: 22px; height: 22px; border-radius: 50%; background: var(--spento); flex: none; }
.stato[data-presa="ON"] { background: #eaf6ee; border-color: #bfe3cb; }
.stato[data-presa="ON"] .spia { background: var(--acceso); box-shadow: 0 0 0 6px rgba(47, 158, 91, .2); }
.stato-testo { font-size: 24px; font-weight: 750; }
.costo { font-size: 38px; font-weight: 750; font-variant-numeric: tabular-nums; margin-top: 2px; }

.nota { margin: 0; color: var(--tenue); font-size: 14.5px; text-align: center; }
.errore {
  margin: 0;
  background: var(--errore-sfondo);
  border: 1px solid #f0b9b9;
  color: #8f2b2b;
  border-radius: 12px;
  padding: 11px 13px;
  font-size: 15px;
}

/* ---------------------------------------------------------------- contatti */
.aiuto { gap: 10px; box-shadow: none; background: #fbfcfa; }
.aiuto .guida { font-size: 15px; }
.contatto {
  display: flex; align-items: center; gap: 13px;
  padding: 12px 14px;
  border: 1px solid var(--linea);
  border-radius: 12px;
  background: #fff;
  color: inherit; text-decoration: none;
}
.contatto:hover, .contatto:focus-visible { border-color: var(--marca); background: var(--marca-chiara); outline: none; }
.contatto svg { width: 22px; height: 22px; flex: none; color: var(--marca); }
.contatto span { display: flex; flex-direction: column; min-width: 0; }
.contatto small { font-size: 11.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--tenue); font-weight: 700; }
.contatto b { font-weight: 650; font-size: 15.5px; overflow-wrap: anywhere; }

.piede { text-align: center; color: var(--tenue); font-size: 13.5px; padding: 4px 16px calc(18px + env(safe-area-inset-bottom)); }
