/* ==========================================================================
   Wallet + top-up sheet.  (views/wallet.js)
   ========================================================================== */

.wallet-heading {
  padding-inline: var(--space-1);
  color: var(--ink-2);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-snug);
}

.wallet-month {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}

/* ---- 14-day chart -------------------------------------------------------- */

.wallet-chart-wrap {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin: 0;
}

.wallet-chart {
  display: grid;
  grid-template-columns: repeat(14, minmax(0, 1fr));
  align-items: end;
  gap: 4px;
  height: 128px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.wallet-day {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-end;
  gap: 4px;
  height: 100%;
}

.wallet-bar {
  --h: 0;
  height: calc(var(--h) * (100% - 20px));
  min-height: 4px;
  border-radius: 4px 4px 2px 2px;
  background: var(--accent);
}

.wallet-bar.is-zero {
  background: var(--surface-2);
}

.wallet-day-label {
  color: var(--ink-3);
  font-size: var(--text-xs);
  line-height: 16px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.wallet-day-label.is-faint {
  visibility: hidden;
}

@media (min-width: 480px) {
  .wallet-day-label.is-faint {
    visibility: visible;
  }
}

/* ---- Lists --------------------------------------------------------------- */

.wallet-amount {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-weight: var(--weight-semibold);
}

.wallet-plus {
  color: var(--success);
}

.wallet-tx-topup {
  background: var(--success-soft);
  color: var(--success);
}

.wallet-tx-bonus {
  background: var(--warm-soft);
  color: var(--warm-strong);
}

/* ---- Top-up sheet -------------------------------------------------------- */

.wallet-plans {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: var(--space-2);
}

.wallet-plan {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 72px;
  padding: var(--space-2);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  transition:
    border-color var(--dur-2) var(--ease-soft),
    background-color var(--dur-2) var(--ease-soft),
    transform var(--dur-2) var(--ease-out);
}

.wallet-plan:active {
  transform: scale(0.97);
}

.wallet-plan[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.wallet-plan-time {
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
}

.wallet-plan-price {
  color: var(--ink-2);
  font-size: var(--text-sm);
}

.wallet-plan[aria-pressed="true"] .wallet-plan-price {
  color: var(--accent-strong);
}

@media (hover: hover) and (pointer: fine) {
  .wallet-plan:hover {
    border-color: var(--line-strong);
  }
}

.wallet-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
}

.wallet-pay-amount {
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  text-align: center;
}

.wallet-qr {
  display: grid;
  place-items: center;
  width: min(100%, 264px);
  aspect-ratio: 1;
  margin-inline: auto;
  padding: var(--space-3);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-1);
}

.wallet-qr img {
  width: 100%;
  height: auto;
  image-rendering: pixelated;
}

.wallet-qr-mock {
  align-content: center;
  border: 2px dashed var(--line-strong);
  box-shadow: none;
  color: var(--ink-2);
  text-align: center;
}

.wallet-wait {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  color: var(--ink-2);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}

.wallet-banks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.wallet-bank {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  min-height: var(--tap);
  padding: var(--space-2);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  color: var(--ink);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-align: center;
  text-decoration: none;
}

.wallet-bank img {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
}

/* bank buttons matter on phones; on desktop the QR is the way */
@media (min-width: 960px) and (hover: hover) {
  .wallet-banks-wrap {
    display: none;
  }
}

.wallet-done {
  align-items: center;
  padding-block: var(--space-4);
  text-align: center;
}

.wallet-done-mark {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--success-soft);
  color: var(--success);
}

@media (prefers-reduced-motion: no-preference) {
  .wallet-done-mark {
    animation: wallet-pop var(--dur-5) var(--ease-out);
  }
}

@keyframes wallet-pop {
  from {
    opacity: 0;
    transform: scale(0.95);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.wallet-norefund {
  color: var(--ink-2);
  font-size: var(--text-sm);
  text-align: center;
}
