/* ============================================
   ONBOARD PAGE — Awwwards-Level Wizard
   ============================================ */

/* ── WebGL Background ── */
.onboard-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.4;
}

/* ── Page Wrapper ── */
.onboard-wrapper {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 120px 24px 60px;
}

/* ── Progress Bar ── */
.onboard-progress {
  width: 100%;
  max-width: 680px;
  margin-bottom: 48px;
}

.onboard-progress-track {
  width: 100%;
  height: 4px;
  background: var(--white-10);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 20px;
}

.onboard-progress-fill {
  width: 25%;
  height: 100%;
  background: var(--gradient-gold);
  border-radius: 2px;
  transition: width 0.6s var(--ease-out);
  box-shadow: 0 0 12px var(--gold-glow);
}

.onboard-progress-steps {
  display: flex;
  justify-content: space-between;
}

.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: relative;
}

.progress-step-number {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--white-20);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--white-50);
  transition: all 0.4s var(--ease-out);
}

.progress-step-label {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--white-50);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: color 0.4s var(--ease-out);
}

.progress-step.active .progress-step-number {
  border-color: var(--gold);
  background: var(--gold-dim);
  color: var(--gold);
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.2);
}

.progress-step.active .progress-step-label {
  color: var(--gold);
}

.progress-step.completed .progress-step-number {
  border-color: var(--gold);
  background: var(--gold);
  color: var(--navy);
}

.progress-step.completed .progress-step-label {
  color: var(--gold);
}

/* ── Wizard Container ── */
.wizard-container {
  width: 100%;
  max-width: 680px;
  position: relative;
  overflow: hidden;
}

/* ── Step Panels ── */
.step-panel {
  display: none;
  width: 100%;
}

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

/* ── Wizard Card ── */
.wizard-card {
  padding: 48px 40px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.wizard-card-header {
  text-align: center;
  margin-bottom: 36px;
}

.wizard-title {
  font-size: clamp(1.5rem, 4vw, 2rem);
  color: var(--white);
  margin-bottom: 8px;
}

.wizard-subtitle {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--white-70);
  line-height: 1.7;
}

/* ── Plan Badge ── */
.plan-badge {
  display: inline-block;
  padding: 4px 14px;
  background: var(--gold-dim);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 50px;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 16px;
}

/* ── Plan Tier Cards (Step 1) ── */
.plan-tiers {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.plan-tier-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1.5px solid var(--white-10);
  border-radius: var(--radius);
  padding: 24px 20px;
  cursor: pointer;
  transition: all 0.3s var(--ease-out);
  position: relative;
  overflow: hidden;
}

.plan-tier-card:hover {
  border-color: var(--white-20);
  background: rgba(255, 255, 255, 0.06);
}

.plan-tier-card.selected {
  border-color: var(--gold);
  background: var(--gold-dim);
  box-shadow: 0 0 30px rgba(212, 175, 55, 0.15);
}

.plan-tier-card.featured {
  border-color: rgba(212, 175, 55, 0.4);
}

.plan-tier-popular {
  position: absolute;
  top: 0;
  right: 0;
  background: var(--gradient-gold);
  color: var(--navy);
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 0 0 0 var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.plan-tier-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.plan-tier-name {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  color: var(--white);
}

.plan-tier-price {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gold);
}

.plan-tier-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.plan-tier-features li {
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: var(--white-70);
  padding-left: 18px;
  position: relative;
}

.plan-tier-features li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold-dim);
  border: 1px solid rgba(212, 175, 55, 0.3);
}

.plan-tier-card.selected .plan-tier-features li::before {
  background: var(--gold);
}

/* ── Form Elements ── */
.form-group {
  margin-bottom: 24px;
}

.form-label {
  display: block;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--white-90);
  margin-bottom: 8px;
}

.form-label .optional {
  color: var(--white-50);
  font-weight: 400;
  font-size: 0.8rem;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1.5px solid var(--white-10);
  border-radius: var(--radius-sm);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: border-color 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
  outline: none;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--white-50);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1), 0 0 20px rgba(212, 175, 55, 0.08);
}

.form-input.error,
.form-select.error,
.form-textarea.error {
  border-color: #e74c3c;
  box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.15);
}

.form-error {
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: #e74c3c;
  margin-top: 6px;
  display: none;
}

.form-error.visible {
  display: block;
}

.form-hint {
  font-size: 0.78rem;
  color: var(--white-50);
  margin-top: 4px;
}

.form-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.5)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 44px;
  cursor: pointer;
}

.form-select option {
  background: #1a1a2e;
  color: var(--white);
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.6;
}

.form-input.mono {
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.88rem;
  letter-spacing: 0.02em;
}

/* ── Buttons ── */
.btn-wizard {
  padding: 16px 36px;
  border-radius: 50px;
  width: 100%;
  font-size: 0.95rem;
}

.btn-wizard .btn-text {
  transition: opacity 0.2s;
}

.btn-wizard .btn-spinner {
  display: none;
  width: 20px;
  height: 20px;
  border: 2.5px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.btn-wizard.loading .btn-text {
  opacity: 0;
}

.btn-wizard.loading .btn-spinner {
  display: block;
  position: absolute;
}

.btn-wizard:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

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

.wizard-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.wizard-actions .btn-back {
  flex: 0 0 auto;
  width: auto;
  padding: 16px 28px;
}

.wizard-actions .btn-primary {
  flex: 1;
}

/* ── Integration Sections ── */
.integration-section {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--white-10);
}

.integration-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.integration-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.integration-icon svg {
  width: 22px;
  height: 22px;
}

.telegram-icon {
  background: linear-gradient(135deg, #2AABEE, #229ED9);
  box-shadow: 0 4px 20px rgba(42, 171, 238, 0.3);
}

.discord-icon {
  background: linear-gradient(135deg, #5865F2, #7289da);
  box-shadow: 0 4px 20px rgba(88, 101, 242, 0.3);
}

.gmail-icon {
  background: linear-gradient(135deg, #EA4335, #FBBC05, #34A853, #4285F4);
  box-shadow: 0 4px 20px rgba(234, 67, 53, 0.2);
}

.integration-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--white);
  line-height: 1.3;
}

.integration-desc {
  font-size: 0.85rem;
  color: var(--white-50);
}

.integration-hint {
  font-size: 0.85rem;
  color: var(--white-70);
  margin-bottom: 16px;
  line-height: 1.6;
}

.integration-hint strong {
  color: var(--white-90);
}

.integration-hint a {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.integration-optional {
  font-size: 0.8rem;
  color: var(--white-50);
  margin-top: 8px;
}

/* ── Instructions List ── */
.instructions-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-bottom: 32px;
}

.instruction-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.instruction-number {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--gold-dim);
  border: 1.5px solid rgba(212, 175, 55, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--gold);
  flex-shrink: 0;
  margin-top: 2px;
}

.instruction-text {
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--white-90);
  line-height: 1.6;
}

.instruction-text code {
  display: inline-block;
  padding: 2px 8px;
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: 4px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.83rem;
  color: var(--gold);
}

/* ── Gmail Details ── */
.gmail-details {
  margin-top: 8px;
  margin-bottom: 8px;
}

.gmail-details summary {
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--gold);
  font-family: var(--font-body);
  font-weight: 500;
  outline: none;
  transition: color 0.3s;
}

.gmail-details summary:hover {
  color: var(--gold-light);
}

.gmail-instructions {
  margin-top: 12px;
  padding-left: 20px;
  font-size: 0.83rem;
  color: var(--white-70);
  line-height: 1.8;
}

.gmail-instructions a {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.gmail-instructions strong {
  color: var(--white-90);
}

/* ── Review Summary (Step 4) ── */
.review-summary {
  margin-bottom: 32px;
}

.review-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 14px 0;
  border-bottom: 1px solid var(--white-05);
}

.review-row:last-child {
  border-bottom: none;
}

.review-label {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--white-50);
  font-weight: 500;
  flex-shrink: 0;
  margin-right: 16px;
}

.review-value {
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--white-90);
  text-align: right;
  word-break: break-word;
}

.review-value.mono {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.82rem;
}

/* ── Loading State ── */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 40px;
  text-align: center;
}

.spinner-ring {
  width: 56px;
  height: 56px;
  border: 3px solid var(--white-10);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 28px;
}

.loading-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  color: var(--white);
  margin-bottom: 12px;
}

.loading-subtitle {
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--white-50);
  min-height: 24px;
  transition: opacity 0.3s;
}

/* ── Error State ── */
.error-state {
  text-align: center;
  padding: 60px 40px;
}

.error-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(231, 76, 60, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
}

.error-icon svg {
  width: 32px;
  height: 32px;
  stroke: #e74c3c;
}

.error-state h2 {
  font-size: 1.5rem;
  color: var(--white);
  margin-bottom: 12px;
}

.error-state p {
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--white-70);
  line-height: 1.7;
}

.error-state a {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── Success State ── */
.success-state {
  text-align: center;
  padding: 48px 40px;
  position: relative;
  overflow: hidden;
}

.checkmark-circle {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: var(--gold-dim);
  border: 3px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 28px;
  animation: checkPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

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

.checkmark-circle svg {
  width: 40px;
  height: 40px;
  stroke: var(--gold);
  stroke-dasharray: 50;
  stroke-dashoffset: 50;
  animation: checkDraw 0.6s 0.3s ease forwards;
}

@keyframes checkDraw {
  to { stroke-dashoffset: 0; }
}

.success-state h2 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  color: var(--gold);
  margin-bottom: 12px;
}

.success-state p {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--white-70);
  margin-bottom: 32px;
  line-height: 1.7;
}

.success-state .btn-wizard {
  max-width: 280px;
  margin: 0 auto;
}

/* ── Gold Celebration Particles ── */
.particles-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  overflow: hidden;
  display: none;
}

.particles-container.active {
  display: block;
}

.gold-particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--gold);
  border-radius: 50%;
  opacity: 0;
  animation: particleRise linear forwards;
}

@keyframes particleRise {
  0% {
    opacity: 0;
    transform: translateY(0) scale(0.5);
  }
  10% {
    opacity: 0.8;
  }
  80% {
    opacity: 0.4;
  }
  100% {
    opacity: 0;
    transform: translateY(-100vh) scale(0);
  }
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .onboard-wrapper {
    padding: 100px 16px 40px;
  }

  .wizard-card {
    padding: 36px 24px;
  }

  .plan-tiers {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .wizard-actions {
    flex-direction: column;
  }

  .wizard-actions .btn-back {
    width: 100%;
    order: 2;
  }

  .wizard-actions .btn-primary {
    order: 1;
  }

  .progress-step-number {
    width: 34px;
    height: 34px;
    font-size: 0.78rem;
  }

  .progress-step-label {
    font-size: 0.6rem;
  }

  .wizard-title {
    font-size: 1.35rem;
  }

  .wizard-subtitle {
    font-size: 0.9rem;
  }

  .instruction-item {
    gap: 10px;
  }

  .instruction-number {
    width: 26px;
    height: 26px;
    font-size: 0.72rem;
  }

  .instruction-text {
    font-size: 0.83rem;
  }

  .loading-state,
  .success-state,
  .error-state {
    padding: 40px 16px;
  }
}

@media (max-width: 380px) {
  .wizard-card {
    padding: 24px 16px;
  }

  .btn-wizard {
    padding: 14px 24px;
    font-size: 0.88rem;
  }
}
