* { box-sizing: border-box; }
body { margin: 0; background: #eef3f7; color: #183b52; font: 16px/1.5 system-ui, sans-serif; }
main { width: min(580px, calc(100% - 32px)); margin: 40px auto; padding: 28px; background: white; border-radius: 16px; border: 1px solid #d6e2ec; }
h1 { font-size: 26px; line-height: 1.25; } a { color: #2b6cb0; }
label { display: block; margin: 18px 0; font-weight: 600; }
input, select { display: block; width: 100%; margin-top: 6px; border: 1px solid #abbccc; border-radius: 7px; padding: 12px; font: inherit; }
button { padding: 12px 18px; border: 0; border-radius: 7px; background: #2b6cb0; color: white; font: inherit; cursor: pointer; }
button:disabled { opacity: .6; cursor: wait; } .nota { font-size: 14px; color: #53687b; }
[hidden] { display: none !important; }
/* Portineria (schema 3): sezioni dell'account, link d'invito, documenti. */
h2 { font-size: 19px; margin: 30px 0 8px; padding-top: 18px; border-top: 1px solid #d6e2ec; }
section:first-of-type h2 { border-top: 0; padding-top: 0; }
dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
dt { color: #53687b; } dd { margin: 0; overflow-wrap: anywhere; }
.elenco { padding-left: 20px; } .elenco li { margin: 6px 0; }
label.spunta { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; }
label.spunta input { display: inline-block; width: auto; margin: 4px 0 0; flex: none; }
fieldset { border: 1px solid #d6e2ec; border-radius: 8px; padding: 6px 14px; margin: 18px 0; }
legend { font-weight: 700; padding: 0 6px; }
button.secondario { background: #e3ecf6; color: #183b52; }
button.pericolo { background: #a33b2b; }
details summary { cursor: pointer; color: #a33b2b; font-weight: 600; margin: 8px 0; }
.documento h2 { border-top: 0; padding-top: 0; }
.bozza { background: #fbeee4; border: 1px solid #e6b38f; border-radius: 8px; padding: 10px 14px; font-size: 15px; }
/* Campo trappola per i programmi automatici: fuori dallo schermo, non raggiungibile da tastiera. */
.trappola { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
/* Area personale: menu a sinistra, sezioni a schede, caratteri grandi. */
body.area main { width: auto; margin: 0; padding: 22px 28px 60px; background: none; border: 0; border-radius: 0;
  display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.area-testata { display: flex; align-items: center; gap: 22px; padding: 12px 24px; background: #142c45; color: #fff; flex-wrap: wrap; }
.area-testata a { color: #c9d8e8; } .area-testata b { font-size: 19px; flex: 1; }
.area-testata span { color: #c9d8e8; font-size: 15px; }
.area-impianto { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: calc(100vh - 50px); }
.area-menu { background: #fff; border-right: 1px solid #d6e2ec; padding: 14px 10px; display: flex; flex-direction: column; gap: 3px; }
.area-menu a { text-decoration: none; color: #183b52; padding: 10px 14px; border-radius: 8px; }
.area-menu a[aria-current="page"] { background: #e3ecf6; font-weight: 700; }
body.area section { display: flex; flex-direction: column; gap: 16px; max-width: 860px; }
body.area h1 { margin: 0; } body.area h2 { border-top: 0; padding-top: 0; margin: 0 0 10px; }
.riquadro { background: #fff; border: 1px solid #d6e2ec; border-radius: 12px; padding: 18px 20px; }
.scheda-form { background: #fff; border: 1px solid #d6e2ec; border-radius: 12px; padding: 6px 20px 18px; }
.riga-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.riga-form label { margin: 0; flex: 0 1 160px; } .riga-form label.larga { flex: 1 1 260px; }
.tre { display: grid; grid-template-columns: 1fr 2fr 1fr; gap: 12px; } .tre label { margin: 10px 0; }
.numeri { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.numeri div { background: #f6f9fc; border: 1px solid #e3ebf2; border-radius: 10px; padding: 10px 14px; }
.numeri b { display: block; font-size: 28px; line-height: 1.15; } .numeri span { font-size: 14px; color: #53687b; }
.tabella { width: 100%; border-collapse: collapse; font-size: 15px; margin-top: 8px; }
.tabella th, .tabella td { text-align: left; padding: 6px 8px; border-bottom: 1px solid #e7edf3; }
.tabella th { color: #53687b; font-weight: 600; }
.etichetta { display: inline-block; border-radius: 999px; padding: 1px 10px; font-size: 14px; font-weight: 600; background: #e3ecf6; }
.etichetta.ok { background: #e5f2ea; color: #2f7a4f; } .etichetta.att { background: #fbeee4; color: #a3541c; }
.etichetta.no { background: #f6e3e0; color: #a33b2b; }
.esito { font-size: 15px; color: #2f7a4f; } .esito.errore { color: #a33b2b; }
.avviso { background: #fbeee4; border: 1px solid #e6b38f; border-radius: 10px; padding: 12px 16px; margin: 0; }
.dati-account { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; font-size: 15px; color: #53687b; }
.dati-account dd { margin: 0; color: #183b52; }
details summary { color: #2b6cb0; }
#sezChiudi details summary { color: #a33b2b; }
@media (max-width: 760px) {
  .area-impianto { grid-template-columns: 1fr; }
  .area-menu { flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid #d6e2ec; }
  body.area main { padding: 16px; }
  .tre { grid-template-columns: 1fr; }
}
