:root {
  --bg: #0a0a0b;
  --surface: #111113;
  --surface-2: #17171a;
  --border: #232327;
  --border-hover: #34343a;
  --text: #ededf0;
  --text-dim: #8b8b93;
  --text-faint: #5c5c64;
  --accent: #5b6ef8;
  --accent-hover: #7386ff;
  --accent-soft: rgba(91, 110, 248, 0.14);
  --good: #3fb950;
  --good-soft: rgba(63, 185, 80, 0.14);
  --warn: #d29922;
  --warn-soft: rgba(210, 153, 34, 0.14);
  --bad: #f85149;
  --bad-soft: rgba(248, 81, 73, 0.14);
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "SF Mono", "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 900px 500px at 15% -10%, rgba(91, 110, 248, 0.10), transparent 60%),
    radial-gradient(ellipse 700px 500px at 100% 0%, rgba(63, 185, 80, 0.06), transparent 55%);
  color: var(--text);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a { color: inherit; }

::selection { background: var(--accent-soft); }

/* ---------- Layout ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 10, 11, 0.85);
  backdrop-filter: blur(10px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), #8f6ff8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.balance-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 13px;
}

.balance-pill .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 0 3px var(--good-soft);
}

.container {
  max-width: 880px;
  margin: 0 auto;
  padding: 40px 24px 100px;
}

.page-head {
  margin-bottom: 32px;
}

.page-head .eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent-hover);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.page-head h1 {
  font-size: 26px;
  margin: 0 0 6px;
  letter-spacing: -0.02em;
}

.page-head p {
  color: var(--text-dim);
  margin: 0;
  font-size: 14.5px;
  line-height: 1.5;
}

/* ---------- Stepper ---------- */

.stepper {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.step-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px 6px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 12.5px;
  color: var(--text-faint);
  transition: all 0.15s ease;
}

.step-chip .num {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 10.5px;
}

.step-chip.active {
  border-color: var(--accent);
  color: var(--text);
  background: var(--accent-soft);
}

.step-chip.active .num {
  background: var(--accent);
  color: #fff;
}

.step-chip.done {
  color: var(--good);
  border-color: rgba(63, 185, 80, 0.35);
}

.step-chip.done .num {
  background: var(--good);
  color: #06210b;
}

.step-sep {
  width: 14px;
  height: 1px;
  background: var(--border);
}

/* ---------- Cards / grids ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 18px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.1s ease, background 0.15s ease;
  text-align: center;
}

.tile:hover {
  border-color: var(--border-hover);
  background: var(--surface-2);
}

.tile.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.tile img {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  object-fit: contain;
  background: #fff1;
}

.tile .tile-name {
  font-size: 13px;
  font-weight: 500;
}

.list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.list-row:hover {
  border-color: var(--border-hover);
  background: var(--surface-2);
}

.list-row.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.list-row-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.list-row-left img {
  width: 22px;
  height: 16px;
  object-fit: cover;
  border-radius: 3px;
  flex-shrink: 0;
}

.list-row-name {
  font-size: 14px;
  font-weight: 500;
}

.list-row-meta {
  font-size: 12px;
  color: var(--text-faint);
  font-family: var(--font-mono);
}

.list-row-price {
  font-family: var(--font-mono);
  font-size: 13.5px;
  color: var(--good);
  white-space: nowrap;
}

.list-row-price.out {
  color: var(--bad);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: var(--font-sans);
}

.btn:hover { border-color: var(--border-hover); }

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-danger {
  background: transparent;
  border-color: rgba(248, 81, 73, 0.4);
  color: var(--bad);
}

.btn-danger:hover {
  background: var(--bad-soft);
  border-color: var(--bad);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-dim);
}

.btn-ghost:hover {
  background: var(--surface-2);
  color: var(--text);
}

.actions-row {
  display: flex;
  gap: 10px;
  margin-top: 22px;
}

/* ---------- Order result ---------- */

.order-card {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.order-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.order-service {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-dim);
}

.order-service img {
  width: 22px;
  height: 22px;
  border-radius: 6px;
}

.status-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.status-badge.received,
.status-badge.pending { background: var(--warn-soft); color: var(--warn); }
.status-badge.completed,
.status-badge.done { background: var(--good-soft); color: var(--good); }
.status-badge.canceled,
.status-badge.expiring,
.status-badge.expired { background: var(--bad-soft); color: var(--bad); }

.phone-number {
  font-family: var(--font-mono);
  font-size: 32px;
  font-weight: 600;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 12px;
}

.copy-btn {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-dim);
  border-radius: var(--radius-sm);
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  flex-shrink: 0;
}

.copy-btn:hover { color: var(--text); border-color: var(--border-hover); }

.otp-box {
  border: 1px dashed var(--border-hover);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 66px;
}

.otp-box.waiting {
  color: var(--text-faint);
  font-size: 13px;
}

.otp-code {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 700;
  color: var(--good);
  letter-spacing: 0.08em;
}

.otp-msg {
  font-size: 12px;
  color: var(--text-faint);
  margin-top: 4px;
  white-space: pre-line;
}

.spinner {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid var(--border-hover);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-faint);
  font-family: var(--font-mono);
}

/* ---------- Misc ---------- */

.empty {
  text-align: center;
  padding: 50px 20px;
  color: var(--text-faint);
  font-size: 13.5px;
}

.error-banner {
  background: var(--bad-soft);
  border: 1px solid rgba(248, 81, 73, 0.35);
  color: #ffb4af;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 18px;
}

.search-input {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 13.5px;
  margin-bottom: 14px;
  font-family: var(--font-sans);
}

.search-input:focus {
  outline: none;
  border-color: var(--accent);
}

.skeleton {
  border-radius: var(--radius);
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 37%, var(--surface) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  height: 52px;
}

@keyframes shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 13px;
  cursor: pointer;
}

.history-item:hover { border-color: var(--border-hover); }

.history-item-left {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.history-item-num {
  font-family: var(--font-mono);
  font-size: 13.5px;
}

.history-item-sub {
  color: var(--text-faint);
  font-size: 11.5px;
}

.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.tab {
  padding: 10px 4px;
  margin-right: 20px;
  font-size: 13.5px;
  color: var(--text-faint);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease;
}

.tab.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

@media (max-width: 560px) {
  .container { padding: 24px 16px 90px; }
  .phone-number { font-size: 24px; }
  .topbar { padding: 12px 16px; }
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- Login overlay ---------- */

.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 900px 500px at 15% -10%, rgba(91, 110, 248, 0.14), transparent 60%),
    radial-gradient(ellipse 700px 500px at 100% 100%, rgba(63, 185, 80, 0.08), transparent 55%);
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 340px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 28px;
}

.login-card h2 {
  margin: 0 0 8px;
  font-size: 19px;
  letter-spacing: -0.01em;
}

.login-card p {
  margin: 0 0 22px;
  color: var(--text-dim);
  font-size: 13.5px;
  line-height: 1.5;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px 5px 5px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  font-size: 12.5px;
}

.user-badge img {
  width: 22px;
  height: 22px;
  border-radius: 50%;
}

/* ---------- Auth checking spinner (inside login card) ---------- */

.auth-checking {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-faint);
  margin-bottom: 14px;
}

/* ---------- Sub-tabs (Riwayat) ---------- */

.subtabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}

.subtab {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 12.5px;
  color: var(--text-dim);
  cursor: pointer;
}

.subtab.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--text);
}

/* ---------- PPOB product grid ---------- */

.product-tile {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.product-tile:hover {
  border-color: var(--border-hover);
  background: var(--surface-2);
}

.product-tile.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.product-tile img {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  object-fit: contain;
  background: #fff1;
}

.product-tile .p-name {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
}

.product-tile .p-note {
  font-size: 11px;
  color: var(--text-faint);
}

.product-tile .p-price {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--good);
  margin-top: 2px;
}

.category-pill {
  display: inline-block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-faint);
  width: fit-content;
}

/* ---------- Deposit nominal grid ---------- */

.nominal-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.nominal-btn {
  padding: 14px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 13.5px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.nominal-btn:hover {
  border-color: var(--border-hover);
  background: var(--surface-2);
}

.nominal-btn.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-hover);
}

.qr-card {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}

.qr-card img.qr-image {
  width: 220px;
  height: 220px;
  border-radius: var(--radius);
  background: #fff;
  padding: 10px;
}

.qr-amount {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 700;
}

.qr-meta-row {
  display: flex;
  justify-content: space-between;
  width: 100%;
  font-size: 12.5px;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.qr-countdown {
  font-size: 12px;
  color: var(--text-faint);
}

/* ---------- Modal (profile) ---------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  padding: 20px;
}

.modal-card {
  width: 100%;
  max-width: 340px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.profile-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  margin-bottom: 18px;
}

.profile-header img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2px solid var(--border);
}

.profile-header .p-name {
  font-size: 16px;
  font-weight: 600;
}

.profile-header .p-email {
  font-size: 12.5px;
  color: var(--text-faint);
}

.profile-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.profile-row:last-of-type {
  border-bottom: none;
}

.profile-row .label {
  color: var(--text-dim);
}

.profile-row .value {
  font-family: var(--font-mono);
  font-size: 12.5px;
  text-align: right;
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}