/* Reset di base */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Corpo della pagina */
body {
  font-family: Arial, sans-serif;
  background-color: #f5f7fa;
  color: #333;
  line-height: 1.6;
  padding: 20px;
}

/* Contenitore principale */
.container {
  width: 100%;
  max-width: 100%;       /* occupa tutta la larghezza su mobile */
  margin: 0 auto;
  padding: 10px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.container2 {
  width: 100%;
  max-width: 100%;       /* occupa tutta la larghezza su mobile */
  margin: 0 auto;
  padding: 10px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
/* Su schermi medi e grandi, limitiamo la larghezza per la leggibilità */
@media (min-width: 768px) {
  .container {
    max-width: 800px;
  }
}

/* Intestazione con immagine */
.header {
  width: 100%;
}
.header img {
  display: block;
  width: 100%;
  height: auto;
  border-bottom: 1px solid #ddd;
}

/* Sezione form */
.form-section {
  padding: 20px 0;
}
.form-section h1 {
  font-size: 1.5rem;
  margin-bottom: 15px;
  color: #222;
}

/* Etichette e campi */
.form-section label {
  display: block;
  margin-bottom: 8px;
  font-weight: bold;
  color: #444;
}
.form-section input[type="text"],
.form-section select {
  width: 100%;
  padding: 8px 10px;
  margin-bottom: 15px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1rem;
  transition: border-color .2s;
}
.form-section input[type="text"]:focus,
.form-section select:focus {
  border-color: #2a8cff;
  outline: none;
}

/* Radio button */
.form-section .options {
  margin-bottom: 20px;
}
.form-section .options label {
  display: flex;
  align-items: center;
  font-weight: normal;
  margin-bottom: 8px;
}
.form-section .options input[type="radio"] {
  margin-right: 8px;
}

/* Pulsante di invio */
.form-section button {
  display: inline-block;
  width: auto;
  background-color: #2a8cff;
  color: #fff;
  padding: 10px 20px;
  font-size: 1rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}
.form-section button:hover,
.form-section button:focus {
  background-color: #1a6ed8;
  outline: none;
}

/* Sezione risultati (solo per amministratore) */
.results {
  padding: 20px 0;
}
.results h1 {
  font-size: 1.5rem;
  margin-bottom: 15px;
  color: #222;
}
.results table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}
.results th,
.results td {
  padding: 8px 10px;
  border: 1px solid #ddd;
  text-align: left;
}
.results th {
  background-color: #f0f0f0;
  color: #333;
}
.results tr:nth-child(even) {
  background-color: #fafafa;
}

/* Link di ritorno */
.back-link {
  display: inline-block;
  margin-top: 20px;
  color: #2a8cff;
  text-decoration: none;
  transition: color 0.2s;
}
.back-link:hover,
.back-link:focus {
  color: #1a6ed8;
  text-decoration: underline;
  outline: none;
}

/* Responsive tweaks */
@media (max-width: 480px) {
  .form-section h1,
  .results h1 {
    font-size: 1.3rem;
  }
  .form-section input[type="text"],
  .form-section select {
    font-size: 0.9rem;
  }
  .form-section button {
    width: 100%;
  }
  .back-link {
    display: block;
    text-align: center;
  }
}