:root {
  --bg: #0b0e14;
  --surface: rgba(255, 255, 255, 0.05);
  --surface-hover: rgba(255, 255, 255, 0.09);
  --border: rgba(255, 255, 255, 0.1);
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --accent: #22c55e;
  --accent-glow: rgba(34, 197, 94, 0.35);

  /* Dynamic Card Theme Variables */
  --card-bg-1: #1e293b;
  --card-bg-2: #0f172a;
  --card-accent: #eab308;
  --card-glow: rgba(148, 163, 184, 0.25);

  /* 3D Parallax Variables updated by JS */
  --rx: 0deg;
  --ry: 0deg;
  --glare-x: 50%;
  --glare-y: 50%;
  --glare-opacity: 0.22;
}

/* Bank Themes */
.card-3d[data-bank="uzcard"] {
  --card-bg-1: #2563eb;
  --card-bg-2: #1e3a8a;
  --card-accent: #60a5fa;
  --card-glow: rgba(37, 99, 235, 0.45);
}

.card-3d[data-bank="humo"] {
  --card-bg-1: #ea580c;
  --card-bg-2: #9a3412;
  --card-accent: #fbbf24;
  --card-glow: rgba(234, 88, 12, 0.45);
}

.card-3d[data-bank="visa"] {
  --card-bg-1: #059669;
  --card-bg-2: #064e3b;
  --card-accent: #34d399;
  --card-glow: rgba(5, 150, 105, 0.45);
}

.card-3d[data-bank="other"] {
  --card-bg-1: #4338ca;
  --card-bg-2: #1e1b4b;
  --card-accent: #38bdf8;
  --card-glow: rgba(99, 102, 241, 0.42);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  min-height: 100%;
  background-color: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Roboto', 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Ambient Background */
.bg-ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
  transition: background 0.8s ease;
}

.bg-orb-1 {
  width: 280px;
  height: 280px;
  top: -80px;
  left: -60px;
  background: radial-gradient(circle, var(--card-bg-1), transparent 70%);
}

.bg-orb-2 {
  width: 300px;
  height: 300px;
  bottom: 10%;
  right: -90px;
  background: radial-gradient(circle, rgba(34, 197, 94, 0.28), transparent 70%);
}

/* Main Mobile Shell */
.app-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  padding: max(14px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Top Bar */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.brand-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
  animation: pulseRing 2s infinite;
}

@keyframes pulseRing {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
  70% { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.step-counter {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

/* Progress Track */
.progress-track {
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 15%;
  border-radius: 999px;
  background: linear-gradient(90deg, #22c55e, #4ade80);
  transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Hero Copy */
.hero-copy {
  text-align: center;
  padding: 2px 4px;
}

.hero-copy h1 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 4px;
}

.hero-copy p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.35;
}

/* 3D Card Stage */
.card-stage {
  position: relative;
  width: 100%;
  padding: 6px 0 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  touch-action: pan-y;
}

.particle-canvas {
  position: absolute;
  inset: -40px -20px;
  width: calc(100% + 40px);
  height: calc(100% + 80px);
  pointer-events: none;
  z-index: 10;
}

.card-perspective {
  width: 100%;
  max-width: 360px;
  perspective: 1100px;
}

.card-3d {
  position: relative;
  width: 100%;
  aspect-ratio: 1.586 / 1;
  transform-style: preserve-3d;
  transform: rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform 0.14s ease-out;
  will-change: transform;
}

.card-3d.is-flipping {
  animation: cardFlipUnlock 1.05s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes cardFlipUnlock {
  0% {
    transform: rotateX(0deg) rotateY(0deg) scale(1);
  }
  35% {
    transform: rotateX(8deg) rotateY(180deg) scale(1.06);
  }
  75% {
    transform: rotateX(-4deg) rotateY(350deg) scale(1.03);
  }
  100% {
    transform: rotateX(var(--rx)) rotateY(360deg) scale(1);
  }
}

.card-face {
  position: absolute;
  inset: 0;
  border-radius: 20px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
  box-shadow:
    0 22px 44px -12px rgba(0, 0, 0, 0.7),
    0 0 36px -8px var(--card-glow);
  transition: box-shadow 0.6s ease;
}

.card-front {
  background: linear-gradient(135deg, var(--card-bg-1) 0%, var(--card-bg-2) 100%);
  transition: background 0.6s ease;
  display: flex;
  flex-direction: column;
  padding: 18px 20px;
}

.card-back {
  background: linear-gradient(135deg, #1e293b 0%, #090d16 100%);
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px 0;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.card-magstripe {
  width: 100%;
  height: 42px;
  background: #020617;
  margin-top: 8px;
}

.card-back-info {
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cvv-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.1);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.cvv-code {
  color: #4ade80;
}

.back-note {
  font-size: 11px;
  color: var(--text-muted);
}

/* Card surface textures & glare */
.card-noise {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.12) 1px, transparent 0);
  background-size: 18px 18px;
  opacity: 0.15;
  pointer-events: none;
}

.card-glare {
  position: absolute;
  inset: -40%;
  background:
    radial-gradient(
      circle at var(--glare-x) var(--glare-y),
      rgba(255, 255, 255, 0.5) 0%,
      rgba(255, 255, 255, 0.12) 28%,
      transparent 62%
    ),
    linear-gradient(
      115deg,
      transparent 20%,
      rgba(255, 255, 255, 0.14) 38%,
      rgba(167, 243, 208, 0.12) 48%,
      rgba(253, 230, 138, 0.14) 58%,
      transparent 75%
    );
  opacity: var(--glare-opacity);
  pointer-events: none;
  mix-blend-mode: overlay;
  transition: opacity 0.2s ease;
}

.card-border-glow {
  position: absolute;
  inset: 0;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  pointer-events: none;
}

/* Card Content (Blurred initially) */
.card-content {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  filter: blur(8px) saturate(0.8);
  transform: scale(0.98);
  transition: filter 0.65s cubic-bezier(0.22, 1, 0.36, 1), transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

.card-3d.is-unlocked .card-content {
  filter: blur(0px) saturate(1.05);
  transform: scale(1);
}

.card-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-chip {
  width: 38px;
  height: 28px;
  border-radius: 6px;
  background: linear-gradient(135deg, #fde68a 0%, #d97706 100%);
  border: 1px solid rgba(255, 255, 255, 0.4);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  padding: 4px;
  opacity: 0.92;
}

.card-chip span {
  border: 1px solid rgba(120, 53, 15, 0.35);
  border-radius: 2px;
}

.card-bank-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.bank-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--card-accent);
}

.card-balance-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.balance-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.72);
}

.balance-value {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 27px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.05;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
  font-variant-numeric: tabular-nums;
}

.balance-value .currency {
  font-size: 18px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
  margin-top: 2px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.22);
  border: 1px solid rgba(74, 222, 128, 0.55);
  color: #bbf7d0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.4s ease 0.45s, transform 0.4s ease 0.45s;
}

.card-3d.is-unlocked .status-pill {
  opacity: 1;
  transform: translateY(0);
}

.card-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-number {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: rgba(255, 255, 255, 0.8);
}

.card-network {
  display: flex;
  align-items: center;
}

.card-network .circle {
  width: 20px;
  height: 20px;
  border-radius: 50%;
}

.card-network .c1 {
  background: rgba(239, 68, 68, 0.85);
}

.card-network .c2 {
  background: rgba(245, 158, 11, 0.85);
  margin-left: -8px;
}

/* Lock Overlay */
.lock-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  background: rgba(9, 13, 22, 0.42);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.card-3d.is-unlocked .lock-overlay {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.lock-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  padding: 14px 20px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
  transition: transform 0.25s ease;
}

.lock-badge.is-shaking {
  animation: lockShake 0.4s ease;
}

@keyframes lockShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-5px) rotate(-3deg); }
  40% { transform: translateX(5px) rotate(3deg); }
  60% { transform: translateX(-4px) rotate(-2deg); }
  80% { transform: translateX(4px) rotate(2deg); }
}

.lock-icon-wrap {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fbbf24;
}

.lock-svg {
  width: 22px;
  height: 22px;
}

.lock-text {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
}

.lock-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.tilt-hint {
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: rgba(148, 163, 184, 0.75);
}

/* Controls Panel (3 Tap Steps) */
.controls-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.controls-panel.is-hidden {
  display: none;
}

.summary-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.summary-strip.is-hidden {
  display: none;
}

.summary-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.14);
  border: 1px solid rgba(34, 197, 94, 0.35);
  color: #bbf7d0;
  font-size: 11.5px;
  font-weight: 700;
}

.step-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  transition: opacity 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}

.step-block:not(.is-active) {
  display: none;
}

.step-block.is-locked {
  opacity: 0.42;
  pointer-events: none;
}

.step-block.is-active {
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.065);
}

.step-block.is-done {
  border-color: rgba(34, 197, 94, 0.35);
}

.step-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.step-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-block.is-done .step-num {
  background: #22c55e;
  color: #052e16;
}

.step-question {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.step-selected-tag {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  color: #4ade80;
}

/* Chips */
.chips-grid {
  display: grid;
  gap: 8px;
}

.chips-bank {
  grid-template-columns: repeat(2, 1fr);
}

.chips-amount {
  grid-template-columns: repeat(3, 1fr);
}

.chips-single {
  grid-template-columns: 1fr;
}

.chip-btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(15, 23, 42, 0.65);
  color: var(--text);
  border-radius: 12px;
  min-height: 44px;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.chip-btn:active {
  transform: scale(0.96);
}

.chip-btn.is-selected {
  background: rgba(34, 197, 94, 0.16);
  border-color: #22c55e;
  color: #ffffff;
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.4);
}

.chip-confirm {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(16, 185, 129, 0.12));
  border-color: rgba(34, 197, 94, 0.45);
  color: #dcfce7;
}

.chip-swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.swatch-uzcard { background: #2563eb; }
.swatch-humo { background: #ea580c; }
.swatch-visa { background: #059669; }
.swatch-other { background: #6366f1; }

/* CTA Section */
.cta-section {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  animation: fadeUpIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.cta-section.is-visible {
  display: flex;
}

@keyframes fadeUpIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.cta-summary {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.cta-badge {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.14);
  border: 1px solid rgba(34, 197, 94, 0.35);
  color: #4ade80;
  font-size: 11px;
  font-weight: 700;
}

.cta-desc {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 320px;
  line-height: 1.4;
}

.reserve-timer {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
  padding: 4px 10px;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}

.reserve-timer strong {
  color: #fbbf24;
  font-weight: 700;
}

.reserve-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fbbf24;
}

.cta-button {
  position: relative;
  width: 100%;
  min-height: 56px;
  padding: 14px 20px;
  border-radius: 16px;
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: #042f14;
  text-decoration: none;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  overflow: hidden;
  box-shadow:
    0 12px 28px -6px rgba(34, 197, 94, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.cta-button:active {
  transform: scale(0.98);
}

.cta-btn-shine {
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  transform: skewX(-20deg);
  animation: btnShine 2.8s infinite;
}

@keyframes btnShine {
  0% { left: -100%; }
  35%, 100% { left: 160%; }
}

.reset-link {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  text-decoration: underline;
  cursor: pointer;
  padding: 4px 8px;
}

/* Offer Footer */
.offer-footer {
  margin-top: 6px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.terms-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.term-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.term-k {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.term-v {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}

.legal-note {
  font-size: 10.5px;
  line-height: 1.45;
  color: rgba(148, 163, 184, 0.72);
  text-align: center;
}
