/* ==========================================================================
   VERIFICA BANDO STEP SARDEGNA — Stylesheet
   Self-contained: non dipende dal tema WordPress
   ========================================================================== */

/* ── CONTAINER PRINCIPALE ───────────────────────────────────────────────── */

#step-bando-container {
  max-width: 780px;
  margin: 0 auto;
  padding: 32px;
  background: #ffffff;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  box-sizing: border-box;
  font-family: inherit;
  color: #212529;
  line-height: 1.5;
}

#step-bando-container *,
#step-bando-container *::before,
#step-bando-container *::after {
  box-sizing: border-box;
}

/* ── INDICATORE DI PROGRESSO ────────────────────────────────────────────── */

.step-progress {
  margin-bottom: 28px;
}

.step-progress-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #495057;
  margin-bottom: 12px;
  text-align: center;
}

.step-progress-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.step-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 0.85rem;
  font-weight: 600;
  flex-shrink: 0;
  transition: background-color 0.2s, color 0.2s;
}

.step-dot.completato {
  background-color: #198754;
  color: #ffffff;
}

.step-dot.corrente {
  background-color: #0d6efd;
  color: #ffffff;
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.25);
}

.step-dot.futuro {
  background-color: #e9ecef;
  color: #6c757d;
}

/* ── TITOLI STEP ────────────────────────────────────────────────────────── */

.step-titolo {
  font-size: 1.4rem;
  font-weight: 700;
  color: #212529;
  margin: 0 0 8px;
}

.step-sottotitolo {
  font-size: 0.95rem;
  color: #6c757d;
  margin: 0 0 24px;
}

/* ── SEZIONI ────────────────────────────────────────────────────────────── */

.sezione {
  margin-bottom: 32px;
}

.sezione-titolo {
  font-size: 1rem;
  font-weight: 600;
  color: #495057;
  border-bottom: 1px solid #dee2e6;
  padding-bottom: 8px;
  margin-bottom: 16px;
}

.sezione-intro {
  font-size: 0.9rem;
  color: #6c757d;
  margin-bottom: 16px;
}

/* ── WRAPPER CAMPO ──────────────────────────────────────────────────────── */

.campo-wrapper {
  margin-bottom: 20px;
}

/* ── LABEL ──────────────────────────────────────────────────────────────── */

.campo-label,
#step-bando-container label {
  display: block;
  font-weight: 500;
  margin-bottom: 4px;
  color: #212529;
}

.campo-req {
  color: #dc3545;
  margin-left: 2px;
}

/* ── INPUT GENERICI ─────────────────────────────────────────────────────── */

#step-bando-container input[type="text"],
#step-bando-container input[type="email"],
#step-bando-container input[type="tel"],
#step-bando-container input[type="number"],
#step-bando-container select,
#step-bando-container textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 1rem;
  font-family: inherit;
  color: #212529;
  background-color: #ffffff;
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: auto;
}

#step-bando-container input[type="text"]:focus,
#step-bando-container input[type="email"]:focus,
#step-bando-container input[type="tel"]:focus,
#step-bando-container input[type="number"]:focus,
#step-bando-container select:focus,
#step-bando-container textarea:focus {
  outline: none;
  border-color: #86b7fe;
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15);
}

#step-bando-container textarea {
  resize: vertical;
  min-height: 120px;
}

#step-bando-container select {
  cursor: pointer;
}

/* ── TESTO DI AIUTO ─────────────────────────────────────────────────────── */

.campo-aiuto {
  font-size: 0.85rem;
  color: #6c757d;
  margin-top: 4px;
}

/* ── CAMPI CALCOLATI ────────────────────────────────────────────────────── */

.campo-calcolato {
  display: inline-block;
  padding: 8px 12px;
  background-color: #f8f9fa;
  border-radius: 4px;
  font-weight: 500;
  font-size: 1rem;
  color: #495057;
  min-width: 120px;
}

.campo-calcolato.pass {
  color: #155724;
  background-color: #d4edda;
}

.campo-calcolato.warning {
  color: #856404;
  background-color: #fff3cd;
}

.campo-calcolato.fail {
  color: #721c24;
  background-color: #f8d7da;
}

/* ── ERRORI ─────────────────────────────────────────────────────────────── */

.campo-errore {
  border-color: #dc3545 !important;
  box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.15) !important;
}

.messaggio-errore {
  color: #dc3545;
  font-size: 0.85rem;
  margin-top: 4px;
  min-height: 1.2em;
}

/* ── OPZIONI RADIO ──────────────────────────────────────────────────────── */

.opzioni-radio {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.opzione-radio {
  display: flex;
  align-items: flex-start;
  gap: 0;
  font-weight: 400;
  cursor: pointer;
  line-height: 1.4;
}

.opzione-radio input[type="radio"] {
  width: auto;
  margin-right: 8px;
  margin-top: 3px;
  flex-shrink: 0;
  cursor: pointer;
}

.opzione-radio:has(input:checked) {
  font-weight: 600;
}

#step-bando-container input[type="radio"],
#step-bando-container input[type="checkbox"] {
  width: auto;
  margin-right: 8px;
  cursor: pointer;
}

/* ── CONTATORE CARATTERI ────────────────────────────────────────────────── */

.contatore-caratteri {
  font-size: 0.8rem;
  color: #6c757d;
  margin-top: 4px;
  text-align: right;
}

/* ── NAVIGAZIONE ────────────────────────────────────────────────────────── */

.step-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid #dee2e6;
}

.btn-avanti,
.btn-indietro {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 24px;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: background-color 0.15s, opacity 0.15s;
  text-decoration: none;
}

.btn-avanti {
  background-color: #0d6efd;
  color: #ffffff;
  border: none;
}

.btn-avanti:hover:not(:disabled) {
  background-color: #0b5ed7;
}

.btn-avanti:disabled {
  background-color: #6c757d;
  color: #ffffff;
  cursor: not-allowed;
  opacity: 1;
}

.btn-indietro {
  background-color: #ffffff;
  color: #495057;
  border: 1px solid #ced4da;
}

.btn-indietro:hover {
  background-color: #f8f9fa;
  border-color: #adb5bd;
}

/* ── NOTA STEP ──────────────────────────────────────────────────────────── */

.step-nota {
  font-size: 0.875rem;
  color: #6c757d;
  background-color: #f8f9fa;
  border-left: 3px solid #adb5bd;
  padding: 8px 12px;
  margin-bottom: 20px;
  border-radius: 0 4px 4px 0;
}

/* ── MESSAGGIO SALVATAGGIO ───────────────────────────────────────────────── */

.btn-salva {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  background-color: #ffffff;
  color: #495057;
  border: 1px solid #adb5bd;
  transition: background-color 0.15s, border-color 0.15s;
}

.btn-salva:hover {
  background-color: #f0f0f0;
  border-color: #6c757d;
}

.msg-salvataggio {
  font-size: 0.875rem;
  color: #155724;
  background-color: #d4edda;
  border: 1px solid #c3e6cb;
  border-radius: 4px;
  padding: 8px 14px;
  margin-top: 12px;
  text-align: center;
  width: 100%;
}

/* ── CAMPO COMPOSITO (Q01/Q03/Q06/Q07/Q09) ──────────────────────────────── */

.composite-wrapper {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ── AVVISO SOMMA VOCI PIANO ─────────────────────────────────────────────── */

.avviso-somma-piano {
  background-color: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 4px;
  padding: 10px 14px;
  color: #856404;
  font-size: 0.9rem;
  margin-top: 8px;
  margin-bottom: 16px;
}

/* ── STEP 8 — CONFERMA ──────────────────────────────────────────────────── */

.step-conferma {
  text-align: center;
  padding: 48px 32px;
}

.step-conferma h2 {
  color: #155724;
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 20px;
}

.step-conferma p {
  font-size: 1.1rem;
  color: #495057;
  margin-bottom: 16px;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.step-conferma p em {
  font-size: 0.9rem;
  color: #6c757d;
}

/* ── ERRORE INVIO ───────────────────────────────────────────────────────── */

.errore-invio {
  background-color: #f8d7da;
  border: 1px solid #f5c6cb;
  border-radius: 4px;
  padding: 16px 20px;
  color: #721c24;
  margin-bottom: 16px;
  font-size: 0.95rem;
}

.errore-invio p {
  margin: 8px 0 0;
}

/* ── LOGIN REQUIRED ─────────────────────────────────────────────────────── */

.step-bando-login-required {
  max-width: 780px;
  margin: 0 auto;
  padding: 32px;
  text-align: center;
  font-size: 1rem;
  color: #495057;
}

.step-bando-login-required a {
  color: #0d6efd;
  text-decoration: underline;
}

/* ── RESPONSIVE — sotto 600px ───────────────────────────────────────────── */

@media (max-width: 600px) {
  #step-bando-container {
    padding: 16px;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  .step-titolo {
    font-size: 1.15rem;
  }

  #step-bando-container input[type="text"],
  #step-bando-container input[type="email"],
  #step-bando-container input[type="tel"],
  #step-bando-container input[type="number"],
  #step-bando-container select,
  #step-bando-container textarea {
    font-size: 0.95rem;
  }

  .step-dot {
    width: 26px;
    height: 26px;
    font-size: 0.75rem;
  }

  .step-progress-dots {
    gap: 4px;
  }

  .btn-avanti,
  .btn-indietro {
    padding: 10px 16px;
    font-size: 0.95rem;
  }

  .step-conferma {
    padding: 32px 16px;
  }

  .step-conferma h2 {
    font-size: 1.3rem;
  }

  .step-conferma p {
    font-size: 1rem;
  }
}
