/* ------------------------------
   CSS Variables e Impostazioni Base
------------------------------ */
:root {
  --primary-color: #C8553D;
  --secondary-color: #392F5A;
  --background-color: #82A6B1;
  --modal-bg-color: #392F5A;
  --privacy-bg-color: #82A6B1;
  --overlay-bg: rgba(0, 0, 0, 0.5);
  --border-radius: 25px;
  --max-width-modal: 500px;
}

/* ------------------------------
   RESET E BASE
------------------------------ */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: Arial, sans-serif;
  background-color: var(--background-color);
  color: var(--secondary-color);
  line-height: 1.6;
  padding: 20px;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body.modal-open {
  overflow: hidden;
}

/* ------------------------------
     CONTENITORE PRINCIPALE
------------------------------ */
.container {
  max-width: 500px;
  margin: 0 auto;
  text-align: center;
  word-wrap: break-word;
}

/* ------------------------------
     LOGO
------------------------------ */
.logo {
  width: 170px;
  height: 170px;
  object-fit: cover;
  border-radius: 50%;
  margin: 20px auto;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.logo:hover {
  transform: scale(1.05);
}

#logo-modal {
  transform: none !important;
}

/* ------------------------------
     TITOLO E INTRODUZIONE
------------------------------ */
h1 {
  font-size: 2rem;
  margin-bottom: 10px;
}

.intro {
  font-size: 1.2rem;
  font-weight: 550;
  margin-bottom: 30px;
}

/* ------------------------------
     BOX PRINCIPALI (scuri)
------------------------------ */
.box {
  background-color: var(--secondary-color);
  border-radius: var(--border-radius);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.2);
}

.box-text {
  font-size: 1.1rem;
  margin-bottom: 15px;
  color: white;
}

/* ------------------------------
     PULSANTI
------------------------------ */
button {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 12px 24px;
  font-size: 1.1rem;
  border-radius: 20px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

button:hover {
  background-color: #a63d2d;
}

/* ------------------------------
     SEZIONI NASCOSTE
------------------------------ */
.hidden {
  display: none;
}

/* ------------------------------
     OVERLAY OSCURANTE
------------------------------ */
#overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--overlay-bg);
  z-index: 900;
}

/* ------------------------------
     BTN CHIUSURA (generico)
------------------------------ */
.close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background-color: transparent; 
  color: white;
  border: 1px solid white;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 1.2rem;
  line-height: 1;
  text-align: center;
  cursor: pointer;
  z-index: 1001;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-btn:hover {
  background-color: var(--primary-color);
  color: white;
}

/* ------------------------------
   STILE MODALI (classe comune)
------------------------------ */
.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 999;
  width: 90%;
  max-width: var(--max-width-modal);
  max-height: 90vh;
  overflow-y: auto;
  padding: 10px;
  border-radius: var(--border-radius);
}

/* ------------------------------
     FORM POPUP (Formspree)
------------------------------ */
#form-section {
  /* Usa la classe .modal per le proprietà comuni */
  background-color: var(--modal-bg-color);
}

.form-box {
  background-color: var(--modal-bg-color);
  color: white;
  border-radius: var(--border-radius);
  padding: 20px;
  box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  gap: 15px;
  text-align: left;
  word-wrap: break-word;
}

.form-box label {
  font-weight: bold;
  font-size: 1rem;
  margin-top: 10px;
}

.form-box input,
.form-box textarea {
  padding: 10px;
  font-size: 1rem;
  border-radius: 10px;
  border: 1px solid #ccc;
  width: 100%;
  resize: vertical;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-box textarea {
  min-height: 100px;
}

.form-box input:focus,
.form-box textarea:focus {
  outline: 2px solid var(--primary-color);
  border-color: var(--primary-color);
}

.form-box button[type="submit"] {
  align-self: center;
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 12px 24px;
  font-size: 1.1rem;
  border-radius: 20px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  margin-top: 10px;
}

.form-box button[type="submit"]:hover {
  background-color: #a63d2d;
}

.error-message {
  color: var(--primary-color);
  font-size: 0.9rem;
  margin-top: 0px;
  display: block;
}

/* ------------------------------
   INFORMATIVA PRIVACY E CHECKBOX
------------------------------ */
.checkbox-container {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  color: white;
  flex-wrap: wrap;
}

.checkbox-container input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary-color);
  margin: 0;
}

.checkbox-container label {
  flex: 1;
  line-height: 1.4;
}

.checkbox-container a {
  color: white;
  text-decoration: underline;
}

.checkbox-container .error-message {
  margin-top: 8px;
}

/* ------------------------------
     PRIVACY MODALE
------------------------------ */
#privacy-info { 
  background: var(--privacy-bg-color);
  color: var(--secondary-color);
  padding-left: 30px;
  padding-right: 30px;
  box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.2);
  text-align: justify;
}

#privacy-info p {
  margin-bottom: 15px;
  line-height: 1.6;
  padding: 5px;
}

.modal-content h2 {
  margin-top: 30px;
  margin-bottom: 15px;
}

/* ------------------------------
     MESSAGGIO DI RINGRAZIAMENTO (modale)
------------------------------ */
#thank-you-message {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 999;
  background-color: var(--modal-bg-color);
  color: white;
  padding: 20px;
  border-radius: 20px;
  text-align: center;
  font-size: 1.2rem;
  line-height: 1.6;
  width: 90%;
  max-width: var(--max-width-modal);
  box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.2);
}

/* ------------------------------
     FORM MAILERLITE
------------------------------ */
#ml-form-section {
  background-color: var(--modal-bg-color);
}

.ml-block-form {
  background-color: var(--modal-bg-color);
  color: white;
  border-radius: var(--border-radius);
  padding: 20px;
  box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  gap: 15px;
  text-align: left;
  word-wrap: break-word;
}

.ml-block-form h2{
  margin-top: 20px;
}

.ml-block-form input:first-of-type{
  margin-top: 10px;
}

.ml-block-form input,
.ml-block-form textarea {
  padding: 10px;
  font-size: 1rem;
  border-radius: 10px;
  border: 1px solid #ccc;
  width: 100%;
  resize: vertical;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.ml-block-form textarea {
  min-height: 100px;
}

.ml-block-form button {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 12px 24px;
  font-size: 1.1rem;
  border-radius: 20px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.ml-block-form button:hover {
  background-color: #a63d2d;
}

#close-ml-form-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background-color: transparent;
  color: white;
  border: 1px solid white;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 1.2rem;
  line-height: 1;
  text-align: center;
  cursor: pointer;
  z-index: 1001;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ml-block-form label.checkbox {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 10px; /* Spazio tra la checkbox e il testo */
}

.ml-block-form label.checkbox input[type="checkbox"] {
  margin-top: 6px; /* Aggiusta questo valore in base alle tue necessità */
}

.ml-block-form label.checkbox a {
  color: white;
  text-decoration: underline;
  font-weight: bold;
}

/* Nuove regole per il messaggio di errore all'interno della label */
.ml-block-form label.checkbox .error-message {
  grid-column: 2;    /* L'errore apparirà nella colonna del testo */
  margin-top: 2px;    /* Riduci lo spazio tra il testo e l'errore */
  margin-left: 0;     /* Assicurati che l'errore non spinga il testo a destra */
  font-size: 0.9rem;  /* Dimensione font coerente */
  color: var(--primary-color); /* Usa il colore primario (o sostituisci con il colore che preferisci) */
}

/* ------------------------------
     MEDIA QUERY - TABLET
------------------------------ */
@media (min-width: 768px) {
  h1 {
    font-size: 2.5rem;
  }

  .intro {
    font-size: 1.4rem;
  }

  .box-text {
    font-size: 1.2rem;
  }

  button {
    font-size: 1.1rem;
    padding: 14px 28px;
  }
}

/* ------------------------------
     MEDIA QUERY - DESKTOP
------------------------------ */
@media (min-width: 1024px) {
  .container {
    max-width: 800px;
  }

  .box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 30px;
  }

  .box-text {
    font-size: 1.3rem;
    text-align: left;
  }

  button {
    margin-left: 20px;
  }
}



/* ------------------------------
     MODALE IMMAGINE GRANDE
------------------------------ */
#logo-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 999;
  align-items: center;
  justify-content: center;
}

#logo-modal.hidden {
  display: none;
}

#logo-modal:not(.hidden) {
  display: flex;
}

.logo-modal-content {
  position: relative;
  background-color: transparent;
  padding: 10px;
}

.logo-large {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 20px;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
}

/* ------------------------------
     LISTA LINK VIDEO
------------------------------ */
#video-links ul {
  list-style: none;
  padding: 0;
}

#video-links li {
  margin: 10px 0;
}

#video-links a {
  color: var(--secondary-color);
  text-decoration: underline;
  font-size: 1.05rem;
}