/* Sumeria — Wizard multi-step
   Hereda colores de style.css (Bootstrap). Solo añade comportamiento de pasos.
*/

/* ── Fundamentos ──────────────────────────────────────────────── */
.wizard-step[hidden] {
  display: none !important;   /* gana sobre cualquier Bootstrap display: block */
}
.wizard-step {
  animation: wizardFadeIn 150ms ease;
}
@keyframes wizardFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .wizard-step { animation: none; }
}

/* ── Stepper header ───────────────────────────────────────────── */
.wizard-stepper {
  margin: 0.75rem 0 1.25rem;
  background: #f5f6f8;
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  user-select: none;
}

/* Mobile: dots compactos + título */
.wizard-stepper-mobile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.wizard-dots {
  display: flex;
  gap: 0.4rem;
}
.wizard-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #cfd6df;
  transition: background-color 0.2s ease, transform 0.2s ease;
}
.wizard-dot.is-complete { background: #25d366; }
.wizard-dot.is-active   { background: #066aab; transform: scale(1.35); }
.wizard-dot.is-error    { background: #d32f2f; }
.wizard-dot.is-skipped  { background: transparent; border: 1px dashed #cfd6df; opacity: 0.5; }

/* ── Selector de método de subida de fotos (Paso 3) ───────────────────────── */
.metodo-fotos-pregunta {
  font-weight: 600;
  color: #1f2937;
  margin: 0 0 0.6rem;
}
.metodo-fotos-group {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}
@media (min-width: 576px) {
  .metodo-fotos-group { grid-template-columns: 1fr 1fr; }
}
.metodo-foto-card {
  position: relative;
  display: block;
  border: 1.5px solid #d9d2c2;
  border-radius: 10px;
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  margin: 0;
}
.metodo-foto-card:hover { border-color: #066aab; background: #f7faff; }
.metodo-foto-card input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.metodo-foto-card:has(input:checked) {
  border-color: #066aab;
  background: #eef6ff;
  box-shadow: 0 0 0 3px rgba(6,106,171,0.12);
}
.metodo-foto-body { display: flex; flex-direction: column; gap: 4px; }
.metodo-foto-body strong { color: #1f2937; font-size: 0.98rem; }
.metodo-foto-body small { color: #6c757d; line-height: 1.35; }
.metodo-badge {
  align-self: flex-start;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eceff3;
  color: #4b5563;
  margin-bottom: 2px;
}
.metodo-badge--reco { background: #c89b5c; color: #fff; }
.wizard-step-item.is-skipped { opacity: 0.4; pointer-events: none; }
.wizard-step-item.is-skipped .wizard-step-circle { background: #f1f1f1; color: #999; border-style: dashed; }
.wizard-step-item.is-skipped .wizard-step-label::after { content: ' (no aplica)'; font-size: 0.75em; color: #999; }
.wizard-step-counter {
  display: flex;
  flex-direction: column;
  text-align: right;
  font-size: 0.85rem;
}
.wizard-step-counter strong {
  font-weight: 600;
  color: #066aab;
  font-size: 0.9rem;
}
.wizard-step-counter small {
  color: #6c757d;
}

/* Desktop: stepper horizontal completo */
.wizard-stepper-desktop {
  display: none;
}
@media (min-width: 576px) {
  .wizard-stepper-mobile { display: none; }
  .wizard-stepper-desktop {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    width: 100%;
  }
}

.wizard-step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  text-align: center;
  position: relative;
  min-width: 0;
}
.wizard-step-item + .wizard-step-item::before {
  content: "";
  position: absolute;
  top: 14px;
  left: -50%;
  width: 100%;
  height: 2px;
  background: #cfd6df;
  z-index: 0;
}
.wizard-step-item.is-complete + .wizard-step-item::before,
.wizard-step-item.is-complete::before {
  background: #25d366;
}

.wizard-step-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #cfd6df;
  color: #6c757d;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  position: relative;
  z-index: 1;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.wizard-step-item.is-active .wizard-step-circle {
  background: #066aab;
  border-color: #066aab;
  color: #fff;
}
.wizard-step-item.is-complete .wizard-step-circle {
  background: #25d366;
  border-color: #25d366;
  color: #fff;
}
.wizard-step-item.is-complete .wizard-step-circle::before {
  content: "✓";
  font-size: 0.95rem;
  font-weight: 700;
}
.wizard-step-item.is-complete .wizard-step-circle-num { display: none; }

.wizard-step-item.is-error .wizard-step-circle {
  background: #d32f2f;
  border-color: #d32f2f;
  color: #fff;
}
.wizard-step-item.is-error .wizard-step-circle::after {
  content: "⚠";
  position: absolute;
  font-size: 0.9rem;
}
.wizard-step-item.is-error .wizard-step-circle-num { display: none; }

.wizard-step-label {
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: #6c757d;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.wizard-step-item.is-active .wizard-step-label {
  color: #066aab;
  font-weight: 600;
}

/* Clickeable hacia atrás */
.wizard-step-item.is-clickable { cursor: pointer; }
.wizard-step-item.is-clickable:hover .wizard-step-circle {
  filter: brightness(1.1);
}

/* ── Banner IA persistente ────────────────────────────────────── */
.wizard-ai-banner {
  background: linear-gradient(135deg, #eef4fb 0%, #f4f8fc 100%);
  border: 1px solid #cfdcf0;
  border-radius: 0.6rem;
  margin-bottom: 1rem;
  padding: 0.6rem 0.9rem;
  font-size: 0.9rem;
}
.wizard-ai-banner summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: #066aab;
  list-style: none;
}
.wizard-ai-banner summary::-webkit-details-marker { display: none; }
.wizard-ai-banner summary::after {
  content: "▼";
  margin-left: auto;
  font-size: 0.7rem;
  transition: transform 0.2s ease;
}
.wizard-ai-banner[open] summary::after { transform: rotate(180deg); }
.wizard-ai-banner-body {
  padding-top: 0.75rem;
}

/* ── Botonera Atrás / Continuar ───────────────────────────────── */
.wizard-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid #e9ecef;
}
.wizard-nav .btn {
  min-height: 44px;
  padding: 0.55rem 1.1rem;
  font-weight: 600;
}
.wizard-nav .btn-back {
  background: #fff;
  border: 1.5px solid #066aab;
  color: #066aab;
}
.wizard-nav .btn-back:hover { background: #eef4fb; }
.wizard-nav .btn-back:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.wizard-nav .btn-next,
.wizard-nav .btn-submit {
  margin-left: auto;
}
.wizard-nav .btn-next {
  background: #066aab;
  border: none;
  color: #fff;
}
.wizard-nav .btn-next:hover { background: #04507f; }

/* En el step final el submit se renderiza dentro del bloque legal, NO acá */
.wizard-nav.is-last .btn-next { display: none; }

/* ── Banner draft (borrador guardado) ─────────────────────────── */
.wizard-draft-banner {
  background: #fff3cd;
  border-left: 4px solid #ffc107;
  border-radius: 0.5rem;
  padding: 0.85rem 1rem;
  margin: 0.75rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.wizard-draft-banner strong {
  color: #5b4500;
}
.wizard-draft-banner small {
  color: #6c757d;
  display: block;
}
.wizard-draft-banner-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.wizard-draft-banner .btn-link {
  background: none;
  border: none;
  color: #6c757d;
  text-decoration: underline;
  padding: 0;
  font-size: 0.85rem;
  cursor: pointer;
}

/* ── Toasts y estado ──────────────────────────────────────────── */
.wizard-toast {
  position: fixed;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background: #1eb558;
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.9rem;
  z-index: 9999;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  animation: wizardToastIn 200ms ease;
}
@keyframes wizardToastIn {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* Pulso suave en campos rellenados por IA */
.wizard-pulse {
  animation: wizardPulse 1.6s ease;
}
@keyframes wizardPulse {
  0%   { box-shadow: 0 0 0 0 rgba(6, 106, 171, 0.4); }
  100% { box-shadow: 0 0 0 8px rgba(6, 106, 171, 0); }
}
