/* Onboarding Wizard Styles — Extends the base HeyHi design system */

.onboarding-main {
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 130px;
  padding-bottom: 80px;
  background: radial-gradient(circle at 50% 20%, var(--accent-primary-muted) 0%, transparent 60%);
  position: relative;
  z-index: 1;
}

.onboarding-container {
  max-width: 640px;
  width: 100%;
  padding: 0 24px;
}

.onboarding-nav-info {
  display: flex;
  align-items: center;
}

.nav-step-label {
  font-family: var(--font-accent-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-primary);
  background: var(--bg-surface-alt);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-default);
}

/* Wizard Stepper */
.wizard-stepper {
  position: relative;
  margin-bottom: 48px;
}

.stepper-track {
  position: absolute;
  top: 18px;
  left: 36px;
  right: 36px;
  height: 3px;
  background: var(--border-strong);
  border-radius: var(--radius-full);
  z-index: 0;
}

.stepper-fill {
  height: 100%;
  width: 0%;
  background: var(--accent-primary);
  border-radius: var(--radius-full);
  transition: width var(--duration-slow) var(--ease-out);
  box-shadow: var(--shadow-glow-sm);
}

.stepper-steps {
  display: flex;
  justify-content: space-between;
  position: relative;
  z-index: 1;
}

.step-marker {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: default;
}

.marker-circle {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 2px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-accent-mono);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-secondary);
  transition: all var(--duration-normal) var(--ease-out);
}

.marker-check {
  display: none;
}

.marker-number {
  display: block;
}

.step-marker.active .marker-circle {
  border-color: var(--accent-primary);
  background: var(--accent-primary-muted);
  color: var(--accent-primary);
  box-shadow: var(--shadow-glow-sm);
}

.step-marker.complete .marker-circle {
  border-color: var(--accent-primary);
  background: var(--accent-primary);
  color: white;
}

.step-marker.complete .marker-number {
  display: none;
}

.step-marker.complete .marker-check {
  display: block;
}

.marker-label {
  font-family: var(--font-accent-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.step-marker.active .marker-label {
  color: var(--accent-primary);
}

.step-marker.complete .marker-label {
  color: var(--text-secondary);
}

/* Step Cards */
.wizard-step {
  display: none;
}

.wizard-step.active {
  display: block;
  animation: step-enter var(--duration-slow) var(--ease-out) forwards;
}

@keyframes step-enter {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.step-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  padding: 48px 40px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 20px;
  box-shadow: var(--shadow-lg);
}

.step-card-glow {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at top center, var(--accent-primary-muted), transparent 60%);
  z-index: 0;
  pointer-events: none;
}

.step-card > * {
  position: relative;
  z-index: 1;
}

.step-icon-wrapper {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  box-shadow: var(--shadow-sm);
}

.step-icon-wrapper.github-color {
  background: var(--bg-surface-alt);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
}

.step-icon-wrapper.green-color {
  background: var(--accent-success-muted);
  color: var(--accent-success);
  border: 1px solid rgba(74, 190, 138, 0.2);
}

.step-icon-wrapper.blue-color {
  background: var(--accent-info-muted);
  color: var(--accent-info);
  border: 1px solid rgba(91, 155, 213, 0.2);
}

.step-icon-wrapper.purple-color {
  background: var(--accent-primary-muted);
  color: var(--accent-primary);
  border: 1px solid rgba(217, 119, 76, 0.2);
}

.step-title {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.step-description {
  color: var(--text-secondary);
  font-size: 0.98rem;
  max-width: 460px;
  line-height: 1.6;
}

.step-action-btn {
  margin-top: 12px;
  padding: 14px 32px;
  font-size: 1rem;
}

/* Step Status Messages */
.step-status {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-accent-mono);
  font-weight: 600;
  font-size: 0.85rem;
  margin-top: 8px;
}

.status-loading {
  color: var(--accent-info);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--accent-primary);
  border-radius: var(--radius-full);
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

.status-success {
  color: var(--accent-success);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.status-error {
  color: var(--accent-error);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

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

/* Provider Selector */
.provider-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 100%;
  margin: 10px 0;
}

.provider-card {
  background: var(--bg-surface-alt);
  border: 2px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 16px 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: all var(--duration-normal) var(--ease-out);
  font-family: var(--font-accent-mono);
}

.provider-card:hover {
  border-color: var(--border-strong);
  background: var(--bg-hover);
}

.provider-card.active {
  border-color: var(--accent-primary);
  background: var(--accent-primary-muted);
  box-shadow: var(--shadow-glow-sm);
}

.provider-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.provider-prefix {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-tertiary);
}

/* Input Fields styling */
.form-group {
  width: 100%;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.form-label {
  font-family: var(--font-accent-mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.95rem;
  outline: none;
  transition: border-color var(--duration-fast) var(--ease-out),
              box-shadow var(--duration-fast) var(--ease-out);
}

.form-input:focus {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-glow-sm);
  background: var(--bg-surface);
}

.form-input::placeholder {
  color: var(--text-tertiary);
}

.llm-key-group {
  width: 100%;
  text-align: left;
}

.key-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.key-input-wrapper .form-input {
  padding-right: 48px;
}

.key-toggle {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--duration-fast) var(--ease-out);
}

.key-toggle:hover {
  color: var(--text-primary);
}

.hidden {
  display: none !important;
}

/* Completion Card */
.completion-card {
  background: radial-gradient(circle at top center, var(--accent-success-muted) 0%, var(--bg-surface) 70%);
}

.completion-icon {
  animation: completion-pop var(--duration-slow) var(--ease-spring) forwards;
}

@keyframes completion-pop {
  from { transform: scale(0); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.completion-title {
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--text-primary) 30%, var(--accent-success) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.completion-desc {
  max-width: 480px;
}

.completion-details {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 16px 0;
  text-align: left;
  width: 100%;
  max-width: 440px;
}

.detail-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-accent-mono);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.detail-item svg {
  color: var(--accent-success);
}

/* Disabled state */
.step-action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* Animated Setup Network Graphic */
.setup-graphic-container {
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin: 10px 0;
}

.setup-orbit-network {
  position: relative;
  width: 140px;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.network-node {
  position: absolute;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface);
  border: 2px solid var(--border-strong);
  box-shadow: var(--shadow-md);
  z-index: 10;
}

.central-node {
  width: 54px;
  height: 54px;
  background: var(--accent-primary-muted);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  animation: pulse-central 3s infinite ease-in-out;
}

.orbiting-ring {
  position: absolute;
  border: 1px dashed var(--border-default);
  border-radius: var(--radius-full);
  pointer-events: none;
}

.ring-1 { width: 80px; height: 80px; }
.ring-2 { width: 120px; height: 120px; }
.ring-3 { width: 160px; height: 160px; }

.node-github {
  width: 32px;
  height: 32px;
  color: var(--text-primary);
  background: var(--bg-surface-alt);
  border-color: var(--border-strong);
  animation: orbit-github 20s infinite linear;
}

.node-jira {
  width: 32px;
  height: 32px;
  color: var(--accent-info);
  background: var(--accent-info-muted);
  border-color: var(--accent-info);
  animation: orbit-jira 25s infinite linear;
}

.node-llm {
  width: 32px;
  height: 32px;
  color: var(--accent-primary);
  background: var(--accent-primary-muted);
  border-color: var(--accent-primary);
  animation: orbit-llm 30s infinite linear;
}

@keyframes pulse-central {
  0%, 100% {
    transform: scale(1);
    box-shadow: var(--shadow-glow);
  }
  50% {
    transform: scale(1.08);
    box-shadow: 0 0 35px var(--accent-primary);
  }
}

@keyframes orbit-github {
  from { transform: rotate(0deg) translateX(40px) rotate(0deg); }
  to { transform: rotate(360deg) translateX(40px) rotate(-360deg); }
}

@keyframes orbit-jira {
  from { transform: rotate(120deg) translateX(60px) rotate(-120deg); }
  to { transform: rotate(480deg) translateX(60px) rotate(-480deg); }
}

@keyframes orbit-llm {
  from { transform: rotate(240deg) translateX(80px) rotate(-240deg); }
  to { transform: rotate(600deg) translateX(80px) rotate(-600deg); }
}

/* Progress bar styling */
.setup-progress-wrapper {
  width: 100%;
  max-width: 480px;
  margin: 10px auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.setup-progress-bar {
  width: 100%;
  height: 6px;
  background: var(--border-strong);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.setup-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-info), var(--accent-primary));
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-glow-sm);
  transition: width 1s linear;
}

.setup-progress-stats {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-accent-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
}

/* Dynamic Checklist Steps styling */
.setup-steps-list {
  width: 100%;
  max-width: 480px;
  margin: 15px auto 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
}

.setup-step-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  transition: all var(--duration-normal) var(--ease-out);
}

.setup-step-item.active {
  border-color: var(--accent-info);
  background: var(--accent-info-muted);
  box-shadow: 0 0 10px rgba(91, 155, 213, 0.1);
}

.setup-step-item.completed {
  border-color: var(--accent-success);
  background: var(--accent-success-muted);
}

.step-item-status {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--accent-info);
  border-radius: var(--radius-full);
  animation: spin 0.8s linear infinite;
}

.setup-step-item.pending .step-spinner {
  border-color: var(--border-strong);
}

.setup-step-item.pending .step-check {
  display: none;
}

.setup-step-item.active .step-spinner {
  border-color: var(--border-strong);
  border-top-color: var(--accent-info);
}

.setup-step-item.active .step-check {
  display: none;
}

.setup-step-item.completed .step-spinner {
  display: none;
}

.setup-step-item.completed .step-check {
  display: block;
  color: var(--accent-success);
}

.step-item-text {
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: var(--text-secondary);
  transition: color var(--duration-normal) var(--ease-out);
}

.setup-step-item.active .step-item-text {
  color: var(--text-primary);
  font-weight: 600;
}

.setup-step-item.completed .step-item-text {
  color: var(--text-secondary);
}

/* LLM Option Toggle Cards */
.llm-options-toggle {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  width: 100%;
  margin: 15px 0 25px;
}

.option-toggle-card {
  background: var(--bg-surface-alt);
  border: 2px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: 8px;
  transition: all var(--duration-normal) var(--ease-out);
}

.option-toggle-card:hover {
  border-color: var(--border-strong);
  background: var(--bg-hover);
}

.option-toggle-card.active {
  border-color: var(--accent-primary);
  background: var(--accent-primary-muted);
  box-shadow: var(--shadow-glow-sm);
}

.option-toggle-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 10px;
}

.option-toggle-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.option-toggle-badge {
  background: var(--accent-primary-muted);
  color: var(--accent-primary);
  font-family: var(--font-accent-mono);
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  border: 1px solid var(--accent-primary);
  white-space: nowrap;
}

.option-toggle-desc {
  font-family: var(--font-body);
  font-size: 0.82rem;
  line-height: 1.4;
  color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 768px) {
  .onboarding-main {
    padding-top: 100px;
  }

  .step-card {
    padding: 32px 24px;
  }

  .provider-selector {
    grid-template-columns: 1fr;
  }

  .llm-options-toggle {
    grid-template-columns: 1fr;
  }

  .marker-label {
    font-size: 0.62rem;
  }

  .stepper-track {
    left: 24px;
    right: 24px;
  }
}

@media (max-width: 375px) {
  .step-title {
    font-size: 1.3rem;
  }

  .step-action-btn {
    width: 100%;
  }
}
