/* ==================== SETUP WIZARD ==================== */

.setup-wizard-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(5, 5, 15, 0.92);
  backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: wizardFadeIn 0.4s ease;
  padding: 20px;
}

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

.setup-wizard {
  width: 100%;
  max-width: 680px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  border-radius: 24px;
  border: 1px solid rgba(108, 92, 231, 0.25);
  background: linear-gradient(165deg, rgba(20, 18, 40, 0.98) 0%, rgba(10, 10, 25, 0.98) 100%);
  box-shadow:
    0 0 80px rgba(108, 92, 231, 0.15),
    0 0 200px rgba(108, 92, 231, 0.05),
    0 32px 64px rgba(0, 0, 0, 0.5);
  animation: wizardSlideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow-x: hidden;
}

@keyframes wizardSlideUp {
  from { opacity: 0; transform: translateY(40px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Progress Bar */
.wizard-progress {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 24px 32px 0;
}

.wizard-progress-step {
  display: flex;
  align-items: center;
  flex: 1;
}

.wizard-progress-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  border: 2px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  color: rgba(255, 255, 255, 0.3);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.wizard-progress-dot.active {
  border-color: var(--accent-primary, #6c5ce7);
  background: linear-gradient(135deg, #6c5ce7, #a29bfe);
  color: #fff;
  box-shadow: 0 0 20px rgba(108, 92, 231, 0.4);
}

.wizard-progress-dot.completed {
  border-color: #00cec9;
  background: linear-gradient(135deg, #00cec9, #00b894);
  color: #fff;
}

.wizard-progress-line {
  flex: 1;
  height: 2px;
  background: rgba(255, 255, 255, 0.08);
  transition: background 0.4s ease;
}

.wizard-progress-line.completed {
  background: linear-gradient(90deg, #00cec9, #6c5ce7);
}

/* Wizard Body */
.wizard-body {
  padding: 32px;
}

/* Step Container */
.wizard-step {
  display: none;
  animation: wizardStepIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

@keyframes wizardStepIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Welcome Step */
.wizard-welcome-icon {
  width: 88px;
  height: 88px;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(108, 92, 231, 0.15), rgba(162, 155, 254, 0.1));
  border: 1px solid rgba(108, 92, 231, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  animation: wizardIconPulse 2s infinite alternate;
}

.wizard-welcome-icon i {
  width: 40px;
  height: 40px;
  color: #a29bfe;
}

@keyframes wizardIconPulse {
  from { box-shadow: 0 0 20px rgba(108, 92, 231, 0.2); }
  to { box-shadow: 0 0 40px rgba(108, 92, 231, 0.4); }
}

.wizard-welcome-title {
  text-align: center;
  font-size: 28px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.wizard-welcome-subtitle {
  text-align: center;
  font-size: 15px;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 32px;
  line-height: 1.6;
}

.wizard-plan-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: linear-gradient(135deg, rgba(108, 92, 231, 0.12), rgba(162, 155, 254, 0.08));
  border: 1px solid rgba(108, 92, 231, 0.25);
  border-radius: 14px;
  margin: 0 auto 32px;
  font-size: 15px;
  font-weight: 600;
  color: #a29bfe;
}

.wizard-plan-badge i { width: 18px; height: 18px; }

.wizard-features-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 32px;
}

.wizard-feature {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
}

.wizard-feature i {
  width: 16px;
  height: 16px;
  color: #00cec9;
  flex-shrink: 0;
}

/* API Key Step */
.wizard-apikey-display {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(108, 92, 231, 0.2);
  border-radius: 14px;
  padding: 20px;
  margin: 20px 0;
  position: relative;
}

.wizard-apikey-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.4);
  margin-bottom: 10px;
  font-weight: 600;
}

.wizard-apikey-value {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 15px;
  color: #00cec9;
  word-break: break-all;
  line-height: 1.5;
  padding-right: 40px;
}

.wizard-apikey-copy {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(108, 92, 231, 0.15);
  border: 1px solid rgba(108, 92, 231, 0.3);
  border-radius: 8px;
  padding: 8px;
  cursor: pointer;
  color: #a29bfe;
  transition: all 0.2s;
}

.wizard-apikey-copy:hover {
  background: rgba(108, 92, 231, 0.3);
  color: #fff;
}

.wizard-apikey-copy i { width: 16px; height: 16px; }

.wizard-apikey-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  background: rgba(255, 193, 7, 0.06);
  border: 1px solid rgba(255, 193, 7, 0.15);
  border-radius: 12px;
  margin-top: 16px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.5;
}

.wizard-apikey-note i {
  width: 16px;
  height: 16px;
  color: #ffc107;
  flex-shrink: 0;
  margin-top: 2px;
}

/* Tool Selection Step */
.wizard-step-title {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
}

.wizard-step-desc {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 24px;
  line-height: 1.5;
}

.wizard-tools-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.wizard-tool-card {
  padding: 20px;
  background: rgba(255, 255, 255, 0.02);
  border: 2px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: center;
}

.wizard-tool-card:hover {
  border-color: rgba(108, 92, 231, 0.3);
  background: rgba(108, 92, 231, 0.05);
  transform: translateY(-2px);
}

.wizard-tool-card.selected {
  border-color: #6c5ce7;
  background: rgba(108, 92, 231, 0.08);
  box-shadow: 0 0 24px rgba(108, 92, 231, 0.15);
}

.wizard-tool-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  background: rgba(108, 92, 231, 0.1);
  border: 1px solid rgba(108, 92, 231, 0.15);
  transition: all 0.3s;
}

.wizard-tool-card.selected .wizard-tool-icon {
  background: linear-gradient(135deg, rgba(108, 92, 231, 0.2), rgba(162, 155, 254, 0.15));
  border-color: rgba(108, 92, 231, 0.4);
}

.wizard-tool-icon i {
  width: 22px;
  height: 22px;
  color: #a29bfe;
}

.wizard-tool-name {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 4px;
}

.wizard-tool-desc {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
  line-height: 1.4;
}

/* Setup Instructions Step */
.wizard-setup-code {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  margin: 16px 0;
  overflow: hidden;
}

.wizard-setup-code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.wizard-setup-code-header span {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
  font-weight: 600;
}

.wizard-setup-code-copy {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  padding: 4px;
  transition: color 0.2s;
}

.wizard-setup-code-copy:hover { color: #fff; }
.wizard-setup-code-copy i { width: 14px; height: 14px; }

.wizard-setup-code pre {
  margin: 0;
  padding: 16px;
  overflow-x: auto;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 13px;
  line-height: 1.6;
  color: #e0e0e0;
}

.wizard-setup-step {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  align-items: flex-start;
}

.wizard-setup-step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6c5ce7, #a29bfe);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  margin-top: 2px;
}

.wizard-setup-step-content {
  flex: 1;
}

.wizard-setup-step-content h5 {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  margin: 0 0 6px;
}

.wizard-setup-step-content p {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
  margin: 0;
  line-height: 1.5;
}

/* Platform Tabs */
.wizard-platform-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
}

.wizard-platform-tab {
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: all 0.2s;
}

.wizard-platform-tab:hover {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.7);
}

.wizard-platform-tab.active {
  background: rgba(108, 92, 231, 0.12);
  border-color: rgba(108, 92, 231, 0.3);
  color: #a29bfe;
}

/* Complete Step */
.wizard-complete-icon {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(0, 206, 201, 0.15), rgba(0, 184, 148, 0.1));
  border: 2px solid rgba(0, 206, 201, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  animation: wizardCheckBounce 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.wizard-complete-icon i {
  width: 44px;
  height: 44px;
  color: #00cec9;
}

@keyframes wizardCheckBounce {
  0% { transform: scale(0); opacity: 0; }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

.wizard-complete-title {
  text-align: center;
  font-size: 26px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 8px;
}

.wizard-complete-desc {
  text-align: center;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 32px;
  line-height: 1.6;
}

.wizard-support-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: rgba(108, 92, 231, 0.06);
  border: 1px solid rgba(108, 92, 231, 0.15);
  border-radius: 14px;
  margin-top: 20px;
}

.wizard-support-box i {
  width: 20px;
  height: 20px;
  color: #a29bfe;
  flex-shrink: 0;
}

.wizard-support-box span {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.5;
}

/* Footer Actions */
.wizard-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px 28px;
}

.wizard-skip {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.3);
  font-size: 13px;
  cursor: pointer;
  padding: 8px 0;
  transition: color 0.2s;
  font-family: inherit;
}

.wizard-skip:hover {
  color: rgba(255, 255, 255, 0.6);
}

.wizard-btn-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.wizard-btn-back:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.8);
}

.wizard-btn-back i { width: 14px; height: 14px; }

.wizard-footer-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.wizard-footer-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.wizard-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: linear-gradient(135deg, #6c5ce7, #a29bfe);
  border: none;
  border-radius: 12px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  font-family: inherit;
}

.wizard-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(108, 92, 231, 0.35);
}

.wizard-btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.wizard-btn-primary i { width: 16px; height: 16px; }

.wizard-btn-success {
  background: linear-gradient(135deg, #00cec9, #00b894);
}

.wizard-btn-success:hover {
  box-shadow: 0 8px 24px rgba(0, 206, 201, 0.35);
}

/* Confetti */
.wizard-confetti {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 200px;
  overflow: hidden;
  pointer-events: none;
}

.wizard-confetti-piece {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  opacity: 0;
  animation: confettiFall 3s ease-out forwards;
}

@keyframes confettiFall {
  0% { opacity: 1; transform: translateY(-20px) rotate(0deg); }
  100% { opacity: 0; transform: translateY(200px) rotate(720deg); }
}

/* Spinner */
.wizard-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 640px) {
  .setup-wizard { border-radius: 16px; }
  .wizard-body { padding: 24px 20px; }
  .wizard-footer { padding: 0 20px 20px; }
  .wizard-progress { padding: 20px 20px 0; }
  .wizard-tools-grid { grid-template-columns: 1fr; }
  .wizard-features-grid { grid-template-columns: 1fr; }
  .wizard-welcome-title { font-size: 22px; }
  .wizard-progress-dot { width: 26px; height: 26px; font-size: 11px; }
}
