.procedura-iscrizione {
  background: #f8f9fa;
  padding: 25px;
  border-radius: 10px;
  margin-bottom: 30px;
  border-left: 4px solid #dc3545;
  color: #333;
}

.procedura-iscrizione h2 {
  color: #dc3545;
  margin-top: 0;
}

.procedura-iscrizione h3 {
  color: #495057;
  margin-top: 20px;
  margin-bottom: 10px;
}

.procedura-iscrizione h4 {
  color: #495057;
  margin-top: 15px;
}

.procedura-iscrizione p {
  color: #555;
  line-height: 1.6;
  margin-bottom: 10px;
}

.procedura-iscrizione ul {
  color: #555;
  padding-left: 20px;
  margin-bottom: 15px;
}

.procedura-iscrizione li {
  margin-bottom: 5px;
}

.box-quota {
  background: #fff;
  padding: 20px;
  margin: 20px 0;
  border-radius: 8px;
  border: 2px solid #28a745;
  color: #333;
}

.box-quota h3 {
  color: #28a745;
  margin-top: 0;
}

.box-vantaggi {
  background: #fff;
  padding: 20px;
  margin: 20px 0;
  border-radius: 8px;
  border: 2px solid #007bff;
  color: #333;
}

.box-vantaggi h3 {
  color: #007bff;
  margin-top: 0;
}

.iban-box {
  background: #f1f1f1;
  padding: 15px;
  border-radius: 5px;
  font-family: 'Courier New', monospace;
  color: #222;
  margin-top: 10px;
}

.email-important {
  font-weight: bold;
  font-size: 1.1em;
  color: #d63384;
  background: #fff3cd;
  padding: 10px;
  border-radius: 5px;
  display: inline-block;
  margin: 5px 0;
}

/* ===== BLOCCO INFORMATIVA ===== */
.informativa {
  margin-bottom: 60px;
}

/* ===== PDF VIEWER (PDF.js) ===== */
.pdf-viewer {
  height: 80vh;
  overflow-y: auto;
  background: #111;
  border: 1px solid #333;
  padding: 12px;
}

/* SINGOLA PAGINA - RENDERIZZAZIONE RESPONSIVE */
.pdf-viewer canvas {
  max-width: 100% !important;  /* Forza la larghezza massima */
  height: auto !important;     /* Mantiene le proporzioni */
  display: block;
  margin: 20px auto;           /* Centra i canvas */
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

/* Contenitore per ogni pagina */
.pdf-page {
  margin-bottom: 24px;
  text-align: center;          /* Centra il canvas */
  background: white;
  padding: 10px;
  border-radius: 5px;
}

/* ===== AZIONI ===== */
.pdf-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
}

.pdf-actions .download {
  color: #fff;
  font-size: 14px;
  opacity: 0.85;
  text-decoration: underline;
  padding: 10px 20px;
  background: #6c757d;
  border-radius: 5px;
  transition: background 0.3s;
}

.pdf-actions .download:hover {
  background: #5a6268;
  text-decoration: none;
}

button.accetta {
  padding: 10px 18px;
  background: transparent;
  border: 1px solid #fff;
  color: #fff;
  opacity: 0.4;
  transition: opacity 0.3s ease, background 0.3s;
}

button.accetta:not(:disabled) {
  opacity: 1;
  cursor: pointer;
  background: #28a745;
  border-color: #28a745;
}

button.accetta:disabled {
  background: #6c757d;
  border-color: #6c757d;
  cursor: not-allowed;
}

button.accetta:hover:not(:disabled) {
  background: #218838;
  border-color: #218838;
}

/* ===== FORM ISCRIZIONE - VERSIONE MIGLIORATA ===== */
#iscrizioneForm {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  background: #1a1a1a;
  padding: 30px;
  border-radius: 12px;
  border: 1px solid #333;
  margin-top: 40px;
}

#iscrizioneForm h2 {
  grid-column: 1 / -1;
  color: #fff;
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 1.8em;
  border-bottom: 2px solid #dc3545;
  padding-bottom: 10px;
}

/* Gruppi di campi */
.form-group {
  display: flex;
  flex-direction: column;
}

/* Label per ogni campo */
.form-group label {
  color: #ccc;
  font-size: 0.9em;
  margin-bottom: 8px;
  font-weight: 500;
}

/* Input e select */
#iscrizioneForm input,
#iscrizioneForm select {
  padding: 14px;
  background: #2a2a2a;
  border: 1px solid #444;
  color: #fff;
  font-size: 15px;
  border-radius: 6px;
  transition: all 0.3s ease;
}

/* Focus state */
#iscrizioneForm input:focus,
#iscrizioneForm select:focus {
  outline: none;
  border-color: #dc3545;
  box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.25);
}

/* Placeholder */
#iscrizioneForm input::placeholder {
  color: #888;
}

/* Campi a tutta larghezza */
.full-width {
  grid-column: 1 / -1;
}

/* Campi readonly */
#iscrizioneForm input[readonly] {
  background: #333;
  color: #aaa;
  cursor: not-allowed;
}

/* Data di nascita - stile personalizzato */
#datanascita {
  background-color: #2a2a2a;
  color-scheme: dark;
}

/* Select con ricerca */
.select-with-search {
  position: relative;
}

.select-with-search select {
  width: 100%;
}

/* Pulsante Genera PDF */
#generaPdf {
  grid-column: 1 / -1;
  margin-top: 20px;
  padding: 16px 30px;
  background: linear-gradient(135deg, #dc3545 0%, #b02a37 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1.1em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

#generaPdf:hover {
  background: linear-gradient(135deg, #c82333 0%, #9c2431 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(220, 53, 69, 0.4);
}

#generaPdf:active {
  transform: translateY(0);
}

/* Gruppi di campi per sezioni */
.form-section {
  grid-column: 1 / -1;
  margin-top: 10px;
  padding-top: 20px;
  border-top: 1px solid #333;
}

.form-section h3 {
  color: #fff;
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 1.3em;
  color: #dc3545;
}

/* Contenitore per select con icona */
.select-container {
  position: relative;
}

.select-container::after {
  content: "▼";
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: #888;
  pointer-events: none;
  font-size: 0.8em;
}

/* Stili per i select con dati-list (per la ricerca) */
datalist {
  background: #2a2a2a;
  color: #fff;
}

/* Stili per il caricamento PDF */
.pdf-loading {
  color: #fff;
  text-align: center;
  padding: 40px;
  font-style: italic;
}

/* Scrollbar personalizzata per pdf-viewer */
.pdf-viewer::-webkit-scrollbar {
  width: 8px;
}

.pdf-viewer::-webkit-scrollbar-track {
  background: #222;
}

.pdf-viewer::-webkit-scrollbar-thumb {
  background: #555;
  border-radius: 4px;
}

.pdf-viewer::-webkit-scrollbar-thumb:hover {
  background: #777;
}

/* MOBILE */
@media (max-width: 768px) {
  #iscrizioneForm {
    grid-template-columns: 1fr;
    padding: 20px;
    gap: 15px;
  }
  
  .form-section h3 {
    font-size: 1.2em;
  }
  
  #generaPdf {
    padding: 14px 20px;
    font-size: 1em;
  }
  
  .pdf-viewer {
    height: 70vh;
    padding: 5px;
  }
  
  .pdf-viewer canvas {
    margin: 10px auto;
  }
  
  .pdf-actions {
    flex-direction: column;
    gap: 16px;
    align-items: stretch;
  }
  
  .pdf-actions .download,
  .pdf-actions button {
    width: 100%;
    text-align: center;
  }
  
  .procedura-iscrizione {
    padding: 15px;
  }
  
  .box-quota,
  .box-vantaggi {
    padding: 15px;
  }
  
  .iban-box {
    font-size: 0.9em;
    padding: 10px;
    overflow-x: auto;
    white-space: nowrap;
  }
}

@media (max-width: 480px) {
  .pdf-viewer {
    height: 60vh;
  }
  
  h1 {
    font-size: 1.8em;
  }
  
  .procedura-iscrizione h2 {
    font-size: 1.5em;
  }
  
  .email-important {
    font-size: 1em;
    padding: 8px;
    display: block;
    text-align: center;
  }
}
    
/* Stile forzato direttamente qui per evitare errori nel file CSS esterno */
  #overlay-avviso {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85); /* Sfondo scuro */
    z-index: 999999; /* Livello altissimo per stare sopra tutto */
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px); /* Effetto sfocatura sfondo */
  }

  .box-avviso {
    background: #fff;
    width: 90%;
    max-width: 500px;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    border-top: 5px solid #d32f2f; /* Bordo rosso in alto */
    font-family: sans-serif;
    animation: popupIn 0.3s ease-out;
  }

  .box-avviso h2 {
    color: #d32f2f;
    margin-top: 0;
    font-size: 22px;
  }

  .box-avviso p {
    font-size: 16px;
    color: #333;
    line-height: 1.5;
    margin-bottom: 15px;
  }

  .box-avviso ul {
    text-align: left;
    margin-bottom: 25px;
    color: #444;
    padding-left: 20px;
  }
  
  .box-avviso li {
    margin-bottom: 8px;
  }

  .box-avviso button {
    background-color: #333;
    color: white;
    border: none;
    padding: 12px 25px;
    font-size: 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
    font-weight: bold;
  }

  .box-avviso button:hover {
    background-color: #555;
  }

  /* Animazione di entrata */
  @keyframes popupIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
  }
