/* ============================================
   WIZARD / STEPPER — пошаговые страницы
   ============================================ */

.wizard {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.wizard-header {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 22px;
  border-radius: 14px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
}

.wizard-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
}

.wizard-title h1 {
  margin: 0;
  font-size: clamp(1.2rem, 1.6vw, 1.5rem);
}

.wizard-title .muted {
  font-size: 0.85rem;
  color: var(--muted);
}

/* Прогресс-бар со шагами */
.wizard-progress {
  display: grid;
  grid-template-columns: repeat(var(--steps, 4), 1fr);
  gap: 0;
  counter-reset: step;
  position: relative;
}

.wizard-progress::before {
  content: '';
  position: absolute;
  left: 24px;
  right: 24px;
  top: 16px;
  height: 2px;
  background: var(--line);
  z-index: 0;
}

.wizard-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: var(--muted);
  font-size: 0.78rem;
  text-align: center;
  position: relative;
  z-index: 1;
  padding: 0 4px;
}

.wizard-step-num {
  counter-increment: step;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--surface);
  border: 2px solid var(--line);
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--muted);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.wizard-step-num::before {
  content: counter(step);
}

.wizard-step-label {
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* completed: сплошной role-accent, галочка */
.wizard-step.is-done .wizard-step-num {
  background: var(--role-accent);
  border-color: var(--role-accent);
  color: #fff;
}
.wizard-step.is-done .wizard-step-num::before { content: '✓'; }
.wizard-step.is-done .wizard-step-label { color: var(--text); }

/* active: заполнен cветлее, толстая рамка */
.wizard-step.is-active .wizard-step-num {
  background: var(--surface-strong);
  border-color: var(--role-accent);
  color: var(--role-accent);
}
.wizard-step.is-active .wizard-step-label {
  color: var(--text);
  font-weight: 600;
}

/* Заливка линии между шагами */
.wizard-progress-fill {
  position: absolute;
  left: 24px;
  top: 16px;
  height: 2px;
  background: var(--role-accent);
  z-index: 0;
  transition: width 0.25s ease;
}

/* Контент шага */
.wizard-content {
  display: grid;
  gap: 14px;
}

.wizard-content > .surface-card {
  margin: 0;
}

/* Нижняя панель навигации */
.wizard-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  align-items: center;
  flex-wrap: wrap;
}

.wizard-nav-hint {
  color: var(--muted);
  font-size: 0.82rem;
  flex: 1;
  min-width: 160px;
}

.wizard-nav-actions {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Компактный чек-лист внутри шага */
.wizard-summary {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border-radius: 10px;
  background: var(--role-soft);
  border: 1px solid var(--line);
}

.wizard-summary-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
}

.wizard-summary-row dt {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
}

.wizard-summary-row dd {
  margin: 0;
  font-weight: 600;
  text-align: right;
}

/* Mobile: компактный прогресс (номер+подпись в колонку) */
@media (max-width: 640px) {
  .wizard-progress {
    grid-auto-flow: column;
    grid-auto-columns: minmax(80px, 1fr);
    overflow-x: auto;
    scrollbar-width: none;
  }
  .wizard-progress::-webkit-scrollbar { display: none; }
  .wizard-step-label {
    font-size: 0.72rem;
  }
  .wizard-nav {
    flex-direction: column;
    align-items: stretch;
  }
  .wizard-nav-actions {
    justify-content: space-between;
  }
}
