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

body {
  margin: 0;
  font: 16px/1.5 var(--font);
  color: var(--inchiostro);
  background: var(--avorio);
}

a, .link { color: var(--blu-scuro); }

h1 { font-size: 1.75rem; font-weight: 600; margin: 0 0 1.5rem; }

label { display: block; margin-bottom: 1rem; font-weight: 500; }

input, textarea {
  display: block;
  width: 100%;
  margin-top: .25rem;
  padding: .6rem .75rem;
  font: inherit;
  border: 1px solid var(--inchiostro);
  border-radius: 4px;
  background: transparent;
}

button {
  min-height: 44px;
  padding: .6rem 1.25rem;
  font: inherit;
  font-weight: 600;
  color: var(--avorio);
  background: var(--blu);
  border: 0;
  border-radius: 4px;
  cursor: pointer;
}

button.link {
  min-height: auto;
  padding: 0;
  font-weight: 400;
  text-decoration: underline;
  background: none;
}

.testata {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--blu);
}

.testata-utente { display: flex; gap: 1rem; align-items: center; }
.testata-utente form { margin: 0; }

.contenuto { max-width: 72rem; margin: 0 auto; padding: 2rem; }

.accesso { max-width: 24rem; margin: 10vh auto; padding: 0 1rem; }
.accesso img { display: block; margin-bottom: 2rem; }

.errore {
  margin-bottom: 1rem;
  padding: .75rem 1rem;
  color: var(--errore);
  border-left: 4px solid var(--errore);
  background: transparent;
}

.vuoto { color: var(--blu-scuro); font-style: italic; }

h2 { font-size: 1.25rem; font-weight: 600; margin: 2.5rem 0 1rem; }

select {
  display: block;
  margin-top: .25rem;
  padding: .6rem .75rem;
  font: inherit;
  border: 1px solid var(--inchiostro);
  border-radius: 4px;
  background: transparent;
}

.menu { display: flex; gap: 1.5rem; margin-right: auto; margin-left: 2rem; }

a.bottone {
  display: inline-block;
  padding: .6rem 1.25rem;
  font-weight: 600;
  color: var(--avorio);
  text-decoration: none;
  background: var(--blu);
  border-radius: 4px;
}

.schede { display: flex; gap: 1.5rem; align-items: center; margin-bottom: 1.5rem; }
.schede a[aria-current] { font-weight: 600; text-decoration: none; }
.schede .bottone { margin-left: auto; }

.tabella { width: 100%; border-collapse: collapse; }
.tabella th, .tabella td { padding: .6rem .75rem; text-align: left; border-bottom: 1px solid var(--blu); }
.tabella th { font-weight: 600; }
.tabella form { margin: 0; }
.azioni { display: flex; gap: 1rem; justify-content: flex-end; }

.modulo { max-width: 40rem; }
.modulo fieldset { margin: 0 0 1.5rem; padding: 1rem 1.25rem; border: 1px solid var(--blu); border-radius: 4px; }
.modulo legend { padding: 0 .5rem; font-weight: 600; }

.in-riga { display: flex; gap: .75rem; align-items: center; margin: 0; }
.in-riga input { width: auto; margin: 0; }

label.scelta { display: flex; gap: .5rem; align-items: center; font-weight: 400; }
label.scelta input { width: auto; margin: 0; }

.nota { color: var(--blu-scuro); font-size: .9rem; }

.avviso { padding: .5rem 1rem; color: var(--avviso); border-left: 4px solid var(--avviso); }

.etichetta {
  padding: 0 .4rem;
  font-size: .8rem;
  font-weight: 600;
  color: var(--avorio);
  background: var(--blu-scuro);
  border-radius: 4px;
}

.filtri { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end; margin-bottom: 1.5rem; }
.filtri label { margin: 0; }
.filtri input { width: auto; }

.paginazione { display: flex; gap: 1rem; margin-top: 1rem; }
.paginazione [aria-current] { font-weight: 600; }

.riepilogo { display: flex; flex-wrap: wrap; gap: .5rem 2rem; padding: 0; list-style: none; }

/* Cruscotto: ogni numero è un link all'elenco filtrato. */
.numeri { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: 1rem; padding: 0; list-style: none; }
.numeri a { display: block; min-height: 44px; padding: .75rem 1rem; text-decoration: none; border: 1px solid var(--blu); border-radius: 4px; }
.numeri strong { display: block; font-size: 1.75rem; }

.scelte { margin: 0 0 1rem; border: 1px solid var(--blu); border-radius: 4px; }

.tratta { margin-bottom: 1rem; padding: .75rem 1rem; border: 1px solid var(--blu); border-radius: 4px; }
.tratta summary { cursor: pointer; }
.tratta .modulo { margin-top: 1rem; }

.azioni-selezione { display: flex; gap: 1.5rem; align-items: center; }

/* Anteprima di una mail: il testo com'è, a capo compresi. */
.anteprima { max-width: 40rem; padding: 1rem 1.25rem; white-space: pre-wrap; border: 1px solid var(--blu); border-radius: 4px; }

.successo { padding: .5rem 1rem; color: var(--successo); border-left: 4px solid var(--successo); }
