/* Stile delle pagine del registro voli (form pubblico e area admin) */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Verdana, sans-serif;
  font-size: 16px;
  color: #222;
  background-color: aliceblue;
}

.testata {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background-color: white;
  box-shadow: 0px 5px 10px 2px lightgray;
}

.testata img {
  height: 56px;
}

.testata .titolo {
  font-family: 'Lucida Sans', 'Lucida Grande', Geneva, Verdana, sans-serif;
  font-style: italic;
  font-weight: bold;
  font-size: 18px;
  color: darkblue;
}

.testata .sottotitolo {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  color: darkblue;
}

main {
  max-width: 640px;
  margin: 0 auto;
  padding: 16px;
}

/* Pagina del registro: tutta la larghezza dello schermo, per far stare le colonne */
main.largo {
  max-width: none;
  padding: 16px 8px;
}

h1 {
  font-size: 22px;
  color: darkblue;
  margin: 8px 0 16px;
}

.riquadro {
  background: white;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 1px 4px lightgray;
}

.campo {
  margin-bottom: 14px;
}

.campo label {
  display: block;
  font-weight: bold;
  font-size: 14px;
  margin-bottom: 4px;
  color: darkblue;
}

.campo .facoltativo {
  font-weight: normal;
  color: #666;
}

.campo input,
.campo textarea,
.campo select {
  width: 100%;
  font-size: 16px;
  font-family: inherit;
  padding: 10px;
  border: 1px solid #aab;
  border-radius: 6px;
  background: white;
}

/* Stessa altezza per testo, orari e menu sulla stessa riga */
.campo input,
.campo select {
  height: 44px;
}

.campo input:focus,
.campo textarea:focus {
  outline: 2px solid #729ad5;
  border-color: #729ad5;
}

.campo.errore input,
.campo.errore textarea {
  border-color: #c00;
}

.campo .msg-errore {
  color: #c00;
  font-size: 13px;
  margin-top: 4px;
}

.due-colonne {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 12px;
}

/* Marche, tipo e persone a bordo sulla stessa riga; le persone (max 99) in una colonna stretta */
.riga-aeromobile {
  display: grid;
  grid-template-columns: 1fr 1fr 140px;
  gap: 0 12px;
}

.sezione {
  font-size: 16px;
  color: darkblue;
  margin: 20px 0 10px;
  padding-bottom: 4px;
  border-bottom: 1px solid #ccd;
}

.nota {
  font-size: 13px;
  color: #666;
  margin: -6px 0 16px;
}

.campo.errore select {
  border-color: #c00;
}

.consenso {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 14px;
}

.consenso input {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

details {
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 14px;
}

details summary {
  cursor: pointer;
  color: darkblue;
  font-weight: bold;
}

.trappola {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

button,
.bottone {
  display: inline-block;
  font-size: 16px;
  font-family: inherit;
  font-weight: bold;
  padding: 12px 20px;
  border: none;
  border-radius: 6px;
  background-color: #729ad5;
  color: white;
  cursor: pointer;
  text-decoration: none;
}

button:hover,
.bottone:hover {
  background-color: darkblue;
}

button.pieno {
  width: 100%;
}

button.pericolo {
  background-color: #c00;
  padding: 4px 10px;
  font-size: 13px;
}

button.secondario,
.bottone.secondario {
  background-color: white;
  color: darkblue;
  border: 1px solid #729ad5;
}

.avviso {
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 16px;
}

.avviso.ok {
  background: #e3f5e1;
  border: 1px solid #6a6;
}

.avviso.ko {
  background: #fde8e8;
  border: 1px solid #c66;
}

.filtri {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}

.filtri .campo {
  margin-bottom: 0;
}

.tabella-scroll {
  overflow-x: auto;
}

table.elenco {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
  background: white;
}

table.elenco th,
table.elenco td {
  border: 1px solid #ccd;
  padding: 6px 8px;
  text-align: left;
  vertical-align: top;
}

table.elenco th {
  background: #729ad5;
  color: white;
  vertical-align: bottom;
}

/* Valori che non devono andare a capo (es. le marche sul trattino) */
table.elenco td.no-a-capo {
  white-space: nowrap;
}

table.elenco tr:nth-child(even) td {
  background: #f4f8fd;
}

/* Campo password con il pulsante "occhio" per mostrare il testo */
.con-occhio {
  position: relative;
}

.campo .con-occhio input {
  padding-right: 48px;
}

button.occhio {
  position: absolute;
  top: 0;
  right: 0;
  width: 44px;
  height: 44px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: #567;
  border-radius: 0 6px 6px 0;
}

button.occhio:hover {
  background: transparent;
  color: darkblue;
}

button.occhio:focus-visible {
  outline: 2px solid #729ad5;
  outline-offset: -2px;
}

code.hash {
  display: block;
  word-break: break-all;
  background: #f4f4f4;
  padding: 8px;
  margin: 8px 0;
}

@media (max-width: 480px) {
  .due-colonne {
    grid-template-columns: 1fr;
  }

  /* Su telefono: marche e persone sulla prima riga, tipo sotto a tutta larghezza */
  .riga-aeromobile {
    grid-template-columns: 1fr 140px;
  }

  .riga-aeromobile > :nth-child(2) {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  /* Il logo è molto largo: su telefono va ridotto per lasciare spazio al titolo */
  .testata img {
    height: 34px;
  }

  .testata .titolo {
    font-size: 16px;
  }

  .testata .sottotitolo {
    font-size: 12px;
  }
}
