:root {
  --bg-void: #030305;
  --bg-deep: #07070b;
  --bg-base: #0c0c12;
  --bg-elevated: #12121a;
  --bg-card: rgba(16, 16, 24, 0.75);
  --bg-glass: rgba(12, 12, 18, 0.72);
  --text-primary: #fafafa;
  --text-secondary: #9b9bb0;
  --text-muted: #5c5c72;
  --brand: #ea0027;
  --brand-soft: #ff2d4d;
  --brand-deep: #a8001c;
  --brand-glow: rgba(234, 0, 39, 0.5);
  --brand-mist: rgba(234, 0, 39, 0.1);
  --violet: #6d5cff;
  --gold: #f5c542;
  --success: #34d399;
  --border: rgba(255, 255, 255, 0.065);
  --border-strong: rgba(255, 255, 255, 0.12);
  --border-brand: rgba(234, 0, 39, 0.35);
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 28px;
  --radius-xl: 40px;
  --radius-full: 9999px;
  --shadow-sm: 0 2px 12px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 16px 48px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 32px 100px rgba(0, 0, 0, 0.6);
  --shadow-brand: 0 16px 50px var(--brand-glow);
  --font: "Poppins", system-ui, -apple-system, sans-serif;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --pad: 16px;
  --tap: 52px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  font-size: 16.5px;
  line-height: 1.65;
  color: var(--text-primary);
  background: var(--bg-void);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}
::selection { background: var(--brand); color: #fff; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }

.page-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 90% 55% at 50% -15%, rgba(234, 0, 39, 0.22), transparent 55%),
    radial-gradient(ellipse 40% 35% at 95% 20%, rgba(109, 92, 255, 0.1), transparent 50%),
    radial-gradient(ellipse 35% 30% at 5% 80%, rgba(234, 0, 39, 0.06), transparent 45%),
    var(--bg-void);
}
.page-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 60% at 50% 40%, transparent 30%, rgba(0, 0, 0, 0.55) 100%);
}
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(ellipse 65% 55% at 50% 20%, black, transparent);
  -webkit-mask-image: radial-gradient(ellipse 65% 55% at 50% 20%, black, transparent);
}

.topbar, main, footer { position: relative; z-index: 1; }
.topbar {
  display: flex;
  align-items: center;
  max-width: 720px;
  margin: 0 auto;
  padding: calc(16px + env(safe-area-inset-top)) var(--pad) 8px;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  color: inherit;
}
.brand img.wordmark {
  height: 38px;
  width: auto;
}
.brand img.mark-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}
.brand strong {
  display: block;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.brand small {
  display: block;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.2;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 8px var(--pad) 96px;
}
footer {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 var(--pad) calc(24px + env(safe-area-inset-bottom));
  color: var(--text-muted);
  font-size: 13px;
}

.hero h1, .redirect-card h1, .simple-pay .pay-info {
  font-weight: 800;
  letter-spacing: -0.04em;
}
.hero h1, .redirect-card h1 {
  font-size: clamp(26px, 7vw, 40px);
  line-height: 1.08;
  margin: 8px 0 10px;
}
.hero.tight h1 { font-size: clamp(22px, 6.5vw, 32px); }
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 0;
  color: var(--brand-soft);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 700;
}
.kicker::before {
  content: "";
  width: 22px;
  height: 2px;
  background: linear-gradient(90deg, var(--brand), transparent);
  border-radius: 2px;
}
.lede { color: var(--text-secondary); font-size: 15px; max-width: 36em; }

.card, .product-card, .simple-pay, .receipt {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.split, .checkout-split, .product-grid, .grid-2, .kv {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-top: 8px;
}
.region-bar { margin: 8px 0 16px; }

.product-card.featured {
  border-color: var(--border-brand);
  box-shadow: var(--shadow-brand);
}
.product-card h2 {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.product-card .price {
  font-size: clamp(22px, 7vw, 30px);
  color: var(--brand-soft);
  margin: 0 0 8px;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.product-card.featured .price { color: var(--gold); }
.product-card ul {
  color: var(--text-secondary);
  padding-left: 18px;
  margin: 8px 0 16px;
}
.product-card .tag {
  display: inline-flex;
  align-items: center;
  margin: 0 0 8px;
  color: #ffb3c0;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 700;
  padding: 0.28rem 0.7rem;
  border-radius: var(--radius-full);
  background: rgba(234, 0, 39, 0.15);
  border: 1px solid rgba(234, 0, 39, 0.25);
}

label, fieldset { display: block; margin: 0 0 14px; }
label span, legend {
  display: block;
  margin-bottom: 6px;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 650;
  letter-spacing: 0.02em;
}
input, select, button { font: inherit; color: var(--text-primary); }
input, select {
  width: 100%;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.35);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 16px;
  min-height: var(--tap);
  appearance: none;
  transition: border-color 0.3s, box-shadow 0.3s, background 0.3s;
}
input::placeholder { color: var(--text-muted); }
input:focus, select:focus {
  outline: none;
  border-color: rgba(234, 0, 39, 0.5);
  box-shadow: 0 0 0 4px var(--brand-mist);
  background: rgba(0, 0, 0, 0.45);
}
select {
  background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%), linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 22px, calc(100% - 12px) 22px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 36px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: var(--radius-full);
  padding: 14px 22px;
  min-height: var(--tap);
  cursor: pointer;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
  position: relative;
  overflow: hidden;
  transition: transform 0.35s var(--ease-out), box-shadow 0.35s, background 0.35s, border-color 0.35s;
  -webkit-tap-highlight-color: transparent;
}
.btn.primary {
  background: linear-gradient(135deg, #ff3b5c 0%, var(--brand) 45%, var(--brand-deep) 100%);
  color: #fff;
  width: 100%;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.2) inset,
    0 8px 28px var(--brand-glow);
}
.btn.primary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, 0.22) 50%, transparent 60%);
  transform: translateX(-120%);
  transition: transform 0.6s var(--ease-out);
}
.btn.primary:hover {
  transform: translateY(-2px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.25) inset,
    0 14px 40px var(--brand-glow);
}
.btn.primary:hover::after { transform: translateX(120%); }
.btn.primary:active { transform: translateY(0) scale(0.99); }
.btn.ghost {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
  width: 100%;
  backdrop-filter: blur(10px);
}
.btn.ghost:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.22);
}
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.actions .btn { width: 100%; min-width: 0; }

.checkout-form .fineprint, .simple-pay .fineprint {
  color: var(--text-muted);
  font-size: 13px;
  margin: 10px 0 0;
  text-align: center;
}
body.bare main {
  max-width: 420px;
  padding-top: calc(36px + env(safe-area-inset-top));
}
.simple-pay { padding: 22px 20px 24px; }
.pay-logo {
  height: 38px;
  width: auto;
  margin: 0 auto 18px;
}
.simple-pay .pay-info {
  margin: 0 0 18px;
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  letter-spacing: -0.03em;
}

.banner {
  margin: 8px 0 16px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
}
.banner.error, .banner.bad {
  background: var(--brand-mist);
  color: #ffb3c0;
  border: 1px solid rgba(234, 0, 39, 0.22);
}
.banner.ok {
  background: rgba(52, 211, 153, 0.12);
  color: #a7f3d0;
}

.mark {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand-soft), var(--brand-deep));
  box-shadow: 0 0 0 4px var(--brand-mist);
}

.redirect-body {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px var(--pad);
  background: var(--bg-void);
}
.redirect-card { text-align: center; width: min(100%, 460px); position: relative; z-index: 1; }
.spinner {
  width: 42px;
  height: 42px;
  margin: 0 auto 16px;
  border: 3px solid var(--border-strong);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.desc { color: var(--text-secondary); }
.receipt { position: relative; overflow: hidden; }
.receipt.ok { border-color: rgba(52, 211, 153, 0.35); }
.receipt.bad { border-color: var(--border-brand); }
.stamp {
  position: absolute;
  right: 14px;
  top: 14px;
  border: 2px solid currentColor;
  padding: 5px 9px;
  border-radius: 8px;
  opacity: 0.55;
  transform: rotate(12deg);
  letter-spacing: 0.1em;
  font-size: 12px;
  font-weight: 700;
}
.receipt.ok .stamp { color: var(--success); }
.receipt.bad .stamp { color: var(--brand-soft); }
.receipt table, .list { width: 100%; border-collapse: collapse; }
.receipt th, .receipt td { display: block; text-align: left; padding: 0; }
.receipt th {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 12px;
  padding-top: 12px;
}
.receipt td {
  padding: 2px 0 4px;
  word-break: break-word;
}
.kicker.ok { color: var(--success); }
.kicker.ok::before { background: linear-gradient(90deg, var(--success), transparent); }
.kicker.bad { color: var(--brand-soft); }

.pill {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 650;
}
.pill.ok { color: var(--success); background: rgba(52, 211, 153, 0.12); }
.pill.bad { color: #ffb3c0; background: var(--brand-mist); }
.pill.wait { color: var(--gold); background: rgba(245, 197, 66, 0.12); }

@media (min-width: 720px) {
  :root { --pad: 24px; }
  main, .topbar, footer { max-width: 880px; }
  .product-grid, .checkout-split, .split, .grid-2 { grid-template-columns: 1fr 1fr; }
  .actions .btn { width: auto; min-width: 160px; }
  .receipt th, .receipt td { display: table-cell; padding: 8px 0; }
  .receipt th { width: 140px; font-size: inherit; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .btn.primary::after { display: none; }
}
