/***************************************
  LIVELLO FORM OVERLAY
***************************************/

/* Overlay più trasparente */
.livello-overlay {
    position: fixed;
    top: 0; 
    left: 0;
    width: 100vw;
    height: 100vh;
    display: none; /* Inizialmente nascosto */
    justify-content: center;
    align-items: flex-start;
    z-index: 9999;
    overflow-y: auto; /* Permette lo scroll dell'overlay */
    -webkit-overflow-scrolling: touch; /* Per un migliore scroll su iOS */
    backdrop-filter: blur(10px);
  
    /* Gradiente + blur */
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.7), rgba(30, 96, 145, 0.4) 100%);
  }
  
  .livello-overlay.active {
    display: flex; /* Mostra l'overlay quando attivo */
  }
  
  /* Aggiungi questa classe per il body quando il form è aperto */
  body.livello-form-open {
    overflow: hidden; /* Blocca lo scroll della pagina */
    position: fixed; /* Necessario per iOS */
    width: 100%; /* Necessario per iOS */
    height: 100%; /* Necessario per iOS */
  }
  
  /* Container principale del form - sfondo trasparente */
  .livello-container {
    display: flex;
    max-width: 400px;
    padding: 20px;
    flex-direction: column;
    border-radius: 20px;
    background: linear-gradient(
      165deg, 
      rgb(255, 255, 255) 0%, 
      rgb(235, 246, 255) 100%
    );
    box-shadow: 0px 4px 40px 0px rgba(0, 0, 0, 0.25);
    position: relative;
    width: 100%;
    overflow-y: auto; /* Permette lo scroll del form */
    margin-bottom: 200px;
    margin-top: 80px;
  }
  
  /* Pulsante X in alto a destra (svg + dimensioni 24px) */
  .livello-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    cursor: pointer;
  }
  .livello-close-btn svg {
    width: 24px;
    height: 24px;
    aspect-ratio: 1/1;
  }
  
  /* Wrapper con bordo + padding */
  .livello-dati-wrap {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 360px;
    padding: 20px;
    border: 1px solid #1F1F1F;
    border-radius: 12px;
  }
  
  /* Titolo principale */
  .livello-title {
    color: var(--Testo, #1F1F1F);
    font-family: "Poppins", sans-serif;
    font-size: 60px;
    font-style: normal;
    font-weight: 600;
    line-height: 110%;
    text-align: left;
    margin-top: 40px;
    margin-bottom: 12px;
    width: 100%;
  }
  .livello-title .dot-rosa {
    color: #F72585;
  }
  .livello-subtitle{
    margin-bottom: 24px;
  }
  /* Step: di default nascosto, solo .active è visibile */
  .livello-step {
    display: none; 
    width: 100%;
    /* Per l'allineamento interno, quando active => display:flex */
    flex-direction: column;
    align-items: flex-start;
  }
  .livello-step.active {
    display: flex; /* use flex per allineare elementi e bottone a destra */
  }
  
  /* Domanda (titolo mini) */
  .livello-question {
    font-size: 18px;
    margin-bottom: 16px;
    color: #1F1F1F;
  }
  
  /* Contenitore risposte */
  .livello-answers {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 20px;
  }
  
  /* Label radio */
  .livello-answers label {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    cursor: pointer;
    color: #1F1F1F;
    margin-bottom: 10px;
    width: 100%;
  }
  
  /* Radio originali nascoste */
  .livello-answers input[type="radio"] {
    display: none;
  }
  
  /* Checkbox originali nascoste (privacy, marketing) */
  .check-privacy input[type="checkbox"],
  .check-marketing input[type="checkbox"] {
    display: none;
  }
  
  /* Span che contiene l'icona default (unchecked) */
  .checkbox-custom {
    width: 24px;
    height: 24px;
    background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none'><g clip-path='url(%23clip0_519_28)'><path d='M19 5V19H5V5H19ZM19 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3Z' fill='%231F1F1F'/></g><defs><clipPath id='clip0_519_28'><rect width='24' height='24' fill='white'/></clipPath></defs></svg>") no-repeat center;
    background-size: 24px 24px;
    aspect-ratio: 1/1;
  }
  
  /* Radio SELECTED => icona checked */
  .livello-answers input[type="radio"]:checked ~ .checkbox-custom {
    background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none'><g clip-path='url(%23clip0_519_22)'><path d='M19 5V19H5V5H19ZM19 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3Z' fill='%231F1F1F'/><path d='M8 9C8 8.44772 8.44772 8 9 8H15C15.5523 8 16 8.44772 16 9V15C16 15.5523 15.5523 16 15 16H9C8.44772 16 8 15.5523 8 15V9Z' fill='%231F1F1F'/></g><defs><clipPath id='clip0_519_22'><rect width='24' height='24' fill='white'/></clipPath></defs></svg>") no-repeat center;
    background-size: 24px 24px;
  }
  
  /* Check privacy/marketing => icona checked */
  .check-privacy input[type="checkbox"]:checked ~ .checkbox-custom,
  .check-marketing input[type="checkbox"]:checked ~ .checkbox-custom {
    background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none'><g clip-path='url(%23clip0_519_22)'><path d='M19 5V19H5V5H19ZM19 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3Z' fill='%231F1F1F'/><path d='M8 9C8 8.44772 8.44772 8 9 8H15C15.5523 8 16 8.44772 16 9V15C16 15.5523 15.5523 16 15 16H9C8.44772 16 8 15.5523 8 15V9Z' fill='%231F1F1F'/></g><defs><clipPath id='clip0_519_22'><rect width='24' height='24' fill='white'/></clipPath></defs></svg>") no-repeat center;
    background-size: 24px 24px;
  }
  
  /* Testo label */
  .checkbox-label {
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
  }
  
  /* Bottoni Avanti / Invia => a destra con align-self */
  .livello-btn {
    align-self: flex-end;
    margin-top: 20px;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 18px;
    background-color: #1F1F1F;
    color: #ffffff;
    padding: 8px 24px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
  }
  .livello-btn:hover {
    background-color: #F72585;
  }
  
  /* Progress bar */
  .livello-progress {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 40px;
    width: 100%;
  }
  .livello-progress-step {
    width: 40px;
    height: 4px;
    background-color: #E3E3E3;
    border-radius: 3px;
    transition: background-color 0.3s;
  }
  .livello-progress-step.active {
    background-color: #F72585;
  }
  
  /* Messaggio di successo */
  .livello-success {
    display: none;
    text-align: center;
  }

    /* bottone successo */

  .livello-success-btn {
    border-color: #1F1F1F;
    text-align: center;
    background-color: #1F1F1F;
    color: #ffffff;
    padding: 16px;
    font-size: 18px;
    border-radius: 12px;
    margin-top: 20px;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
  }

  .livello-success-subtitle {
    font-size: 18px;
    font-family: 'Poppins', sans-serif;
    color: #1F1F1F;
    margin-top: 20px;
  }


  
  /* Form group generico */
  .form-group {
    margin-bottom: 16px;
    width: 100%;
  }

  
  .form-group label {
    display: block;
    margin-bottom: 4px;
    font-size: 14px;
    font-family: 'Poppins', sans-serif;
    color: #1F1F1F;
  }
  .form-group input[type="text"],
  .form-group input[type="email"],
  .form-group input[type="number"] {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    font-family: 'Poppins', sans-serif;
    box-sizing: border-box;
  }
  
  /* Checkbox privacy e marketing label */
  .check-privacy label,
  .check-marketing label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
  }
  .check-privacy .checkbox-label,
  .check-marketing .checkbox-label {
    font-size: 14px;
    color: #1F1F1F;
  }
  .check-privacy .checkbox-label a {
    text-decoration: underline;
    color: #1F1F1F;
  }

/* Media Query per Mobile */
@media screen and (max-width: 480px) {
  

  .livello-container {
    align-self: flex-start;
    padding: 16px;
    margin: 16px;
    margin-top: 60px;
    margin-bottom: 120px;
  }

  .livello-dati-wrap {
    padding: 16px;
    width: 100%;
    max-width: 290px;
  }

  .livello-title {
    font-size: 32px;
    margin-top: 24px;
    margin-bottom: 8px;
  }

  .livello-question {
    font-size: 12px;
    margin-bottom: 12px;
  }

  .livello-btn {
    font-size: 14px;
    padding: 8px 20px;
    width: 100%; /* Bottone a larghezza piena su mobile */
  }

  .livello-progress-step {
    width: 32px;
    height: 3px;
  }

  .livello-success-btn {
    padding: 12px;
    font-size: 12px;
    width: 100%;
  }

  .form-group input[type="text"],
  .form-group input[type="email"],
  .form-group input[type="number"] {
    padding: 8px;
    font-size: 12px;
  }

  .checkbox-label {
    font-size: 10px;
  }
}