/* =========================================
   NOXIASOUNDS — 2-Step Checkout Wizard
   ========================================= */

/* ── Overlay ── */
.checkout-overlay {
  position: fixed;
  inset: 0;
  z-index: 700;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.checkout-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 1, 14, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: paywallFadeIn 0.3s ease both;
}

/* ── Sheet card ── */
.checkout-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 500px;
  max-height: 92vh;
  overflow-y: auto;
  border-radius: 32px 32px 0 0;
  padding: 0 0 env(safe-area-inset-bottom, 0px);
  background: rgba(10, 4, 28, 0.97);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  border: 1px solid rgba(157, 92, 255, 0.22);
  border-bottom: none;
  box-shadow: 0 -16px 60px rgba(0,0,0,0.75);
  animation: paywallSlideUp 0.42s cubic-bezier(0.32,0.72,0,1) both;
  scrollbar-width: none;
}
.checkout-card::-webkit-scrollbar { display: none; }

/* shimmer top */
.checkout-card::before {
  content: '';
  position: absolute;
  top: 0; left: 6%; right: 6%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(157,92,255,0.55), transparent);
}
/* drag handle */
.checkout-card::after {
  content: '';
  position: absolute;
  top: 12px; left: 50%; transform: translateX(-50%);
  width: 40px; height: 4px; border-radius: 4px;
  background: rgba(255,255,255,0.13);
}

.checkout-inner {
  padding: 32px 26px 36px;
}

/* ── Close button ── */
.checkout-close {
  position: absolute;
  top: 18px; right: 18px;
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.10);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); cursor: pointer;
  transition: all 0.2s ease; z-index: 2;
}
.checkout-close:hover { background: rgba(255,255,255,0.13); color: var(--text-primary); }

/* ══════════════════════════════════════════
   STEP INDICATOR
══════════════════════════════════════════ */
.checkout-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 28px;
  padding-top: 8px;
}

.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  position: relative;
}

.step-circle {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-body);
  font-size: 0.82rem; font-weight: 600;
  border: 2px solid rgba(255,255,255,0.15);
  color: var(--text-muted);
  background: rgba(255,255,255,0.04);
  transition: all 0.35s ease;
  position: relative; z-index: 1;
}

.step-circle.active {
  border-color: var(--purple-warm);
  background: linear-gradient(135deg, rgba(124,58,237,0.35), rgba(124,58,237,0.15));
  color: var(--text-primary);
  box-shadow: 0 0 18px rgba(124,58,237,0.40);
}

.step-circle.done {
  border-color: #10b981;
  background: rgba(16,185,129,0.20);
  color: #10b981;
  box-shadow: 0 0 14px rgba(16,185,129,0.30);
}

.step-label {
  font-family: var(--font-body);
  font-size: 0.68rem; font-weight: 400;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  white-space: nowrap;
  transition: color 0.3s;
}

.step-item.active .step-label  { color: var(--text-primary); font-weight: 500; }
.step-item.done   .step-label  { color: #10b981; }

/* Connecting line */
.step-connector {
  width: 64px; height: 2px;
  background: rgba(255,255,255,0.10);
  margin: 0 6px;
  margin-bottom: 22px;
  border-radius: 2px;
  position: relative;
  overflow: hidden;
}

.step-connector-fill {
  position: absolute;
  top: 0; left: 0; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--purple-warm), var(--rose-warm));
  border-radius: 2px;
  transition: width 0.5s ease;
  box-shadow: 0 0 8px rgba(157,92,255,0.5);
}

.step-connector.done .step-connector-fill { width: 100%; }

/* ── Step title ── */
.checkout-step-title {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 5vw, 1.8rem);
  font-weight: 300; color: var(--text-primary);
  margin-bottom: 6px; line-height: 1.2;
}
.checkout-step-subtitle {
  font-size: 0.83rem; color: var(--text-muted);
  font-weight: 300; margin-bottom: 22px; line-height: 1.55;
}

/* ── Step panels ── */
.checkout-step-panel { display: none; }
.checkout-step-panel.active { display: block; animation: viewIn 0.35s ease both; }

/* ══════════════════════════════════════════
   AUTH STEP (Step 1)
══════════════════════════════════════════ */
.auth-tabs {
  display: flex;
  background: rgba(255,255,255,0.04);
  border-radius: 14px; padding: 3px;
  margin-bottom: 20px;
  border: 1px solid rgba(255,255,255,0.07);
}

.auth-tab {
  flex: 1; padding: 9px 8px; border-radius: 12px;
  font-family: var(--font-body); font-size: 0.84rem; font-weight: 400;
  color: var(--text-muted); background: transparent; border: none;
  cursor: pointer; transition: all 0.25s ease; letter-spacing: 0.02em;
}

.auth-tab.active {
  background: linear-gradient(135deg, rgba(124,58,237,0.30), rgba(124,58,237,0.15));
  color: var(--text-primary);
  border: 1px solid rgba(157,92,255,0.28);
  box-shadow: 0 0 12px rgba(124,58,237,0.18);
}

/* Fields */
.co-field { position: relative; margin-bottom: 13px; }
.co-label {
  display: block; font-family: var(--font-body);
  font-size: 0.70rem; font-weight: 500; color: var(--text-muted);
  letter-spacing: 0.10em; text-transform: uppercase; margin-bottom: 6px;
}
.co-input {
  width: 100%; padding: 13px 44px 13px 16px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 14px; color: var(--text-primary);
  font-family: var(--font-body); font-size: 0.92rem; font-weight: 300;
  outline: none; transition: all 0.25s ease;
  -webkit-appearance: none; box-sizing: border-box;
}
.co-input::placeholder { color: rgba(180,160,220,0.35); }
.co-input:focus {
  border-color: rgba(157,92,255,0.55);
  background: rgba(255,255,255,0.07);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.14);
}
.co-input.error { border-color: rgba(239,68,68,0.60); }

.co-pw-toggle {
  position: absolute; right: 14px; top: 50%;
  transform: translateY(4px);
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; padding: 2px;
}

/* Error message */
.co-error-msg {
  color: #f87171; font-size: 0.78rem; font-weight: 400;
  margin-top: 8px; display: none; padding: 8px 12px;
  background: rgba(239,68,68,0.10); border-radius: 10px;
  border: 1px solid rgba(239,68,68,0.20);
}
.co-error-msg.show { display: block; }

/* Primary action button */
.co-btn-primary {
  width: 100%; padding: 15px; border-radius: 999px;
  font-family: var(--font-body); font-size: 0.95rem; font-weight: 500;
  letter-spacing: 0.04em; color: #fff; cursor: pointer; border: none;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: 6px;
  background: linear-gradient(135deg, var(--purple-warm) 0%, #5b21b6 100%);
  box-shadow: 0 0 24px rgba(124,58,237,0.50), 0 4px 16px rgba(0,0,0,0.4);
  transition: all 0.30s cubic-bezier(0.34,1.56,0.64,1);
}
.co-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 36px rgba(124,58,237,0.70), 0 6px 20px rgba(0,0,0,0.5);
}
.co-btn-primary:disabled {
  opacity: 0.55; cursor: not-allowed; transform: none;
}

/* Loading spinner inside button */
.co-btn-primary .btn-spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.30);
  border-top-color: #fff;
  animation: spin 0.65s linear infinite;
  display: none;
}
.co-btn-primary.loading .btn-spinner { display: block; }
.co-btn-primary.loading .btn-text    { display: none; }

/* ══════════════════════════════════════════
   PAYMENT STEP (Step 2)
══════════════════════════════════════════ */
.co-plan-summary {
  background: linear-gradient(135deg, rgba(124,58,237,0.12), rgba(192,132,252,0.07));
  border: 1px solid rgba(157,92,255,0.22);
  border-radius: 18px; padding: 16px 18px; margin-bottom: 20px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
}
.co-plan-name { font-family: var(--font-body); font-size: 0.92rem; font-weight: 500; color: var(--text-primary); }
.co-plan-desc { font-size: 0.74rem; color: var(--text-muted); font-weight: 300; margin-top: 2px; }
.co-plan-price {
  font-family: var(--font-display); font-size: 1.5rem; font-weight: 400;
  color: var(--rose-warm); white-space: nowrap;
}

/* Stripe Payment Element container */
#stripe-payment-element {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 14px; padding: 16px;
  margin-bottom: 16px; min-height: 80px;
}

/* Stripe element loading state */
.stripe-loading {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; padding: 24px; color: var(--text-muted); font-size: 0.85rem;
}
.stripe-loading .vl-spinner { width: 20px; height: 20px; }

/* Secure badge */
.co-secure-badge {
  display: flex; align-items: center; justify-content: center;
  gap: 6px; font-size: 0.72rem; color: var(--text-muted);
  font-weight: 300; margin-bottom: 14px; letter-spacing: 0.04em;
}
.co-secure-badge svg { color: #10b981; flex-shrink: 0; }

/* ══════════════════════════════════════════
   SUCCESS STATE
══════════════════════════════════════════ */
.co-success {
  text-align: center; padding: 20px 0 10px; display: none;
}
.co-success.show { display: block; animation: viewIn 0.5s ease both; }

.co-success-icon {
  width: 72px; height: 72px; border-radius: 50%;
  background: linear-gradient(135deg, rgba(16,185,129,0.25), rgba(16,185,129,0.10));
  border: 1px solid rgba(16,185,129,0.35);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 18px;
  color: #10b981;
  box-shadow: 0 0 28px rgba(16,185,129,0.25);
  animation: iconPulse 3s ease-in-out infinite;
}

.co-success h3 {
  font-family: var(--font-display); font-size: 1.8rem; font-weight: 300;
  color: var(--text-primary); margin-bottom: 8px;
}
.co-success p {
  font-size: 0.88rem; color: var(--text-secondary); font-weight: 300;
  line-height: 1.65; margin-bottom: 6px;
}

.co-receipt-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.82rem; color: var(--rose-warm); text-decoration: none;
  margin-top: 10px; padding: 8px 16px;
  background: rgba(192,132,252,0.10);
  border: 1px solid rgba(192,132,252,0.20);
  border-radius: 999px;
  transition: all 0.22s ease;
}
.co-receipt-link:hover {
  background: rgba(192,132,252,0.18);
  color: var(--text-primary);
}

.co-continue-btn {
  width: 100%; margin-top: 20px;
}


/* ══════════════════════════════════════════
   STRIPE PAYMENT ELEMENT SKELETON LOADER
   Shows while Stripe iframe mounts
══════════════════════════════════════════ */

.stripe-skeleton {
  padding: 4px 0 8px;
  position: relative;
  overflow: hidden;
}

/* Label placeholders */
.sk-label {
  height: 11px;
  width: 72px;
  border-radius: 6px;
  background: rgba(255,255,255,0.07);
  margin-bottom: 8px;
}

.sk-label-sm {
  width: 96px;
  margin-top: 16px;
}

/* Full-width field placeholder */
.sk-field {
  height: 44px;
  border-radius: 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 10px;
}

/* Half-width row */
.sk-row {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.sk-field-half {
  flex: 1;
  height: 44px;
  border-radius: 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
}

/* Shimmer sweep across the skeleton */
.sk-shimmer-wrap {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 12px;
  pointer-events: none;
}

.sk-shimmer {
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    100deg,
    transparent 0%,
    rgba(157,92,255,0.10) 40%,
    rgba(192,132,252,0.08) 50%,
    rgba(157,92,255,0.10) 60%,
    transparent 100%
  );
  animation: skShimmer 1.8s ease-in-out infinite;
}

@keyframes skShimmer {
  0%   { left: -100%; }
  100% { left: 160%;  }
}