/* toponomastica/wizard_certifica_duf.css — Rev.64.1 Step 5
 *
 * Stili per il wizard "Certificare odonimo DUF".
 * Convenzione naming: prefisso 'wcd-' per evitare collisioni con
 * 'wm-' (wizard_modifica) e 'wn-' (wizard_nuovo).
 *
 * Si appoggia ai colori e tipografia di gestione_civici.css (caricato
 * dal template gestione_odonimi.html).
 */

/* ============================================================ */
/* Wizard container                                              */
/* ============================================================ */
.wcd-wizard {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-height: 400px;
}

/* ============================================================ */
/* Step navigation (4 dots con label)                            */
/* ============================================================ */
.wcd-steps-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 1rem;
  margin-bottom: 0.5rem;
  position: relative;
}

.wcd-steps-nav::before {
  content: '';
  position: absolute;
  top: 18px;
  left: 10%;
  right: 10%;
  height: 2px;
  background: #e5e7eb;
  z-index: 0;
}

.wcd-step-dot {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  flex: 1;
  text-align: center;
}

.wcd-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #e5e7eb;
  color: #6b7280;
  font-weight: 700;
  font-size: 0.95rem;
  border: 2px solid #e5e7eb;
  transition: all 0.2s;
}

.wcd-step-dot.wcd-active .wcd-step-num {
  background: #0059B3;
  color: white;
  border-color: #0059B3;
  box-shadow: 0 0 0 4px rgba(0, 89, 179, 0.15);
}

.wcd-step-dot.wcd-done .wcd-step-num {
  background: #10b981;
  color: white;
  border-color: #10b981;
}

.wcd-step-dot.wcd-done .wcd-step-num::before {
  content: '✓';
}

.wcd-step-dot.wcd-done .wcd-step-num {
  font-size: 0;  /* nasconde il numero, mostra solo la spunta */
}

.wcd-step-dot.wcd-done .wcd-step-num::before {
  font-size: 1rem;
}

.wcd-step-lbl {
  font-size: 0.8rem;
  color: #6b7280;
  font-weight: 500;
}

.wcd-step-dot.wcd-active .wcd-step-lbl {
  color: #0059B3;
  font-weight: 700;
}

.wcd-step-dot.wcd-done .wcd-step-lbl {
  color: #10b981;
}

/* ============================================================ */
/* Content area                                                  */
/* ============================================================ */
.wcd-content {
  flex: 1;
  padding: 0 0.5rem;
}

.wcd-step-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #0059B3;
  margin: 0 0 0.5rem 0;
}

.wcd-step-help {
  color: #4b5563;
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

/* ============================================================ */
/* Step 1 — Search                                               */
/* ============================================================ */
.wcd-search-wrap {
  position: relative;
  margin-bottom: 1rem;
}

.wcd-search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 0.25rem;
  background: white;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  max-height: 320px;
  overflow-y: auto;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.wcd-search-results:empty {
  display: none;
}

.wcd-search-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  cursor: pointer;
  border-bottom: 1px solid #f3f4f6;
  transition: background 0.15s;
}

.wcd-search-item:last-child { border-bottom: none; }
.wcd-search-item:hover { background: #f9fafb; }

.wcd-si-main {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.wcd-si-meta {
  font-size: 0.8rem;
  color: #6b7280;
}

.wcd-search-loading,
.wcd-search-empty,
.wcd-empty {
  padding: 1rem;
  text-align: center;
  color: #9ca3af;
  font-style: italic;
}

.wcd-error {
  padding: 1rem;
  color: #dc2626;
  background: #fef2f2;
  border-left: 3px solid #dc2626;
}

/* Selected card (after click on search result) */
.wcd-selected-card {
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  background: #f0f9ff;
  border: 1px solid #0059B3;
  border-radius: 8px;
}

.wcd-selected-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #0059B3;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

/* ============================================================ */
/* Form (step 2-3)                                               */
/* ============================================================ */
.wcd-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 600px;
}

.wcd-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.wcd-field-disabled {
  opacity: 0.5;
  pointer-events: none;
}

.wcd-field label {
  font-weight: 600;
  color: #374151;
  font-size: 0.95rem;
}

.wcd-field label .req {
  color: #dc2626;
}

.wcd-field label small {
  color: #9ca3af;
  font-weight: 400;
}

.wcd-field .form-control {
  padding: 0.5rem 0.75rem;
  font-size: 0.95rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.wcd-field .form-control:focus {
  outline: none;
  border-color: #0059B3;
  box-shadow: 0 0 0 3px rgba(0, 89, 179, 0.1);
}

.wcd-hint {
  color: #6b7280;
  font-size: 0.8rem;
}

.wcd-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  cursor: pointer;
}

.wcd-checkbox input {
  width: 1.1rem;
  height: 1.1rem;
}

/* ============================================================ */
/* Validation errors                                             */
/* ============================================================ */
.wcd-validation {
  margin-top: 1rem;
}

.wcd-validation:empty { display: none; }

/* ============================================================ */
/* Step 4 — Preview                                              */
/* ============================================================ */
.wcd-preview {
  background: #f9fafb;
  padding: 1.25rem;
  border-radius: 8px;
  border-left: 4px solid #0059B3;
}

.wcd-preview h4 {
  font-size: 1rem;
  font-weight: 700;
  color: #0059B3;
  margin: 0 0 0.75rem 0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.wcd-preview h4 small {
  text-transform: none;
  font-weight: 400;
  color: #9ca3af;
  letter-spacing: normal;
}

.wcd-json {
  background: #1f2937;
  color: #e5e7eb;
  padding: 1rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-family: 'SF Mono', Monaco, 'Courier New', monospace;
  overflow-x: auto;
  margin: 0;
}

.wcd-json code {
  color: inherit;
  font-family: inherit;
}

/* ============================================================ */
/* Result (step 4 post-invio)                                    */
/* ============================================================ */
.wcd-result {
  padding: 1.25rem;
  border-radius: 8px;
  margin-top: 1rem;
}

.wcd-result-ok {
  background: #ecfdf5;
  border-left: 4px solid #10b981;
}

.wcd-result-ko {
  background: #fef2f2;
  border-left: 4px solid #dc2626;
}

.wcd-result-msg {
  font-size: 1.05rem;
  margin: 0 0 1rem 0;
  color: #1f2937;
}

.wcd-result-help {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  font-size: 0.9rem;
  color: #4b5563;
}

.wcd-invio-spinner {
  text-align: center;
  padding: 1.5rem;
  font-size: 1.1rem;
  color: #0059B3;
}

/* ============================================================ */
/* KV table (riassunto + selected)                               */
/* ============================================================ */
.wcd-kv {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.wcd-kv th,
.wcd-kv td {
  padding: 0.4rem 0.6rem;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
  vertical-align: top;
}

.wcd-kv th {
  font-weight: 600;
  color: #6b7280;
  width: 40%;
  font-size: 0.85rem;
}

.wcd-kv td {
  color: #1f2937;
}

.wcd-kv tr:last-child th,
.wcd-kv tr:last-child td { border-bottom: none; }

.wcd-kv code {
  background: #f3f4f6;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  font-size: 0.85em;
  color: #1f2937;
}

/* ============================================================ */
/* Badges                                                        */
/* ============================================================ */
.wcd-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.wcd-badge-warn {
  background: #fef3c7;
  color: #92400e;
}

.wcd-badge-ok {
  background: #d1fae5;
  color: #065f46;
}

.wcd-badge-ko {
  background: #fee2e2;
  color: #991b1b;
}

/* ============================================================ */
/* Action buttons (footer)                                       */
/* ============================================================ */
.wcd-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  padding-top: 1rem;
  border-top: 1px solid #e5e7eb;
}

.wcd-actions .btn {
  min-width: 120px;
}

/* ============================================================ */
/* Responsive                                                    */
/* ============================================================ */
@media (max-width: 640px) {
  .wcd-step-lbl { display: none; }
  .wcd-actions {
    flex-direction: column-reverse;
  }
  .wcd-actions .btn {
    width: 100%;
  }
}

/* ============================================================ */
/* Rev.64.1 Step 7 polish — Badge .gc-card-available             */
/* (variante verde di gc-card-locked per messaggi positivi)      */
/* ============================================================ */
.gc-card-available {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  font-size: 0.75rem;
  background: #d1fae5;
  color: #065f46;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-weight: 600;
}
