/* ==========================
   style.v5.css 10 luglio mattina
   Reset base
   ========================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ==========================
   Corpo pagina
   ========================== */
body {
  font-family: Arial, sans-serif;
  background-color: #f0f4f8;
  color: #333;
}

/* ==========================
   Nascondi label sr-only
   ========================== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ==========================
   Homepage
   ========================== */
main.centered {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  text-align: center;
}

.logo {
  font-size: 3rem;
  font-weight: bold;
  color: #2e7d32;
  margin-bottom: 1em;
}

input[type="text"] {
  padding: 0.75rem;
  width: 320px;
  max-width: 90%;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  transition: border-color 0.2s;
}

input[type="text"]:focus {
  outline: none;
  border-color: #66afe9;
}

button {
  padding: 0.75rem 1.25rem;
  font-size: 1rem;
  border: none;
  border-radius: 4px;
  background-color: #2e7d32;
  color: #fff;
  cursor: pointer;
  transition: background-color 0.2s;
}

button:hover {
  background-color: #276a2a;
}

/* ==========================
   Validazione indirizzo (index.html)
   ========================== */
.error-message {
  color: #c00;
  margin-top: 10px;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
}

.error-message .error-icon {
  margin-right: 0.5rem;
  font-size: 1.2rem;
}

/* Aggiunta spazio dopo il form per mobile e desktop */
main.centered form {
  margin-bottom: 10px !important;
}

/* ==========================
   Summary page (result.html)
   ========================== */
body.results-summary {
  background-color: #fff !important;
}

.results-summary {
  display: block;
  width: 100%;
  margin: 2rem 0;
  padding: 0;
  text-align: center;
  line-height: 1.6;
}

.results-summary h1 {
  color: #2e7d32;
  font-size: 2rem;
  margin-bottom: 1rem;
}

.results-summary p {
  margin: 0.75rem 0;
  font-size: 1.1rem;
}

.results-summary form {
  margin-top: 1.5rem;
}

.results-summary .legend {
  display: inline-block;
  text-align: left;
  margin-top: 2rem;
}

.results-summary .legend h2 {
  font-size: 1.2rem;
  color: #1b5e20;
  margin-bottom: 0.5rem;
}

.results-summary .legend ul {
  list-style: none;
  padding-left: 0;
}

.results-summary .legend li {
  margin: 0.3rem 0;
  font-size: 1rem;
}

/* ==========================
   Detail page (resultdetails.html)
   ========================== */
body.results-details-page {
  background-color: #fff !important;
}

.results-details {
  display: block;
  max-width: 700px;
  margin: 2rem auto;
  padding: 2rem;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  text-align: left;
  line-height: 1.6;
}

.results-details > h1 {
  text-align: center;
  color: #2e7d32;
  font-size: 2.25rem;
  margin-bottom: 1.5rem;
}

.results-details .section {
  background-color: #fafafa;
  border: 1px solid #e0e0e0;
  border-left: 4px solid #2e7d32;
  border-radius: 4px;
  padding: 1rem 1.5rem;
  margin-bottom: 1.5rem;
}

.results-details .section-info h2,
.results-details .section-factors h2,
.results-details .section-iqar h2 {
  color: #1b5e20;
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.results-details .section-factors h3 {
  color: #2e7d32;
  font-size: 1.25rem;
  margin: 1rem 0 0.5rem;
}

.results-details .section p {
  margin: 0.5rem 0;
}

.results-details .section ul {
  margin: 0.5rem 0 1rem;
  padding-left: 1.25rem;
  list-style: disc;
}

.results-details .section ul li {
  margin-bottom: 0.5rem;
}

.results-details .section-iqar .button {
  display: block;
  margin: 1rem auto 0;
  background-color: #2e7d32;
  color: #fff;
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
}

.results-details .section-iqar .button:hover {
  background-color: #276a2a;
}

/* ==========================
   Error page (error.html)
   ========================== */
body.results-error-page .error-message {
  padding-top: 10px;
  color: #c00;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
}

body.results-error-page .error-message .error-icon {
  margin-right: 0.5rem;
  font-size: 1.5rem;
}

.back-button {
  display: inline-block;
  margin-top: 10px !important;
  padding: 0.75rem 1.25rem;
  background-color: #2e7d32;
  color: #fff;
  text-decoration: none;
  border-radius: 4px;
}

/* ==========================
   Responsive / MOBILE ONLY
   ========================== */
@media (max-width: 600px) {
  main.centered {
    justify-content: center;
  }
  main.centered form {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  main.centered form input[type="text"],
  main.centered form button {
    width: 320px;
    max-width: 90%;
  }
  main.centered form input[type="text"] {
    margin-bottom: 20px;
  }
  .logo {
    font-size: 2.5rem;
  }
}
