/* ============================================================
   wizard.css — Estilos del asistente guiado paso a paso
   ============================================================ */

/* Override intro-wrapper: en modo wizard lo centramos y le damos
   un ancho máximo cómodo.
   Importante: resetear grid-template-columns porque style.css aplica
   "auto 1fr" a .intro-wrapper (dos columnas imagen|formulario). */
#intro-wrapper.wizard-wrapper {
  display: grid;
  grid-template-columns: 1fr;   /* columna única — anula el "auto 1fr" heredado */
  grid-template-rows: auto 1fr;
  gap: 0;
  max-width: 660px;
  margin: 2rem auto;
  padding: 0 1rem 2.5rem;
  align-items: start;           /* evita que los paneles ocultos expandan la fila */
}

/* ── Stepper ──────────────────────────────────────────────── */
.wizard-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 1.75rem 0 2rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.wizard-stepper::-webkit-scrollbar { display: none; }

.wizard-step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.step-num {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  background: var(--muted, #6b7280);
  color: #fff;
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}

.wizard-step-item.active .step-num {
  background: var(--primary, #6b9dfc);
  transform: scale(1.12);
  box-shadow: 0 0 0 4px rgba(107, 157, 252, 0.25);
}

.wizard-step-item.completed .step-num {
  background: #22c55e;
}

/* Reemplaza el número por ✓ en pasos completados */
.wizard-step-item.completed .step-num .step-number { display: none; }
.wizard-step-item.completed .step-num::after { content: '✓'; }

.step-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--muted, #6b7280);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.wizard-step-item.active .step-label  { color: var(--primary, #6b9dfc); }
.wizard-step-item.completed .step-label { color: #22c55e; }

.step-connector {
  flex: 1;
  height: 2px;
  background: var(--muted, #6b7280);
  opacity: 0.22;
  min-width: 1.25rem;
  max-width: 3rem;
  margin-bottom: 1.65rem; /* alinear con el centro del círculo */
}

/* ── Panel del wizard ─────────────────────────────────────── */
.wizard-panel {
  background: var(--card, #ffffff);
  border-radius: 18px;
  padding: 2rem;
  box-shadow: var(--shadow, 0 2px 8px rgba(0,0,0,.07));
  animation: wizardFadeUp 0.25s ease both;
}

@keyframes wizardFadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.wizard-panel h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 0.4rem;
  color: var(--text, #0f172a);
}

.wizard-hint {
  font-size: 0.875rem;
  color: var(--muted, #6b7280);
  margin: 0 0 1.5rem;
}

/* ── Campos del wizard ────────────────────────────────────── */
.wizard-fields {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  margin-bottom: 1.5rem;
}

/* ── Botones de navegación ────────────────────────────────── */
.wizard-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.wizard-nav--back-only { justify-content: flex-start; }

.btn-wizard-next,
.btn-wizard-back {
  padding: 0.65rem 1.35rem;
  border-radius: 9px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, transform 0.1s;
  border: none;
}

.btn-wizard-next {
  background: var(--primary, #6b9dfc);
  color: #fff;
  margin-left: auto;
}
.btn-wizard-next:hover  { background: #5186e8; }
.btn-wizard-next:active { transform: scale(0.97); }

.btn-wizard-back {
  background: transparent;
  color: var(--muted, #6b7280);
  border: 1.5px solid var(--muted, #6b7280);
}
.btn-wizard-back:hover { background: var(--accent, #e9f0ff); border-color: var(--primary, #6b9dfc); color: var(--primary, #6b9dfc); }

/* ── Counter widget ───────────────────────────────────────── */
.counter-group {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.counter-item {
  flex: 1;
  min-width: 130px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.counter-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text, #0f172a);
}

.counter-control {
  display: flex;
  align-items: center;
  border: 1.5px solid rgba(107, 157, 252, 0.35);
  border-radius: 10px;
  overflow: hidden;
  background: var(--card, #fff);
}

.counter-btn {
  background: var(--accent, #e9f0ff);
  border: none;
  width: 2.6rem;
  height: 2.6rem;
  font-size: 1.25rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary, #6b9dfc);
  transition: background 0.15s;
  flex-shrink: 0;
  user-select: none;
}
.counter-btn:hover  { background: rgba(107, 157, 252, 0.2); }
.counter-btn:active { background: rgba(107, 157, 252, 0.35); }

.counter-control input[type="number"] {
  width: 100%;
  border: none;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text, #0f172a);
  background: transparent;
  -moz-appearance: textfield;
  padding: 0;
  min-width: 2.5rem;
  outline: none;
}
.counter-control input[type="number"]::-webkit-outer-spin-button,
.counter-control input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; }

/* ── Quality cards ────────────────────────────────────────── */
.quality-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text, #0f172a);
  margin-bottom: 0.5rem;
}

.quality-cards {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.quality-card {
  flex: 1;
  min-width: 90px;
  padding: 1rem 0.75rem;
  border-radius: 13px;
  border: 2px solid transparent;
  background: var(--accent, #e9f0ff);
  cursor: pointer;
  text-align: center;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}
.quality-card:hover { border-color: var(--primary, #6b9dfc); transform: translateY(-2px); }

.quality-card.active {
  border-color: var(--primary, #6b9dfc);
  background: var(--card, #fff);
  box-shadow: 0 4px 14px rgba(107, 157, 252, 0.25);
}

.quality-card-icon { font-size: 1.6rem; margin-bottom: 0.4rem; line-height: 1; }
.quality-card-name { font-size: 0.9rem; font-weight: 700; color: var(--text, #0f172a); }
.quality-card-desc { font-size: 0.72rem; color: var(--muted, #6b7280); margin-top: 0.3rem; }

/* ── Objetivo cards ───────────────────────────────────────── */
.objetivo-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.objetivo-card {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  border-radius: 11px;
  border: 2px solid transparent;
  background: var(--accent, #e9f0ff);
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text, #0f172a);
  transition: border-color 0.2s, background 0.2s, transform 0.12s;
}
.objetivo-card:hover  { border-color: var(--primary, #6b9dfc); transform: translateY(-1px); }
.objetivo-card.active {
  border-color: var(--primary, #6b9dfc);
  background: #fff;
  box-shadow: 0 2px 8px rgba(107,157,252,.22);
}

.objetivo-icon { font-size: 1.15rem; flex-shrink: 0; }

/* Última tarjeta centrada si total impar */
.objetivo-card:last-child:nth-child(odd) {
  grid-column: 1 / -1;
  max-width: 50%;
  margin: 0 auto;
}

/* ── Modo oscuro ──────────────────────────────────────────── */
:root.dark .wizard-panel        { background: var(--card, #1e293b); }
:root.dark .quality-card        { background: rgba(255,255,255,.06); }
:root.dark .quality-card.active { background: rgba(107,157,252,.12); }
:root.dark .objetivo-card        { background: rgba(255,255,255,.06); }
:root.dark .objetivo-card.active { background: rgba(107,157,252,.12); }
:root.dark .counter-control      { border-color: rgba(107,157,252,.25); background: rgba(255,255,255,.04); }
:root.dark .counter-btn          { background: rgba(107,157,252,.12); }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 520px) {
  #intro-wrapper.wizard-wrapper { padding: 0 0.75rem 2rem; }
  .wizard-panel  { padding: 1.25rem; }
  .wizard-stepper { padding: 1rem 0 1.5rem; }
  .step-label    { display: none; }
  .objetivo-cards { grid-template-columns: 1fr; }
  .objetivo-card:last-child:nth-child(odd) { max-width: 100%; }
  .quality-cards { flex-direction: column; }
  .quality-card  { min-width: unset; }
}
