/* ═══════════════════════════════════════════════════════════
   SUCCESS PAGE — Premium confirmation experience
═══════════════════════════════════════════════════════════ */

.success-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  position: relative;
  overflow: hidden;
  background: var(--bg);
}

.success-page::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(108,99,255,0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 50%, rgba(62,207,207,0.06) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* Canvas layers */
#successParticles,
#confettiCanvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

#confettiCanvas {
  z-index: 2;
}

/* Wrapper */
.success-wrapper {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 520px;
  animation: successFadeIn 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes successFadeIn {
  from {
    opacity: 0;
    transform: translateY(40px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Card */
.success-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 3rem 2.5rem;
  box-shadow:
    0 0 0 1px rgba(108,99,255,0.1),
    0 20px 60px rgba(0,0,0,0.4),
    0 0 100px rgba(108,99,255,0.05);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.success-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent));
  background-size: 200% 100%;
  animation: gradientShift 3s ease infinite;
}

/* Animated checkmark */
.success-icon-wrap {
  position: relative;
  width: 100px;
  height: 100px;
  margin: 0 auto 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.success-checkmark {
  width: 80px;
  height: 80px;
  position: relative;
  z-index: 2;
}

.success-checkmark-circle {
  stroke: var(--accent-2);
  stroke-width: 2;
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  animation: strokeCircle 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.success-checkmark-check {
  stroke: var(--accent-2);
  stroke-width: 3;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: strokeCheck 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.6s forwards;
}

@keyframes strokeCircle {
  to { stroke-dashoffset: 0; }
}

@keyframes strokeCheck {
  to { stroke-dashoffset: 0; }
}

/* Pulse rings */
.success-pulse-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--accent-2);
  opacity: 0;
  animation: pulseRing 2s ease-out 0.8s infinite;
}

.success-pulse-ring.delay {
  animation-delay: 1.3s;
}

@keyframes pulseRing {
  0% {
    transform: scale(0.8);
    opacity: 0.6;
  }
  100% {
    transform: scale(1.6);
    opacity: 0;
  }
}

/* Typography */
.success-title {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.75rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.success-subtitle {
  color: var(--text-sub);
  font-size: 0.95rem;
  line-height: 1.65;
  margin-bottom: 2rem;
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
}

/* Order details */
.success-details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 2rem;
  text-align: left;
}

.success-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
}

.success-detail-row:last-child {
  border-bottom: none;
}

.success-detail-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.success-detail-value {
  font-size: 0.85rem;
  color: var(--text);
  font-weight: 600;
}

/* Status badge */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.8rem;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
}

.status-processing {
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  animation: statusPulse 1.5s ease-in-out infinite;
}

@keyframes statusPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

/* Progress tracker */
.success-tracker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 2rem;
  padding: 0 1rem;
}

.tracker-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.tracker-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 2px solid var(--border);
  color: var(--text-muted);
  transition: all 0.3s ease;
}

.tracker-step.completed .tracker-dot {
  background: rgba(34, 197, 94, 0.15);
  border-color: #22c55e;
  color: #22c55e;
}

.tracker-step.active .tracker-dot {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  color: #fff;
  position: relative;
}

.tracker-pulse {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  animation: trackerPulse 1.5s ease-out infinite;
}

@keyframes trackerPulse {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(1.5); opacity: 0; }
}

.tracker-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
}

.tracker-step.completed .tracker-label {
  color: #22c55e;
}

.tracker-step.active .tracker-label {
  color: var(--accent);
  font-weight: 600;
}

.tracker-line {
  flex: 1;
  height: 2px;
  background: var(--border);
  margin: 0 0.5rem;
  position: relative;
  top: -14px;
  max-width: 60px;
}

.tracker-line.active {
  background: linear-gradient(90deg, #22c55e, var(--accent));
}

/* Live counter */
.success-live-counter {
  background: linear-gradient(135deg, rgba(108,99,255,0.08), rgba(62,207,207,0.05));
  border: 1px solid rgba(108,99,255,0.15);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 2rem;
}

.live-counter-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-sub);
  font-weight: 500;
  margin-bottom: 0.75rem;
}

.live-counter-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  animation: live-pulse 1.8s ease-in-out infinite;
}

.live-counter-display {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.counter-num {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-variant-numeric: tabular-nums;
}

.counter-label {
  font-size: 0.85rem;
  color: var(--text-sub);
  font-weight: 500;
}

.counter-progress {
  height: 4px;
  background: var(--surface);
  border-radius: 100px;
  overflow: hidden;
}

.counter-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 100px;
  transition: width 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Actions */
.success-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.success-actions .btn {
  padding: 0.75rem 1.5rem;
}

.btn-glow {
  position: relative;
}

.btn-glow::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  filter: blur(12px);
  opacity: 0;
  z-index: -1;
  transition: opacity 0.3s;
}

.btn-glow:hover::after {
  opacity: 0.5;
}

/* Trust badges */
.success-trust {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.trust-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Floating orbs */
.floating-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(60px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.3;
}

.orb-1 {
  width: 300px;
  height: 300px;
  background: var(--accent);
  top: -100px;
  left: -100px;
  animation: floatOrb 20s ease-in-out infinite;
}

.orb-2 {
  width: 250px;
  height: 250px;
  background: var(--accent-2);
  bottom: -80px;
  right: -80px;
  animation: floatOrb 25s ease-in-out infinite reverse;
}

.orb-3 {
  width: 200px;
  height: 200px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  top: 50%;
  left: 50%;
  animation: floatOrb 30s ease-in-out infinite;
}

@keyframes floatOrb {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(30px, -30px) scale(1.1); }
  50% { transform: translate(-20px, 20px) scale(0.9); }
  75% { transform: translate(20px, 30px) scale(1.05); }
}

/* Responsive */
@media (max-width: 600px) {
  .success-page {
    padding: 1rem;
    align-items: flex-start;
    padding-top: 3rem;
  }

  .success-card {
    padding: 2rem 1.5rem;
  }

  .success-title {
    font-size: 1.5rem;
  }

  .success-icon-wrap {
    width: 80px;
    height: 80px;
  }

  .success-checkmark {
    width: 60px;
    height: 60px;
  }

  .counter-num {
    font-size: 2rem;
  }

  .success-actions {
    flex-direction: column;
  }

  .success-actions .btn {
    width: 100%;
  }

  .tracker-line {
    max-width: 30px;
  }
}

@media (max-width: 400px) {
  .success-card {
    padding: 1.5rem 1.25rem;
  }

  .success-details {
    padding: 1rem;
  }

  .success-detail-row {
    flex-direction: column;
    gap: 0.25rem;
    text-align: center;
  }
}