/* ============================================================
   BotBee Top-Up — Customer UI
   ============================================================ */
:root {
  --primary:       #4f46e5;
  --primary-h:     #3730a3;
  --primary-light: #eef2ff;
  --success:       #10b981;
  --warning:       #f59e0b;
  --error:         #ef4444;
  --bg:            #f0f2ff;
  --card:          #ffffff;
  --border:        #e2e8f0;
  --text:          #1e293b;
  --muted:         #64748b;
  --radius:        16px;
  --shadow:        0 8px 32px rgba(79,70,229,.1);
}

*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html{scroll-behavior:smooth}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.6;
}

/* ── Layout ─────────────────────────────────────────────── */
.page-wrapper{display:flex;flex-direction:column;min-height:100vh}

.site-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
  padding: 0 20px;
  height: 60px;
  display: flex;
  align-items: center;
  box-shadow: 0 1px 8px rgba(0,0,0,.05);
}
.header-inner {
  max-width: 520px; width: 100%; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
}
.logo { display: flex; align-items: center; gap: 10px; }
.logo-dot { width: 28px; height: 28px; background: var(--primary); border-radius: 8px; }
.logo-text { font-weight: 800; font-size: 18px; letter-spacing: -.4px; }
.logo-img  { height: 36px; object-fit: contain; }
.header-badge {
  font-size: 11px; font-weight: 600; letter-spacing: .5px;
  background: var(--primary-light); color: var(--primary);
  padding: 4px 12px; border-radius: 20px;
}

.main-wrap {
  flex: 1; padding: 32px 16px 48px;
  display: flex; flex-direction: column; align-items: center; gap: 20px;
}

.site-footer {
  text-align: center; padding: 20px;
  color: var(--muted); font-size: 13px;
  border-top: 1px solid var(--border);
}

/* ── Step Indicator ──────────────────────────────────────── */
.step-bar {
  display: flex; align-items: center; gap: 0;
  max-width: 520px; width: 100%;
}
.step {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  flex: 0 0 auto;
}
.step-num {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--border); color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  transition: all .3s;
}
.step-label { font-size: 11px; color: var(--muted); font-weight: 500; }
.step.active .step-num { background: var(--primary); color: #fff; box-shadow: 0 0 0 4px var(--primary-light); }
.step.active .step-label { color: var(--primary); font-weight: 700; }
.step.done .step-num { background: var(--success); color: #fff; }
.step-line { flex: 1; height: 2px; background: var(--border); margin: 0 8px; margin-bottom: 18px; }

/* ── Card ────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px 28px;
  width: 100%; max-width: 520px;
}
.card.hide { display: none; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
.anim-in { animation: fadeUp .45s cubic-bezier(.16,1,.3,1) both; }

/* ── Hero ────────────────────────────────────────────────── */
.card-hero { text-align: center; margin-bottom: 28px; }
.hero-icon { font-size: 44px; margin-bottom: 12px; display: block; animation: pulse 2s infinite; }
@keyframes pulse { 0%,100%{transform:scale(1)} 50%{transform:scale(1.08)} }
.card-hero h1 { font-size: 22px; font-weight: 800; margin-bottom: 6px; }
.card-hero p  { color: var(--muted); font-size: 14px; }

/* ── Form ────────────────────────────────────────────────── */
.field-group { margin-bottom: 16px; }
.field-group label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; color: var(--text); }
.field-hint   { font-size: 12px; color: var(--muted); margin-top: 4px; display: block; }

.input-wrap { position: relative; }
.input-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-size: 15px; pointer-events: none;
}
.input-wrap input { padding-left: 36px; }

.field-group input,
.field-group select {
  width: 100%; padding: 12px 14px;
  border: 1.5px solid var(--border); border-radius: 10px;
  font-size: 15px; color: var(--text); background: #fff;
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}
.field-group input:focus,
.field-group select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 22px; border-radius: 10px;
  font-size: 15px; font-weight: 700; cursor: pointer;
  border: none; text-decoration: none;
  transition: all .15s;
}
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn-full { width: 100%; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-h); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(79,70,229,.3); }
.btn-secondary { background: var(--primary-light); color: var(--primary); }
.btn-secondary:hover:not(:disabled) { background: #ddd9fc; }
.btn-pay {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  color: #fff; font-size: 16px; padding: 15px 24px;
  box-shadow: 0 4px 20px rgba(79,70,229,.35);
}
.btn-pay:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(79,70,229,.4); }
.btn-back {
  background: none; border: none; color: var(--muted);
  font-size: 14px; cursor: pointer; padding: 0; margin-bottom: 20px;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-back:hover { color: var(--text); }
.btn-link {
  background: none; border: none; color: var(--primary);
  font-size: 13px; cursor: pointer; text-decoration: underline;
}
.btn-link:disabled { color: var(--muted); text-decoration: none; cursor: default; }

.pay-lock { font-size: 16px; }
.pay-methods {
  display: flex; gap: 8px; justify-content: center; margin-top: 10px;
  flex-wrap: wrap;
}
.pay-methods span {
  font-size: 11px; color: var(--muted);
  background: #f8faff; border: 1px solid var(--border);
  padding: 3px 10px; border-radius: 20px;
}

/* ── Spinner ─────────────────────────────────────────────── */
.btn-spinner {
  width: 18px; height: 18px;
  border: 2.5px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: none;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Alerts ──────────────────────────────────────────────── */
.alert {
  padding: 12px 16px; border-radius: 10px;
  font-size: 14px; line-height: 1.5; margin-top: 12px;
}
.alert.hide { display: none; }
.alert-error   { background: #fef2f2; color: #b91c1c; border: 1px solid #fca5a5; }
.alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fcd34d; }
.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #86efac; }

/* ── User Card ───────────────────────────────────────────── */
.user-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--primary-light); border-radius: 12px;
  padding: 16px; margin-bottom: 20px;
  border: 1px solid #c7d2fe;
}
.user-avatar {
  width: 46px; height: 46px; background: var(--primary); color: #fff;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 800; flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; }
.user-name  { font-weight: 700; font-size: 15px; }
.user-email { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan-badge {
  font-size: 11px; font-weight: 700; padding: 4px 12px;
  border-radius: 20px; white-space: nowrap; flex-shrink: 0;
}
.badge-ok  { background: #dcfce7; color: #15803d; }
.badge-exp { background: #fee2e2; color: #b91c1c; }

/* ── Credits Grid ────────────────────────────────────────── */
.credits-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  margin-bottom: 20px;
}
.credit-box {
  background: #f8faff; border: 1px solid var(--border);
  border-radius: 12px; padding: 14px 10px; text-align: center;
}
.credit-icon { font-size: 18px; margin-bottom: 6px; }
.total-icon { color: #6366f1; }
.used-icon  { color: var(--error); }
.rem-icon   { color: var(--success); }
.credit-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 4px; }
.credit-value { font-size: 20px; font-weight: 800; }
.used-val { color: var(--error); }
.rem-val  { color: var(--success); }

/* ── Section Divider ─────────────────────────────────────── */
.section-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 20px 0 16px;
}
.section-divider::before,
.section-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.section-divider span { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; white-space: nowrap; }

/* ── OTP ─────────────────────────────────────────────────── */
.otp-boxes {
  display: flex; gap: 8px; justify-content: center;
  margin: 8px 0;
}
.otp-box {
  width: 48px; height: 56px; text-align: center; font-size: 22px; font-weight: 800;
  border: 2px solid var(--border); border-radius: 10px;
  outline: none; transition: all .15s; color: var(--text);
  background: #fff;
}
.otp-box:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.otp-sent-info { background: var(--primary-light); color: var(--primary); border-radius: 8px; padding: 10px 14px; font-size: 13px; margin-bottom: 14px; }
.otp-resend-row { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; font-size: 13px; }
.otp-timer { color: var(--muted); }

/* ── Verified Badge ──────────────────────────────────────── */
.verified-badge {
  display: flex; align-items: center; gap: 10px;
  background: #f0fdf4; border: 1.5px solid #86efac;
  color: #166534; border-radius: 10px;
  padding: 12px 16px; font-weight: 600; font-size: 14px;
  margin-top: 12px;
}
.verified-badge.hide { display: none; }
.verified-icon {
  width: 24px; height: 24px; background: var(--success); color: #fff;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 14px; flex-shrink: 0;
}

/* ── Plan Card ───────────────────────────────────────────── */
.plan-card {
  border: 1.5px solid #c7d2fe; border-radius: 12px; overflow: hidden;
}
.plan-card-top {
  background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
  padding: 16px 20px; display: flex; align-items: center; justify-content: space-between;
}
.plan-card-name   { font-weight: 800; font-size: 16px; color: #fff; }
.plan-card-credits { font-size: 13px; color: rgba(255,255,255,.8); margin-top: 2px; }
.plan-card-badge {
  background: rgba(255,255,255,.2); color: #fff;
  font-size: 11px; font-weight: 700; padding: 4px 12px;
  border-radius: 20px; letter-spacing: .5px;
}
.plan-pricing { padding: 16px 20px; }
.price-row {
  display: flex; justify-content: space-between;
  padding: 7px 0; font-size: 14px; color: var(--muted);
  border-bottom: 1px dashed var(--border);
}
.price-row:last-child { border-bottom: none; }
.price-total {
  font-weight: 800; font-size: 17px; color: var(--text);
  border-top: 2px solid var(--border) !important; margin-top: 4px; padding-top: 12px !important;
  border-bottom: none !important;
}

/* ── Success / Failed pages ──────────────────────────────── */
.result-icon {
  width: 72px; height: 72px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 32px; font-weight: 800; margin-bottom: 20px;
}
.success-icon { background: #dcfce7; color: var(--success); }
.error-icon   { background: #fee2e2; color: var(--error); }
.text-center { text-align: center; }

.payment-ref { font-size: 13px; color: var(--muted); margin-top: 12px; }
.payment-ref code { background: #f8faff; padding: 3px 8px; border-radius: 6px; font-size: 12px; font-family: monospace; }

/* ── Auth page ───────────────────────────────────────────── */
.auth-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--bg); }
.auth-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 40px 36px; width: 100%; max-width: 380px; }
.auth-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; }
.auth-title { font-size: 22px; font-weight: 800; margin-bottom: 24px; }

/* ── Utilities ───────────────────────────────────────────── */
.hide { display: none !important; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 540px) {
  .card { padding: 24px 16px; }
  .credits-grid { gap: 8px; }
  .credit-value { font-size: 17px; }
  .otp-box { width: 40px; height: 48px; font-size: 18px; }
}
@media (max-width: 360px) {
  .otp-boxes { gap: 5px; }
  .otp-box { width: 36px; height: 44px; font-size: 16px; }
  .step-label { display: none; }
}
