/* Enterprise Upload Wizard — premium SaaS UX */
.wizard-container {
  max-width: 920px;
  margin: 0 auto;
  padding-bottom: 48px;
  position: relative;
}

.wiz-back-btn {
  position: absolute;
  left: 0;
  top: 0;
}

.wizard-hero {
  text-align: center;
  margin-bottom: 32px;
  animation: wizFadeIn 0.5s ease;
}

.wizard-hero h2 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.wizard-hero p {
  color: var(--text-muted);
  font-size: 15px;
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.6;
}

.wizard-steps {
  display: flex;
  gap: 6px;
  margin: 28px 0 36px;
  position: relative;
}

.wizard-steps::before {
  content: '';
  position: absolute;
  top: 22px;
  left: 8%;
  right: 8%;
  height: 2px;
  background: var(--border);
  z-index: 0;
}

.wizard-step {
  flex: 1;
  min-width: 72px;
  padding: 14px 8px;
  border: 1px solid transparent;
  border-radius: 14px;
  text-align: center;
  opacity: 0.45;
  background: var(--card);
  position: relative;
  z-index: 1;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.wizard-step.active {
  border-color: var(--accent);
  opacity: 1;
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}

.wizard-step.done {
  opacity: 1;
  border-color: rgba(0, 210, 106, 0.45);
}

.wizard-step.done .wizard-step-num {
  color: var(--success);
}

.wizard-step-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin: 0 auto 6px;
  border-radius: 50%;
  font-weight: 800;
  font-size: 12px;
  color: var(--accent);
  background: rgba(233, 69, 96, 0.12);
}

.wizard-step.active .wizard-step-num {
  background: var(--accent);
  color: #fff;
}

.wizard-step.done .wizard-step-num::after {
  content: '\f00c';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
}

.wizard-step.done .wizard-step-num {
  font-size: 0;
}

.wizard-step-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.wizard-panel {
  display: none;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 36px 40px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
  animation: wizSlideUp 0.4s ease;
}

.wizard-panel.active {
  display: block;
}

.wizard-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.wizard-panel-head h3 {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 6px;
}

.wizard-panel-head .wiz-sub {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
}

.wiz-badge {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.wiz-badge.required {
  background: rgba(233, 69, 96, 0.15);
  color: var(--accent-light);
  border: 1px solid rgba(233, 69, 96, 0.35);
}

.wiz-badge.optional {
  background: rgba(84, 160, 255, 0.12);
  color: var(--info);
  border: 1px solid rgba(84, 160, 255, 0.3);
}

.wiz-badge.recommended {
  background: rgba(244, 162, 97, 0.12);
  color: var(--gold);
  border: 1px solid rgba(244, 162, 97, 0.35);
}

.wiz-upload-zone {
  border: 2px dashed var(--border);
  border-radius: 16px;
  padding: 48px 32px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent);
  position: relative;
}

.wiz-upload-zone:hover,
.wiz-upload-zone.dragover {
  border-color: var(--accent);
  background: rgba(233, 69, 96, 0.06);
  box-shadow: var(--shadow-glow);
}

.wiz-upload-zone.success {
  border-color: var(--success);
  border-style: solid;
  background: rgba(0, 210, 106, 0.06);
}

.wiz-upload-zone.error {
  border-color: var(--danger);
  background: rgba(255, 71, 87, 0.06);
}

.wiz-upload-zone.uploading {
  pointer-events: none;
  opacity: 0.85;
}

.wiz-upload-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 16px;
  background: var(--gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: #fff;
}

.wiz-upload-zone h4 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 8px;
}

.wiz-upload-zone p {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 16px;
}

.wiz-upload-zone input[type='file'] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.wiz-progress {
  height: 4px;
  background: var(--border);
  border-radius: 4px;
  margin-top: 16px;
  overflow: hidden;
  display: none;
}

.wiz-upload-zone.uploading .wiz-progress {
  display: block;
}

.wiz-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--gradient);
  transition: width 0.2s ease;
}

.wiz-file-meta {
  margin-top: 16px;
  padding: 14px 18px;
  background: var(--bg);
  border-radius: 12px;
  text-align: left;
  display: none;
}

.wiz-upload-zone.success .wiz-file-meta {
  display: block;
  animation: wizFadeIn 0.3s ease;
}

.wiz-file-meta strong {
  color: var(--success);
}

.wiz-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
  align-items: center;
}

.wiz-help {
  margin-top: 20px;
  padding: 16px 20px;
  background: rgba(84, 160, 255, 0.08);
  border: 1px solid rgba(84, 160, 255, 0.25);
  border-radius: 12px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.55;
}

.wiz-help summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--info);
  list-style: none;
}

.wiz-help summary::-webkit-details-marker {
  display: none;
}

.wiz-template-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
  font-family: inherit;
}

.wiz-template-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.wiz-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin: 20px 0;
}

.wiz-summary-card {
  padding: 16px;
  background: var(--bg);
  border-radius: 12px;
  border: 1px solid var(--border);
}

.wiz-summary-card .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.wiz-summary-card .val {
  font-size: 20px;
  font-weight: 800;
}

.wiz-val-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  border-radius: 14px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
}

.wiz-val-banner.ok {
  background: rgba(0, 210, 106, 0.08);
  border-color: rgba(0, 210, 106, 0.35);
}

.wiz-val-banner.fail {
  background: rgba(255, 71, 87, 0.08);
  border-color: rgba(255, 71, 87, 0.35);
}

.wiz-val-banner i {
  font-size: 32px;
}

.wiz-val-banner.ok i {
  color: var(--success);
}

.wiz-val-banner.fail i {
  color: var(--danger);
}

.wiz-issue-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 10px;
  overflow: hidden;
}

.wiz-issue-card summary {
  padding: 14px 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  list-style: none;
}

.wiz-issue-card summary::-webkit-details-marker {
  display: none;
}

.wiz-issue-card .sev {
  font-size: 10px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 6px;
  text-transform: uppercase;
}

.wiz-issue-card .sev.critical {
  background: rgba(255, 71, 87, 0.2);
  color: var(--danger);
}

.wiz-issue-card .sev.warning {
  background: rgba(255, 179, 71, 0.2);
  color: var(--warning);
}

.wiz-issue-card .sev.info {
  background: rgba(84, 160, 255, 0.15);
  color: var(--info);
}

.wiz-issue-body {
  padding: 0 18px 14px;
  font-size: 13px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

.wiz-map-card {
  margin-bottom: 16px;
  padding: 20px;
  background: var(--bg);
  border-radius: 14px;
  border: 1px solid var(--border);
}

.wiz-report-ready {
  text-align: center;
  padding: 24px 0;
}

.wiz-report-ready .wiz-big-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: rgba(0, 210, 106, 0.12);
  color: var(--success);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
}

.wizard-error-banner {
  padding: 14px 18px;
  border-radius: 12px;
  background: rgba(255, 71, 87, 0.1);
  border: 1px solid var(--danger);
  color: var(--danger);
  margin-bottom: 20px;
  display: none;
  animation: wizFadeIn 0.3s ease;
}

.wizard-error-banner.visible {
  display: block;
}

.wiz-onboard-tip {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 900;
  max-width: 320px;
  padding: 16px 20px;
  background: var(--card);
  border: 1px solid var(--accent);
  border-radius: 14px;
  box-shadow: var(--shadow);
  font-size: 13px;
  animation: wizSlideUp 0.5s ease;
}

.wiz-onboard-tip button {
  margin-top: 10px;
}

@keyframes wizFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

.wizard-step.fail {
  border-color: rgba(255, 180, 0, 0.55);
  opacity: 1;
}

.wizard-step.fail .wizard-step-num {
  background: rgba(255, 180, 0, 0.2);
  color: #ffb800;
}

.wizard-step.loading .wizard-step-num {
  font-size: 12px;
  background: rgba(233, 69, 96, 0.15);
}

.wizard-step.incomplete {
  opacity: 0.65;
}

.wizard-step.done.fail {
  border-color: rgba(255, 180, 0, 0.55);
}

.wiz-step-loading {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 20px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(100, 120, 180, 0.08);
}

.wiz-step-loading-icon {
  font-size: 22px;
  color: var(--accent);
  margin-top: 2px;
}

.wiz-elapsed {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
}

.wiz-issue-group {
  margin: 16px 0 8px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.wiz-backend-status {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 16px;
  margin-bottom: 16px;
  border-radius: 12px;
  font-size: 14px;
  border: 1px solid var(--border);
}

.wiz-backend-status.checking {
  background: rgba(100, 120, 180, 0.1);
}

.wiz-backend-status.online {
  border-color: rgba(0, 210, 106, 0.45);
  background: rgba(0, 210, 106, 0.08);
  color: var(--success);
}

.wiz-backend-status.offline {
  border-color: rgba(233, 69, 96, 0.45);
  background: rgba(233, 69, 96, 0.08);
}

.wizard-offline-gate {
  margin-bottom: 20px;
}

.wiz-offline-card {
  padding: 20px 22px;
  border-radius: 14px;
  border: 1px solid rgba(233, 69, 96, 0.35);
  background: rgba(233, 69, 96, 0.06);
}

.wiz-offline-card ol {
  margin: 12px 0 16px 20px;
  color: var(--text-muted);
}

.wizard-blocked {
  pointer-events: none;
  opacity: 0.45;
  filter: grayscale(0.2);
}

.wiz-map-summary-banner {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px 16px;
  margin-bottom: 20px;
  border-radius: 12px;
  border: 1px solid rgba(0, 210, 106, 0.4);
  background: rgba(0, 210, 106, 0.08);
}

.wiz-map-summary-banner i {
  color: var(--success);
  font-size: 20px;
  margin-top: 2px;
}

.wiz-map-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.wiz-manual-select {
  width: 100%;
  max-width: 320px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
}

.wiz-generate-gate {
  margin: 20px 0 8px;
  padding: 18px 20px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.15);
}

.wiz-generate-gate.ready {
  border-color: rgba(0, 210, 106, 0.45);
  background: rgba(0, 210, 106, 0.08);
}

.wiz-generate-gate.blocked {
  border-color: rgba(255, 180, 0, 0.4);
  background: rgba(255, 180, 0, 0.06);
}

.wiz-gate-head {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.wiz-gate-head i {
  font-size: 22px;
  margin-top: 2px;
  color: var(--accent);
}

.wiz-generate-gate.ready .wiz-gate-head i {
  color: var(--success);
}

.wiz-gate-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.wiz-gate-item {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
}

.wiz-gate-step {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.wiz-gate-reason {
  margin: 6px 0 4px;
  font-weight: 600;
  font-size: 14px;
}

.wiz-gate-fix {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--text-muted);
}

.wiz-readiness-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  justify-content: center;
}

.wiz-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border);
}

.wiz-chip.ok {
  border-color: rgba(0, 210, 106, 0.45);
  color: var(--success);
}

.wiz-chip.pending {
  color: var(--text-muted);
}

.wiz-report-ready.is-blocked .wiz-big-icon {
  color: #ffb800;
}

#wizard-actions-7 {
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.wiz-gen-hint {
  flex: 1 1 100%;
  font-size: 13px;
  margin: 0;
}

#wizard-btn-generate.is-ready:not(:disabled) {
  box-shadow: var(--shadow-glow);
}

@media (max-width: 640px) {
  .wizard-panel {
    padding: 24px 20px;
  }
  .wizard-steps {
    flex-wrap: wrap;
  }
  .wizard-steps::before {
    display: none;
  }
}
