/* ═══════════════════════════════════════════════════════════════
   BP-WIZARD-ENGINE — Creation wizard styles
   /blueprint/assets/css/shared/wizard.css

   Blueprint-native styling for the shared BlueprintWizard overlay. Uses the
   page's existing CSS custom properties (--gp, --gd, --tm, --border, etc.)
   and reuses .form-input/.form-select/.form-textarea/.btn classes for inputs
   and buttons, so the wizard inherits the current modal/button/input look.

   All classes are bpw-* prefixed. No Supplyprint class names are used.
   z-index 260 sits above .modal-backdrop (200) and below .toast (300).
   ═══════════════════════════════════════════════════════════════ */

.bpw-overlay {
  position: fixed;
  inset: 0;
  z-index: 260;
  background: rgba(0, 0, 0, .42);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: bpw-fade .15s ease;
}
@keyframes bpw-fade { from { opacity: 0; } to { opacity: 1; } }

.bpw-modal {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 600px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .22);
}

/* ── Header ── */
.bpw-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.5rem;
  background: var(--gl);
  border-bottom: 1px solid var(--border);
}
.bpw-title {
  font-family: 'Plus Jakarta Sans', 'DM Sans', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--gd);
  letter-spacing: -.2px;
}
.bpw-step-count {
  font-size: 12px;
  color: var(--tm);
  margin-top: 3px;
}
.bpw-close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: none;
  border: none;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: var(--tm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.bpw-close:hover { background: rgba(0, 0, 0, .06); }

/* ── Stepper ── */
.bpw-steps {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 1.5rem;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}
.bpw-step-dot {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
  opacity: .55;
}
.bpw-step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #e5e7eb;
  color: #6b7280;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.bpw-step-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--t2);
  white-space: nowrap;
}
.bpw-step-dot:not(:last-child)::after {
  content: '';
  width: 16px;
  height: 2px;
  background: var(--border);
  border-radius: 2px;
}
.bpw-step-dot.bpw-active { opacity: 1; }
.bpw-step-dot.bpw-active .bpw-step-num { background: var(--gp); color: #fff; }
.bpw-step-dot.bpw-done { opacity: 1; }
.bpw-step-dot.bpw-done .bpw-step-num { background: var(--gl); color: var(--gd); }

/* ── Body ── */
.bpw-body {
  padding: 1.4rem 1.5rem;
  overflow-y: auto;
  flex: 1;
}
.bpw-step-subtitle {
  font-size: 13px;
  color: var(--tm);
  margin-bottom: 1rem;
}

/* ── Field grid (12 columns) ── */
.bpw-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 0 1rem;
}
.bpw-field { margin-bottom: 1rem; min-width: 0; }
.bpw-col-12 { grid-column: span 12; }
.bpw-col-6 { grid-column: span 6; }
.bpw-col-4 { grid-column: span 4; }
.bpw-col-8 { grid-column: span 8; }

.bpw-req { color: var(--gd); font-size: 11px; }
.bpw-hint { font-size: 11px; color: var(--tm); margin-top: 4px; }

/* ── Checkbox group ── */
.bpw-checkgroup {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.bpw-check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  cursor: pointer;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: background .12s, border-color .12s;
}
.bpw-check:hover { background: var(--gl); border-color: var(--borderS); }
.bpw-check input { accent-color: var(--gp); }

/* ── Inline errors ── */
.bpw-error {
  font-size: 11px;
  font-weight: 600;
  color: #b91c1c;
  margin-top: 5px;
}
.bpw-has-error .form-input,
.bpw-has-error .form-select,
.bpw-has-error .form-textarea {
  border-color: #fca5a5;
  box-shadow: 0 0 0 3px rgba(185, 28, 28, .08);
}
.bpw-form-error {
  margin: 0 1.5rem;
  padding: 10px 12px;
  background: #fee2e2;
  border: 1px solid #fca5a5;
  border-radius: 8px;
  color: #b91c1c;
  font-size: 13px;
  font-weight: 500;
}

/* ── Review step ── */
.bpw-review-intro { font-size: 13px; color: var(--tm); margin-bottom: 1rem; }
.bpw-review-row {
  display: flex;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}
.bpw-review-row:last-child { border-bottom: none; }
.bpw-review-label {
  font-size: 12px;
  color: var(--tm);
  width: 150px;
  flex-shrink: 0;
}
.bpw-review-value {
  font-size: 13px;
  font-weight: 500;
  color: var(--t1);
  word-break: break-word;
}
.bpw-review-empty { font-size: 13px; color: var(--tm); }

/* ── Footer ── */
.bpw-footer {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
}
.bpw-footer-spacer { flex: 1; }

/* ── Submit spinner ── */
.bpw-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 7px;
  border: 2px solid rgba(255, 255, 255, .5);
  border-top-color: #fff;
  border-radius: 50%;
  animation: bpw-spin .7s linear infinite;
  vertical-align: middle;
}
@keyframes bpw-spin { to { transform: rotate(360deg); } }

/* ── Mobile ── */
@media (max-width: 640px) {
  .bpw-overlay { padding: 0; align-items: flex-end; }
  .bpw-modal {
    max-width: 100%;
    max-height: 95vh;
    border-radius: 14px 14px 0 0;
  }
  .bpw-col-6, .bpw-col-4, .bpw-col-8 { grid-column: span 12; }
  .bpw-header, .bpw-body, .bpw-footer, .bpw-steps { padding-left: 1rem; padding-right: 1rem; }
  .bpw-form-error { margin-left: 1rem; margin-right: 1rem; }
  .bpw-step-label { display: none; }          /* keep the stepper compact */
  .bpw-step-dot.bpw-active .bpw-step-label { display: inline; }
  .bpw-review-label { width: 110px; }
  .bpw-footer { flex-wrap: wrap; }
}
