/* ============================================================
   payment.css — PromptPay QR checkout modal + success animation
   ============================================================ */

.payment-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, .85);
  backdrop-filter: blur(10px);
  display: grid; place-items: center;
  z-index: 10000;
  padding: 16px;
  animation: fadeIn .25s ease-out;
}

.payment-modal-card {
  background: var(--surface, #fff);
  color: var(--text, #0F172A);
  border-radius: 24px;
  padding: 28px 24px 20px;
  width: 100%; max-width: 400px;
  position: relative;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .55);
  animation: slideUp .35s cubic-bezier(.34, 1.56, .64, 1);
  max-height: 92vh;
  overflow-y: auto;
}
[data-theme="dark"] .payment-modal-card { background: #1E293B; color: #F8FAFC; }

.payment-modal-close {
  position: absolute; top: 12px; right: 12px;
  width: 36px; height: 36px;
  border: 0; background: transparent;
  font-size: 1.7rem; cursor: pointer;
  border-radius: 8px; color: inherit;
  transition: background .15s;
}
.payment-modal-close:hover { background: rgba(0, 0, 0, .08); }
[data-theme="dark"] .payment-modal-close:hover { background: rgba(255, 255, 255, .12); }

/* ── Header ─────────────────────────────────────────────── */
.payment-modal-head {
  text-align: center;
  margin-bottom: 18px;
}
.payment-modal-icon {
  width: 60px; height: 60px;
  margin: 0 auto 12px;
  background: linear-gradient(135deg, #2563EB, #7C3AED);
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 1.8rem;
  box-shadow: 0 8px 24px rgba(37, 99, 235, .35);
}
.payment-modal-head h2 {
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 6px;
}
.payment-modal-head p {
  color: var(--text2, #64748B);
  font-size: .95rem;
}

/* ── QR display ─────────────────────────────────────────── */
.payment-qr-box {
  background: #fff;
  border: 2px solid #E2E8F0;
  border-radius: 16px;
  padding: 16px;
  display: flex; flex-direction: column; align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.payment-qr-image {
  width: 220px; height: 220px;
  display: block;
  image-rendering: pixelated;
}
.payment-qr-amount {
  font-size: 1.25rem;
  font-weight: 800;
  color: #2563EB;
  letter-spacing: .02em;
}

.payment-banks {
  text-align: center;
  margin-bottom: 12px;
}
.payment-banks-label {
  font-size: .78rem;
  color: var(--text2, #64748B);
  margin-bottom: 6px;
}
.payment-banks-list {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 6px;
}
.payment-banks-list span {
  font-size: .72rem;
  background: rgba(37, 99, 235, .08);
  color: #2563EB;
  padding: 3px 8px;
  border-radius: 100px;
  font-weight: 600;
}
[data-theme="dark"] .payment-banks-list span { background: rgba(59, 130, 246, .15); color: #93C5FD; }

/* ── Demo box ───────────────────────────────────────────── */
.payment-demo-box {
  background: linear-gradient(135deg, rgba(245,158,11,.08), rgba(239,68,68,.04));
  border: 2px dashed #F59E0B;
  border-radius: 16px;
  padding: 20px 16px;
  text-align: center;
  margin-bottom: 14px;
}
.payment-demo-icon { font-size: 2.4rem; margin-bottom: 8px; }
.payment-demo-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #D97706;
  margin-bottom: 6px;
}
[data-theme="dark"] .payment-demo-title { color: #FCD34D; }
.payment-demo-desc {
  font-size: .82rem;
  color: var(--text2, #64748B);
  line-height: 1.55;
  margin-bottom: 16px;
}
.payment-demo-pay {
  width: 100%;
  background: linear-gradient(135deg, #F59E0B, #EF4444);
  font-weight: 800;
  padding: 12px;
  font-size: .95rem;
}
.payment-demo-pay:disabled { opacity: .6; cursor: wait; }

/* ── Status ─────────────────────────────────────────────── */
.payment-status {
  display: flex; align-items: center; gap: 8px;
  background: rgba(34, 197, 94, .08);
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 12px;
  font-size: .85rem;
}
.payment-status-dot {
  width: 8px; height: 8px;
  background: #22C55E;
  border-radius: 50%;
  animation: pulseDot 1.4s ease-in-out infinite;
  flex-shrink: 0;
}
.payment-status-dot.expired {
  background: #EF4444;
  animation: none;
}
.payment-status-text {
  flex: 1;
  color: var(--text2, #64748B);
  font-weight: 600;
}
.payment-countdown {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: #2563EB;
  font-size: .9rem;
}

@keyframes pulseDot {
  0%, 100% { transform: scale(1);   opacity: 1; }
  50%      { transform: scale(1.4); opacity: .6; }
}

.payment-modal-foot {
  text-align: center;
  font-size: .76rem;
  color: var(--text2, #64748B);
  padding-top: 10px;
  border-top: 1px solid var(--border, #E2E8F0);
}

/* ── Success state ──────────────────────────────────────── */
.payment-success {
  text-align: center;
  padding: 20px 8px;
  animation: fadeIn .35s ease-out;
}
.payment-success-checkmark {
  width: 80px; height: 80px;
  margin: 0 auto 18px;
  display: grid; place-items: center;
}
.payment-success-checkmark svg {
  width: 100%; height: 100%;
}
.payment-success-checkmark circle {
  stroke-dasharray: 157;
  stroke-dashoffset: 157;
  animation: drawCircle .55s ease-out forwards;
}
.payment-success-checkmark path {
  stroke-dasharray: 50;
  stroke-dashoffset: 50;
  animation: drawCheck .35s .5s ease-out forwards;
}
@keyframes drawCircle { to { stroke-dashoffset: 0; } }
@keyframes drawCheck  { to { stroke-dashoffset: 0; } }

.payment-success h2 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 8px;
  color: #10B981;
}
.payment-success p {
  color: var(--text, #1E293B);
  font-size: .95rem;
  margin-bottom: 6px;
}
[data-theme="dark"] .payment-success p { color: #E2E8F0; }

.payment-success-sub {
  color: var(--text2, #64748B) !important;
  font-size: .85rem !important;
  margin: 12px 0 18px !important;
}
.payment-success-cta {
  background: linear-gradient(135deg, #10B981, #059669);
  width: 100%;
  font-size: 1rem;
  padding: 12px;
  font-weight: 700;
}

/* ── Error toast ────────────────────────────────────────── */
.payment-error-toast {
  position: fixed; top: 24px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(135deg, #EF4444, #DC2626);
  color: #fff;
  padding: 14px 22px;
  border-radius: 12px;
  font-weight: 600;
  font-size: .9rem;
  box-shadow: 0 12px 36px rgba(239, 68, 68, .4);
  z-index: 10001;
  animation: slideDown .3s ease-out;
  transition: opacity .3s;
  max-width: 90vw;
}

@keyframes slideDown {
  from { transform: translate(-50%, -20px); opacity: 0; }
  to   { transform: translate(-50%, 0);     opacity: 1; }
}

/* ── Mobile tweaks ──────────────────────────────────────── */
@media (max-width: 480px) {
  .payment-modal-card { padding: 24px 18px 16px; border-radius: 18px; }
  .payment-qr-image { width: 200px; height: 200px; }
  .payment-modal-head h2 { font-size: 1.2rem; }
  .payment-success h2 { font-size: 1.3rem; }
  .payment-banks-list span { font-size: .68rem; padding: 2px 6px; }
}
