/* Wallet / VietQR deposit modal — RC5 / TASK-WEB-003.1 */

.wallet-stats {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 768px) {
  .wallet-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1100px) {
  .wallet-stats {
    grid-template-columns: repeat(4, 1fr);
  }
}

.wallet-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(10, 22, 40, 0.65);
  backdrop-filter: blur(4px);
}

.wallet-modal.is-open {
  display: flex;
}

.wallet-modal-panel {
  width: 100%;
  max-width: 440px;
  max-height: 92vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 1rem;
  border: 1px solid #e2e8f0;
  box-shadow: 0 20px 48px rgba(15, 23, 42, 0.2);
}

.wallet-modal-head {
  padding: 1rem 1.25rem;
  background: linear-gradient(to right, #06b6d4, #0891b2);
  color: #fff;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.wallet-modal-head-text {
  min-width: 0;
  flex: 1;
}

.wallet-modal-head h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}

.wallet-modal-head-sub {
  margin-top: 0.35rem;
  font-size: 0.78rem;
  opacity: 0.95;
  line-height: 1.4;
  word-break: break-word;
}

.wallet-modal-head-sub code {
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.18);
  padding: 0.1rem 0.35rem;
  border-radius: 0.25rem;
}

.wallet-modal-close {
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 1.25rem;
  cursor: pointer;
  line-height: 1;
  flex-shrink: 0;
}

.wallet-modal-body {
  padding: 1.25rem;
}

.wallet-schema-banner {
  margin-top: 0.85rem;
  padding: 0.75rem 0.9rem;
  border-radius: 0.65rem;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  font-size: 0.85rem;
  font-weight: 700;
}

.wallet-schema-banner[hidden] {
  display: none !important;
}

.wallet-bank-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
  padding: 0.4rem 0.65rem;
  border-radius: 9999px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
  font-size: 0.8rem;
  font-weight: 700;
}

.wallet-bank-logo-img {
  display: block;
  height: 2rem;
  width: auto;
  max-width: 5.5rem;
  object-fit: contain;
  flex-shrink: 0;
}

.wallet-qr-fallback-link {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 700;
  color: #0891b2;
  text-align: center;
  width: 100%;
}

.wallet-qr-wrap.is-missing-qr .wallet-qr {
  display: none;
}

.wallet-amount-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

@media (min-width: 420px) {
  .wallet-amount-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.wallet-amount-btn {
  padding: 0.6rem 0.4rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.65rem;
  background: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  color: #0f172a;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.wallet-amount-btn:hover:not(:disabled) {
  border-color: #67e8f9;
}

.wallet-amount-btn.is-active {
  border-color: #06b6d4;
  background: #ecfeff;
  color: #0e7490;
}

.wallet-amount-btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.wallet-custom-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 1rem;
}

.wallet-custom-input {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.65rem;
  font-size: 0.9rem;
  box-sizing: border-box;
}

.wallet-custom-input:focus {
  outline: none;
  border-color: #06b6d4;
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.15);
}

.wallet-qr-wrap {
  display: flex;
  justify-content: center;
  margin: 0.25rem 0 0.85rem;
}

.wallet-qr {
  display: block;
  width: 240px;
  max-width: 100%;
  height: auto;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
}

.wallet-meta {
  font-size: 0.8125rem;
  color: #475569;
  line-height: 1.6;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  padding: 0.75rem 0.9rem;
}

.wallet-meta strong {
  color: #0a1628;
}

.wallet-code {
  font-weight: 700;
  color: #0e7490;
  word-break: break-all;
}

.wallet-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.wallet-copy-btn {
  display: inline-flex;
  align-items: center;
  margin-left: 0.35rem;
  padding: 0.15rem 0.45rem;
  border: 1px solid #a5f3fc;
  border-radius: 0.35rem;
  background: #ecfeff;
  color: #0e7490;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  line-height: 1.2;
}

.wallet-copy-btn:hover {
  background: #cffafe;
}

.wallet-status {
  margin-top: 0.75rem;
  padding: 0.7rem 0.85rem;
  border-radius: 0.65rem;
  font-size: 0.8125rem;
  font-weight: 600;
}

.wallet-status.is-pending {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #a16207;
}

.wallet-status.is-submitted {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #c2410c;
}

.wallet-status.is-processing {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
}

.wallet-status.is-completed,
.wallet-status.is-paid {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #047857;
}

.wallet-status.is-expired {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #475569;
}

.wallet-status.is-failed {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
}

.wallet-countdown.is-hidden {
  display: none;
}

.wallet-success-banner {
  margin: 0 0 0.85rem;
  padding: 0.85rem 1rem;
  border-radius: 0.75rem;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #047857;
  font-size: 0.875rem;
  line-height: 1.45;
  text-align: center;
}

.wallet-qr-wrap.is-paid {
  opacity: 0.45;
}

.wallet-countdown {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  padding: 0.55rem 0.75rem;
  border-radius: 0.65rem;
  background: #ecfeff;
  border: 1px solid #a5f3fc;
  color: #0e7490;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.wallet-countdown #mk-wallet-countdown {
  font-size: 1.25rem;
  letter-spacing: 0.04em;
}

.wallet-countdown-msg {
  font-size: 0.8rem;
  font-weight: 600;
}

.wallet-countdown.is-warn {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #c2410c;
}

.wallet-countdown.is-expired {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #475569;
}

.wallet-qr-wrap.is-expired .wallet-qr {
  filter: blur(2px) grayscale(0.4);
  opacity: 0.5;
  pointer-events: none;
}

.wallet-resume-box {
  margin-bottom: 0.25rem;
}

.wallet-toast {
  position: fixed;
  left: 50%;
  bottom: 1.25rem;
  transform: translateX(-50%) translateY(12px);
  z-index: 120;
  padding: 0.65rem 1rem;
  border-radius: 9999px;
  background: #0f2341;
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 700;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}

.wallet-toast.is-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.wallet-toast.is-error {
  background: #991b1b;
}

.wallet-toast.is-success {
  background: #15803d;
}

.wallet-toast-rc7 {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  border-radius: 0.85rem;
  padding: 0.75rem 1.1rem;
  max-width: min(92vw, 22rem);
  text-align: left;
  line-height: 1.35;
}

.wallet-toast-rc7 .wallet-toast-icon {
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 800;
}

.wallet-toast-rc7 .wallet-toast-body {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-weight: 600;
}

.wallet-toast-rc7 .wallet-toast-body strong {
  font-size: 0.875rem;
}

.wallet-toast-rc7 .wallet-toast-body span {
  font-size: 0.8125rem;
  font-weight: 500;
  opacity: 0.95;
}

.wallet-modal-panel--paid {
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.45);
}

.wallet-modal-actions.is-hidden-paid {
  display: none !important;
}

.wallet-status--pulse-success {
  animation: wallet-success-pulse 0.9s ease-in-out 2;
}

@keyframes wallet-success-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.03);
  }
}

.wallet-balance-pulse {
  animation: wallet-balance-glow 0.85s ease-out;
}

@keyframes wallet-balance-glow {
  0% {
    box-shadow: 0 0 0 0 rgba(6, 182, 212, 0.45);
  }
  100% {
    box-shadow: 0 0 0 12px rgba(6, 182, 212, 0);
  }
}

.wallet-tx-row--pending-flash {
  background: #fef9c3 !important;
  transition: background 0.35s ease;
}

.wallet-tx-row--completed {
  background: #ecfdf5 !important;
  transition: background 0.6s ease;
}

.wallet-auto-hint {
  margin: 0.65rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: #475569;
  text-align: center;
}

.wallet-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1rem;
}

.dash-btn-ghost {
  background: transparent;
  border: none;
  color: #0891b2;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0.5rem;
}

.dash-btn-ghost:hover {
  text-decoration: underline;
}

.license-success-key {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.95rem;
  font-weight: 700;
  word-break: break-all;
  padding: 0.85rem;
  background: #f8fafc;
  border: 1px dashed #94a3b8;
  border-radius: 0.65rem;
  text-align: center;
  margin: 0.75rem 0;
}

/* Fallback buttons if dashboard.css not present (proof pages) */
.wallet-modal .dash-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1rem;
  border-radius: 0.65rem;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  box-sizing: border-box;
}

.wallet-modal .dash-btn-primary {
  background: #0891b2;
  color: #fff;
}

.wallet-modal .dash-btn-primary:hover {
  background: #0e7490;
}

.wallet-modal .dash-btn-outline {
  background: #fff;
  border-color: #cbd5e1;
  color: #334155;
}

.wallet-modal .dash-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

@media (max-width: 480px) {
  .wallet-modal {
    padding: 0.5rem;
    align-items: flex-end;
  }

  .wallet-modal-panel {
    max-height: 94vh;
    border-radius: 1rem 1rem 0.5rem 0.5rem;
  }

  .wallet-qr {
    width: 200px;
  }
}
