:root {
  --orange: #FF7A00;
  --orange-dark: #E56A00;
  --green: #22C55E;
  --blue: #2D5BFF;
  --purple: #8B5CF6;
  --bg: #FFF9F3;
  --card: #FFFFFF;
  --text: #1A1A2E;
  --muted: #64748B;
  --radius: 20px;
  --shadow: 0 12px 40px rgba(255, 122, 0, 0.12);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  overflow-x: hidden;
}

.bg-blobs { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.blob {
  position: absolute; border-radius: 50%; filter: blur(70px); opacity: 0.42;
  animation: float 9s ease-in-out infinite;
}
.blob-1 { width: 240px; height: 240px; background: #FFB347; top: -70px; right: -50px; }
.blob-2 { width: 200px; height: 200px; background: #FFD89B; bottom: 6%; left: -60px; animation-delay: -3s; }
.blob-3 { width: 160px; height: 160px; background: #FF9F4A; top: 42%; right: 6%; animation-delay: -5s; }

@keyframes float {
  0%, 100% { transform: translate(0,0) scale(1); }
  50% { transform: translate(12px,-16px) scale(1.05); }
}

.app {
  position: relative; z-index: 1; max-width: 480px; margin: 0 auto;
  padding: 10px 16px 40px; min-height: 100dvh; display: flex; flex-direction: column;
}

.header { text-align: center; padding: 6px 0 10px; animation: fadeDown .5s ease-out; }
.brand-logo {
  width: 72px; height: 72px; border-radius: 20px; object-fit: cover;
  box-shadow: 0 10px 28px rgba(255,122,0,.4);
}
.pulse { animation: logoPulse 3s ease-in-out infinite; }
@keyframes logoPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}
.header h1 { margin: 10px 0 6px; font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; }

.user-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: #fff; border: 2px solid rgba(255,122,0,.25);
  border-radius: 999px; padding: 6px 14px; font-size: .78rem; font-weight: 600;
  color: var(--text); max-width: 100%; box-shadow: 0 4px 14px rgba(0,0,0,.06);
}
.user-chip span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.chip-icon { color: var(--orange); font-size: .9rem; }

@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-14px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-up { animation: fadeUp .55s ease-out both; }
.delay-1 { animation-delay: .12s; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Store sections */
.store-section { margin-bottom: 22px; }
.section-head {
  display: flex; align-items: center; gap: 12px; margin-bottom: 12px;
}
.section-icon {
  width: 44px; height: 44px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center; font-size: 1.3rem;
}
.auto-icon { background: rgba(45,91,255,.12); }
.focus-icon { background: rgba(34,197,94,.12); }
.section-head h2 { margin: 0; font-size: 1.15rem; font-weight: 800; }
.section-head p { margin: 2px 0 0; font-size: .8rem; color: var(--muted); }

.plan-grid { display: grid; gap: 10px; }
.plan-card {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--card); border: 2px solid #E8EDF3; border-radius: 18px;
  padding: 16px; cursor: pointer; transition: all .28s cubic-bezier(.34,1.2,.64,1);
  box-shadow: 0 4px 18px rgba(0,0,0,.05);
  animation: cardIn .45s ease-out both;
}
.plan-card:nth-child(1) { animation-delay: .05s; }
.plan-card:nth-child(2) { animation-delay: .1s; }
.plan-card:nth-child(3) { animation-delay: .15s; }
.plan-card:nth-child(4) { animation-delay: .2s; }
@keyframes cardIn {
  from { opacity: 0; transform: translateY(12px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.plan-card:active { transform: scale(.97); }
.plan-card.featured {
  border-color: var(--orange); background: linear-gradient(135deg, #FFF8F0, #fff);
  box-shadow: 0 8px 28px rgba(255,122,0,.18);
}
.plan-icon { font-size: 1.5rem; margin-right: 10px; }
.plan-left { display: flex; align-items: center; flex: 1; }
.plan-left h3 { margin: 0 0 3px; font-size: 1rem; }
.plan-left p { margin: 0; font-size: .78rem; color: var(--muted); }
.plan-price {
  font-size: 1.3rem; font-weight: 800; color: var(--orange);
  background: rgba(255,122,0,.08); padding: 8px 12px; border-radius: 12px;
}
.badge {
  display: inline-block; margin-top: 5px; padding: 3px 9px;
  background: rgba(34,197,94,.12); color: #15803D; border-radius: 999px;
  font-size: .68rem; font-weight: 700;
}

/* Focus — always visible subtypes */
.focus-type-card {
  background: var(--card); border-radius: var(--radius); margin-bottom: 14px;
  box-shadow: var(--shadow); border: 1px solid #F1F5F9; overflow: hidden;
  animation: cardIn .5s ease-out both;
}
.focus-type-card:nth-child(odd) { animation-delay: .08s; }
.focus-type-card:nth-child(even) { animation-delay: .14s; }

.type-header {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px 10px; border-bottom: 1px solid #F1F5F9;
}
.type-icon {
  width: 40px; height: 40px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; font-size: 1.2rem;
  flex-shrink: 0;
}
.type-header h3 { margin: 0; font-size: .98rem; font-weight: 800; }
.type-header span { font-size: .72rem; color: var(--muted); display: block; margin-top: 2px; }

.subtype-grid {
  display: grid; gap: 8px; padding: 10px 12px 14px;
}
.subtype-card {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 14px; border-radius: 14px; border: 2px solid #E8EDF3;
  background: linear-gradient(135deg, #FAFBFC, #fff);
  cursor: pointer; transition: all .22s ease;
}
.subtype-card:hover { border-color: rgba(255,122,0,.4); transform: translateY(-1px); }
.subtype-card.free { border-color: #86EFAC; background: linear-gradient(135deg, #F0FDF4, #fff); }
.subtype-card:active { transform: scale(.98); }
.subtype-card h4 { margin: 0 0 2px; font-size: .9rem; font-weight: 700; }
.subtype-card p { margin: 0; font-size: .72rem; color: var(--muted); }
.subtype-left { display: flex; align-items: center; gap: 10px; }
.subtype-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); flex-shrink: 0; }
.subtype-card.free .subtype-dot { background: var(--green); }
.subtype-price {
  font-weight: 800; color: var(--orange); font-size: .92rem;
  padding: 6px 10px; background: rgba(255,122,0,.08); border-radius: 10px;
}
.subtype-price.free-tag { color: var(--green); background: rgba(34,197,94,.1); }

/* Checkout */
.progress-wrap { display: flex; gap: 8px; justify-content: center; margin: 12px 0 8px; }
.dot {
  width: 10px; height: 10px; border-radius: 50%; background: #E2E8F0;
  transition: all .35s cubic-bezier(.34,1.56,.64,1);
}
.dot.active { width: 28px; border-radius: 8px; background: var(--orange); }
.dot.done { background: var(--green); }

.screen { display: none; flex: 1; flex-direction: column; animation: slideIn .38s ease; }
.screen.active { display: flex; }
@keyframes slideIn {
  from { opacity: 0; transform: translateX(16px); }
  to { opacity: 1; transform: translateX(0); }
}

.card {
  background: var(--card); border-radius: var(--radius); padding: 18px;
  box-shadow: var(--shadow); margin-bottom: 14px;
}
.card-glow { border: 1px solid rgba(255,122,0,.12); }

.price-box {
  text-align: center; padding: 22px 14px;
  background: linear-gradient(145deg, #FFF5EB, #fff);
  border: 2px solid rgba(255,122,0,.22); border-radius: var(--radius); margin-bottom: 14px;
}
.shimmer { animation: shimmer 3s ease-in-out infinite; }
@keyframes shimmer {
  0%, 100% { box-shadow: 0 8px 28px rgba(255,122,0,.12); }
  50% { box-shadow: 0 12px 36px rgba(255,122,0,.22); }
}
.price-label { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; }
.price { font-size: 2.5rem; font-weight: 800; color: var(--orange); margin: 6px 0; }
.item-name { font-size: 1.05rem; font-weight: 700; line-height: 1.4; }
.item-kind {
  display: inline-block; margin-top: 8px; padding: 5px 12px; border-radius: 999px;
  font-size: .72rem; font-weight: 700;
}
.kind-auto { background: rgba(45,91,255,.12); color: var(--blue); }
.kind-focus { background: rgba(34,197,94,.12); color: #15803D; }

.summary-note { margin: 0; font-size: .9rem; line-height: 1.55; color: var(--muted); }
.verify-row {
  display: flex; align-items: center; gap: 8px; margin-top: 12px;
  padding: 10px 12px; background: #F8FAFC; border-radius: 12px;
  font-size: .82rem; font-weight: 600; color: var(--text);
  border: 1px dashed #CBD5E1;
}
.verify-row span:first-child { color: var(--orange); }

/* Large payment method cards */
.methods-large { display: grid; gap: 12px; margin-bottom: 16px; }
.method-card {
  display: flex; align-items: center; gap: 14px;
  width: 100%; padding: 14px 16px; border: 2px solid #E8EDF3;
  border-radius: 20px; background: #fff; cursor: pointer;
  transition: all .28s cubic-bezier(.34,1.2,.64,1);
  box-shadow: 0 4px 20px rgba(0,0,0,.06);
  text-align: left; font: inherit;
}
.method-card:active { transform: scale(.98); }
.method-card.selected {
  border-color: var(--orange);
  background: linear-gradient(135deg, #FFF8F0, #fff);
  box-shadow: 0 0 0 4px rgba(255,122,0,.15), 0 8px 28px rgba(255,122,0,.12);
}
.method-img-wrap {
  width: 88px; height: 88px; flex-shrink: 0;
  border-radius: 18px; overflow: hidden;
  box-shadow: 0 6px 20px rgba(0,0,0,.12);
  background: #F8FAFC;
}
.method-img-wrap img {
  width: 100%; height: 100%; object-fit: cover;
}
.method-info { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.method-name { font-size: 1.1rem; font-weight: 800; color: var(--text); }
.method-country { font-size: .8rem; color: var(--muted); font-weight: 600; }
.method-check {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--orange); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; font-weight: 800; flex-shrink: 0;
  opacity: 0; transform: scale(.5);
  transition: all .25s cubic-bezier(.34,1.56,.64,1);
}
.method-card.selected .method-check { opacity: 1; transform: scale(1); }
.method-card:not(.selected) .method-check { background: #E2E8F0; }

.phone-field {
  display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px;
}
.phone-field span {
  font-size: .78rem; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .05em;
}
.phone-field input {
  width: 100%; padding: 14px 16px; border: 2px solid #E2E8F0;
  border-radius: 14px; font-size: 1rem; font-weight: 600;
  background: #fff; outline: none; transition: border-color .2s;
}
.phone-field input:focus { border-color: var(--orange); }

.btn-pay {
  background: linear-gradient(135deg, var(--orange), var(--orange-dark));
  color: #fff; font-size: 1.2rem; min-height: 60px;
  box-shadow: 0 10px 32px rgba(255,122,0,.45);
  letter-spacing: .02em;
}
.btn-pay:disabled {
  opacity: .45; box-shadow: none; cursor: not-allowed;
}

/* Overlays */
.overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(26,26,46,.55);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  animation: fadeOverlay .3s ease;
}
@keyframes fadeOverlay {
  from { opacity: 0; }
  to { opacity: 1; }
}
.overlay-card {
  background: #fff; border-radius: 24px; padding: 32px 28px;
  text-align: center; max-width: 320px; width: 100%;
  box-shadow: 0 24px 64px rgba(0,0,0,.2);
}
.spinner {
  width: 56px; height: 56px; margin: 0 auto 20px;
  border: 4px solid #F1F5F9;
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: spin .85s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
#loadingStatus { margin: 0; font-size: 1.05rem; font-weight: 700; color: var(--text); }
.loading-sub { margin: 8px 0 0; font-size: .85rem; color: var(--muted); }
.success-card h2 { margin: 0 0 8px; font-size: 1.4rem; color: var(--green); }
.success-icon-lg {
  width: 72px; height: 72px; margin: 0 auto 16px; border-radius: 50%;
  background: rgba(34,197,94,.15); color: var(--green);
  display: flex; align-items: center; justify-content: center;
  font-size: 36px; font-weight: 800;
}
#successTx { margin: 0; font-size: .82rem; color: var(--muted); font-weight: 600; }

/* Legacy — removed step flow */
.methods { display: none; }

.btn {
  display: flex; align-items: center; justify-content: center;
  width: 100%; padding: 16px; border: none; border-radius: 16px;
  font-size: 1.05rem; font-weight: 800; cursor: pointer; margin-top: 8px; min-height: 54px;
  transition: transform .15s, box-shadow .15s;
}
.btn:active { transform: scale(.97); }
.btn-primary {
  background: linear-gradient(135deg, var(--orange), var(--orange-dark));
  color: #fff; box-shadow: 0 8px 22px rgba(255,122,0,.38);
}
.btn-success {
  background: linear-gradient(135deg, #22C55E, #16A34A);
  color: #fff; box-shadow: 0 8px 22px rgba(34,197,94,.35);
}
.btn-ghost { background: transparent; color: var(--muted); font-size: .9rem; font-weight: 700; min-height: 42px; box-shadow: none; }
.btn-outline { background: #fff; border: 2px solid #E2E8F0; color: var(--text); }
.spacer { flex: 1; }
.section-title { font-size: .92rem; font-weight: 700; margin: 0 0 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }

.pop { animation: pop .45s cubic-bezier(.34,1.56,.64,1); }
@keyframes pop {
  from { transform: scale(0); }
  to { transform: scale(1); }
}

.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(70px);
  background: #1A1A2E; color: #fff; padding: 13px 20px; border-radius: 14px;
  font-weight: 600; font-size: .88rem; z-index: 100; opacity: 0;
  transition: all .3s ease; white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.legal-footer { text-align: center; font-size: .76rem; margin-top: 16px; padding-bottom: 8px; }
.legal-footer a { color: var(--muted); text-decoration: none; font-weight: 600; }

.hidden { display: none !important; }

.demo-badge {
  position: fixed; top: 12px; right: 12px; z-index: 50;
  background: #1A1A2E; color: #FFB347; font-size: .65rem; font-weight: 800;
  padding: 4px 10px; border-radius: 8px; letter-spacing: .1em;
  opacity: .85;
}

.highlight-card {
  animation: highlightPulse 1.2s ease-in-out 2;
  border-color: var(--orange) !important;
  box-shadow: 0 0 0 4px rgba(255,122,0,.2) !important;
}
@keyframes highlightPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}
