/* The payment popup: a checkout-style window — merchant / order summary on the left, the payment method on the right. */
html.pm-lock { overflow: hidden; }

.pm-back {
  position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center;
  padding: 20px; background: rgba(8, 20, 45, .62); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  animation: pm-fade .18s ease-out;
}
@keyframes pm-fade { from { opacity: 0 } to { opacity: 1 } }
@keyframes pm-rise { from { opacity: 0; transform: translateY(14px) scale(.985) } to { opacity: 1; transform: none } }

.pm-card {
  position: relative; width: 100%; max-width: 880px; max-height: calc(100vh - 40px); overflow: auto;
  background: #fff; color: #172033; border-radius: 16px; outline: 0;
  box-shadow: 0 30px 80px rgba(3, 12, 30, .45); animation: pm-rise .22s ease-out;
  font-family: inherit;
}
.pm-x {
  position: absolute; top: 10px; right: 12px; z-index: 3; width: 34px; height: 34px; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .92); color: #44506a; font-size: 22px; line-height: 1; cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .18);
}
.pm-x:hover { background: #fff; color: #000; }
.pm-inner { display: grid; grid-template-columns: 300px minmax(0, 1fr); min-height: 520px; }

/* ── Left: merchant and order ─────────────────────────────────────────── */
.pm-left {
  background: linear-gradient(165deg, #0f2b5c 0%, #0a1f45 100%); color: #fff; padding: 28px 24px;
  display: flex; flex-direction: column; gap: 22px; border-radius: 16px 0 0 16px;
}
.pm-brand { display: flex; align-items: center; gap: 12px; }
.pm-brand strong { display: block; font-size: 1rem; }
.pm-brand span:not(.pm-logo) { display: block; font-size: .78rem; color: rgba(255, 255, 255, .7); }
.pm-logo {
  width: 42px; height: 42px; border-radius: 12px; background: #fff; color: #0f2b5c; font-weight: 800; font-size: 1.2rem;
  display: grid; place-items: center; flex: none;
}
.pm-total { background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); border-radius: 12px; padding: 14px 16px; }
.pm-total span { display: block; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: rgba(255, 255, 255, .7); }
.pm-total strong { display: block; margin-top: 4px; font-size: 2rem; line-height: 1.1; letter-spacing: -.01em; }
.pm-sum { margin: 0; display: grid; gap: 12px; }
.pm-sum > div { display: grid; gap: 2px; }
.pm-sum dt { font-size: .7rem; letter-spacing: .07em; text-transform: uppercase; color: rgba(255, 255, 255, .6); }
.pm-sum dd { margin: 0; font-size: .86rem; font-weight: 600; word-break: break-word; }
.pm-clockbox { margin-top: auto; }
.pm-clockbox span { display: block; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: rgba(255, 255, 255, .7); }
.pm-clockbox b { display: block; font-size: 1.9rem; font-variant-numeric: tabular-nums; margin: 2px 0 8px; }
.pm-clockbox.pm-low b { color: #ffb4a8; }
.pm-bar { display: block; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .18); overflow: hidden; }
.pm-bar i { display: block; height: 100%; width: 100%; background: #f5a623; border-radius: 3px; transition: width .5s linear; }
.pm-clockbox.pm-low .pm-bar i { background: #ff7a66; }

/* ── Right: payment method ────────────────────────────────────────────── */
.pm-right { padding: 28px 30px 24px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.pm-h { font-size: 1.15rem; font-weight: 800; margin: 0; padding-right: 36px; }
.pm-method {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1.5px solid #0f2b5c; border-radius: 12px; background: #f3f7ff;
}
.pm-method strong { display: block; font-size: .95rem; }
.pm-method span:not(.pm-mico) { display: block; font-size: .76rem; color: #5a667f; }
.pm-mico { width: 40px; height: 28px; border-radius: 6px; background: #0f2b5c; color: #fff; font-size: .72rem; font-weight: 800; display: grid; place-items: center; flex: none; letter-spacing: .04em; }

.pm-status { border-radius: 10px; padding: 11px 14px; font-size: .84rem; line-height: 1.45; border: 1px solid transparent; }
.pm-status b { display: block; margin-bottom: 2px; font-size: .9rem; }
.pm-proc { background: #eef4ff; border-color: #c7d8ff; color: #16356f; }
.pm-warn { background: #fff8e6; border-color: #f5d98a; color: #6a4700; }

.pm-pay { display: flex; gap: 22px; align-items: flex-start; }
.pm-qrcol { flex: none; text-align: center; }
.pm-qr { background: #fff; padding: 10px; border: 1px solid #dfe5f0; border-radius: 14px; line-height: 0; display: inline-block; box-shadow: 0 2px 10px rgba(15, 43, 92, .07); }
.pm-qr canvas { display: block; image-rendering: pixelated; max-width: 100%; height: auto; }
.pm-qrfail { line-height: 1.45; font-size: .82rem; color: #5a667f; max-width: 240px; }
.pm-steps { list-style: decimal; margin: 4px 0 0; padding-left: 20px; display: grid; gap: 10px; font-size: .88rem; color: #33405a; }
.pm-steps b { color: #0f2b5c; }

.pm-upi { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; background: #f6f8fc; border-radius: 10px; font-size: .86rem; }
.pm-upi span { color: #5a667f; }
.pm-upi b { font-weight: 700; word-break: break-all; }
.pm-upi em { font-style: normal; font-size: .78rem; color: #0a7a3d; font-weight: 600; }

.pm-link { background: none; border: 0; padding: 0; color: #1a56db; font: inherit; font-size: .84rem; font-weight: 600; cursor: pointer; text-decoration: none; }
.pm-link:hover { text-decoration: underline; }

.pm-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 10px; padding: 12px 20px;
  font: inherit; font-weight: 700; font-size: .95rem; cursor: pointer; text-decoration: none; transition: filter .15s, transform .05s;
}
.pm-btn:hover { filter: brightness(1.06); }
.pm-btn:active { transform: translateY(1px); }
.pm-btn:disabled { opacity: .6; cursor: default; }
.pm-primary { background: #f59e0b; color: #fff; }
.pm-dark { background: #0f2b5c; color: #fff; }
.pm-app { width: 100%; }

.pm-utr { border-top: 1px solid #e6ebf3; padding-top: 14px; }
.pm-utr label { display: block; font-size: .82rem; font-weight: 700; margin-bottom: 8px; }
.pm-utr-row { display: flex; gap: 8px; flex-wrap: wrap; }
.pm-utr-row input { flex: 1; min-width: 200px; border: 1.5px solid #cfd8e6; border-radius: 10px; padding: 11px 12px; font: inherit; font-size: .92rem; }
.pm-utr-row input:focus { outline: 0; border-color: #0f2b5c; box-shadow: 0 0 0 3px rgba(15, 43, 92, .12); }
.pm-fine { font-size: .74rem; color: #6b7794; line-height: 1.5; margin: 8px 0 0; }
.pm-err { color: #b42318; font-size: .8rem; margin: 6px 0 0; }
.pm-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: auto; padding-top: 4px; }

.pm-final { margin: auto 0; text-align: center; padding: 20px 8px; display: grid; gap: 10px; justify-items: center; }
.pm-final h2 { margin: 0; font-size: 1.3rem; }
.pm-final p { margin: 0; color: #44506a; font-size: .92rem; max-width: 380px; }
.pm-tick { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-size: 34px; color: #fff; background: #12a150; box-shadow: 0 0 0 8px rgba(18, 161, 80, .14); }
.pm-tick.pm-x2 { background: #d92d20; box-shadow: 0 0 0 8px rgba(217, 45, 32, .12); }

@media (max-width: 760px) {
  .pm-back { align-items: flex-end; padding: 0; }
  .pm-card { max-width: none; max-height: 94vh; border-radius: 18px 18px 0 0; animation: pm-sheet .24s ease-out; }
  @keyframes pm-sheet { from { transform: translateY(40px); opacity: .6 } to { transform: none; opacity: 1 } }
  .pm-inner { grid-template-columns: 1fr; min-height: 0; }
  .pm-left { border-radius: 18px 18px 0 0; padding: 18px 18px 16px; gap: 14px; }
  .pm-sum { display: none; }               /* order details stay reachable on the full payment page */
  .pm-total strong { font-size: 1.7rem; }
  .pm-clockbox { margin-top: 0; }
  .pm-clockbox b { font-size: 1.4rem; margin: 0 0 6px; }
  .pm-right { padding: 18px; }
  .pm-pay { flex-direction: column; align-items: center; }
  .pm-x { top: 8px; right: 10px; }
}
@media (prefers-reduced-motion: reduce) { .pm-back, .pm-card { animation: none; } .pm-bar i { transition: none; } }
