/* ---------------------- HEADER ---------------------- */
header {
  text-align: center;
  margin-top: 30px;
}

header img {
    max-width: 80%; /* Limita la larghezza massima */
    height: auto; /* Mantiene il rapporto di aspetto */
    margin: 0 auto; /* Centra l'immagine */
    display: block; /* Imposta come elemento a blocco per il centraggio */
}

/* ---------------------- MAIN ---------------------- */
main {
  flex: 1;
  text-align: center;
  padding: 40px 20px;
  max-width: 900px;
  margin: auto;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 20px;
  box-shadow: 0 0 25px rgba(255, 166, 0, 0.25);
  animation: fadeIn 1.5s ease;
}

main h1 {
  font-size: 2.3rem;
  color: #ff4d4d;
  margin-bottom: 20px;
}

main p {
  font-size: 1.1rem;
  margin-bottom: 15px;
  line-height: 1.7;
}

.intro h1 {
  color: #ff4d4d;
  font-size: 2.3rem;
}

.logo-text {
  color: #ff9900;
  text-shadow: 0 0 5px rgba(255, 200, 0, 0.6);
}

.btnStart {
  background: linear-gradient(135deg, #ff6b6b, #ffcc70);
  border: none;
  border-radius: 50px;
  color: white;
  font-size: 1.2rem;
  padding: 14px 35px;
  cursor: pointer;
  transition: 0.3s;
  margin-top: 20px;
  box-shadow: 0 5px 15px rgba(255, 120, 120, 0.4);
}

.btnStart:hover {
  transform: scale(1.05);
  box-shadow: 0 0 25px rgba(255, 255, 255, 0.8);
}

/* ---------------- SEZIONE "COME FUNZIONA" ---------------- */

.how-it-works {
  background: linear-gradient(180deg, #fff9f3, #ffe9d1);
  border-radius: 20px;
  box-shadow: 0 4px 12px rgba(255, 165, 0, 0.15);
  padding: 40px 25px;
  margin: 50px auto;
  max-width: 800px;
  text-align: left;
  color: #333;
  animation: fadeIn 1.3s ease-in-out;
}

.how-it-works h2 {
  font-size: 2rem;
  color: #ff7300;
  text-align: center;
  margin-bottom: 25px;
  text-shadow: 1px 1px 3px rgba(255, 166, 0, 0.3);
}

.how-it-works p {
  font-size: 1.05rem;
  line-height: 1.7;
  margin: 15px 0;
}

.how-it-works ul {
  padding: 0;
  margin: 15px 0 20px 0;
}

.how-it-works li {
  background: rgba(255, 255, 255, 0.7);
  margin: 10px 0;
  padding: 10px 15px;
  border-radius: 10px;
  border-left: 5px solid #ff7300;
  transition: transform 0.25s ease, background 0.25s ease;
}

.how-it-works li:hover {
  transform: translateX(5px);
  background: #fff4e6;
}

/* ---------------------- CONTATTI ---------------------- */
.contact-section {
  margin-top: 50px;
  padding: 20px;
  border-top: 2px dashed #ffcc70;
}

.contact-section h2 {
  color: #ff9900;
}

.form-group {
  margin-bottom: 15px;
}

label {
  display: block;
  font-weight: 600;
  color: #222;
  margin-bottom: 6px;
}

input, textarea {
  width: 80%;
  padding: 10px;
  border: 2px solid #ffd280;
  border-radius: 10px;
  font-size: 1rem;
  outline: none;
  transition: 0.2s;
}

input:focus, textarea:focus {
  border-color: #ff6b6b;
  box-shadow: 0 0 8px rgba(255, 107, 107, 0.3);
}

#charCount {
  font-size: 0.9rem;
  text-align: right;
  color: #777;
  margin-top: 5px;
}

#feedbackMessage {
  margin: 15px 0;
  font-size: 1.05rem;
  font-weight: 600;
  display: none;
  text-align: center;
}

.terms-group {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 20px auto;
  width: 80%;
  text-align: left;
}

.terms-group label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 1rem;
  color: #333;
  line-height: 1.4;
}

.terms-group input[type="checkbox"] {
  flex-shrink: 0;
  width: 15px;
  height: 15px;
  accent-color: #ff6b6b;
  border: 2px solid #ffd280;
  border-radius: 5px;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.terms-group input[type="checkbox"]:hover {
  transform: scale(1.15);
}

.terms-group a {
  color: #ff6b6b;
  text-decoration: none;
  font-weight: 600;
}

.terms-group a:hover {
  text-decoration: underline;
}

/* ---------------------- RESPONSIVE ---------------------- */
@media (max-width: 768px) {

  /* HEADER */
  header {
    margin-top: 20px;
    padding: 0 10px;
  }

  header img {
    max-width: 95%;
  }

  /* MAIN */
  main {
    padding: 25px 15px;
    margin: 20px 10px;
    border-radius: 15px;
    box-shadow: 0 0 15px rgba(255, 166, 0, 0.2);
  }

  main h1,
  .intro h1 {
    font-size: 1.7rem;
    line-height: 1.3;
  }

  main p {
    font-size: 1rem;
    line-height: 1.6;
  }

  .btnStart {
    width: 90%;
    font-size: 1.1rem;
    padding: 12px 0;
    margin-top: 15px;
  }

  /* SEZIONE "COME FUNZIONA" */
  .how-it-works {
    padding: 25px 15px;
    margin: 35px 10px;
    text-align: left;
  }

  .how-it-works h2 {
    font-size: 1.5rem;
  }

  .how-it-works p,
  .how-it-works li {
    font-size: 0.95rem;
    line-height: 1.6;
  }

  .how-it-works li {
    padding: 8px 10px;
    margin: 8px 0;
  }

  /* CONTATTI */
  .contact-section {
    margin-top: 40px;
    padding: 15px 10px;
  }

  .contact-section h2 {
    font-size: 1.4rem;
    text-align: center;
  }

  label {
    font-size: 0.95rem;
  }

  input,
  textarea {
    width: 100%;
    font-size: 0.95rem;
    padding: 8px;
  }

  .terms-group {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    font-size: 0.9rem;
  }

  .terms-group label {
    font-size: 0.9rem;
    line-height: 1.3;
  }

  .terms-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
  }

  #charCount {
    text-align: left;
    font-size: 0.85rem;
  }

  #feedbackMessage {
    font-size: 0.95rem;
  }
}
