/* pay.css — Collect Payment, QR and result screens (new design) */

.pay-shell { max-width: 480px; margin: 0 auto; padding: 18px 16px 48px; }
@media (min-width: 640px) { .pay-shell { padding-top: 32px; } }

.pay-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 22px; box-shadow: var(--shadow-lg);
  overflow: hidden; position: relative; animation: payIn .28s ease both;
}
@keyframes payIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ───────── amount screen ───────── */
.pay-hero {
  padding: 22px 22px 18px; color: #fff; position: relative; overflow: hidden;
  background: linear-gradient(135deg, #4f46e5 0%, #6d28d9 60%, #7c3aed 100%);
}
.pay-hero::after { content: ''; position: absolute; right: -60px; top: -70px; width: 200px; height: 200px; border-radius: 50%; background: rgba(255,255,255,.1); }
.pay-hero::before { content: ''; position: absolute; left: -40px; bottom: -80px; width: 160px; height: 160px; border-radius: 50%; background: rgba(255,255,255,.07); }
.pay-hero h2 { font-size: 1.25rem; font-weight: 800; letter-spacing: -.02em; position: relative; z-index: 1; }
.pay-hero p { font-size: .84rem; opacity: .85; margin-top: 2px; position: relative; z-index: 1; }
.pay-to { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding: 9px 12px; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.2); border-radius: 14px; position: relative; z-index: 1; }
.pay-to-avatar { width: 34px; height: 34px; border-radius: 10px; background: rgba(255,255,255,.95); color: #4f46e5; font-weight: 800; display: grid; place-items: center; flex-shrink: 0; }
.pay-to-info { min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.pay-to-info small { font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; opacity: .8; }
.pay-to-info b { font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pay-to-info span { font-size: .75rem; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: ui-monospace, Menlo, monospace; }

.pay-body { padding: 22px; }

.pay-amount-box {
  display: flex; align-items: center; justify-content: center; gap: 8px; padding: 16px 12px; border-radius: 18px;
  background: #f8fafc; border: 2px solid var(--border); transition: border-color .15s, box-shadow .15s, background .15s; cursor: text;
}
.pay-amount-box:focus-within { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 4px var(--primary-light); }
.pay-amount-box .cur { font-size: 2rem; font-weight: 700; color: var(--text-3); line-height: 1; }
.pay-amount-box input {
  border: 0; outline: 0; background: transparent; width: 100%; max-width: 280px; text-align: center; min-width: 0;
  font: inherit; font-size: 3rem; font-weight: 800; letter-spacing: -.03em; color: var(--text); font-variant-numeric: tabular-nums;
}
.pay-amount-box input::placeholder { color: #cbd5e1; }
.pay-limit { text-align: center; font-size: .76rem; color: var(--text-3); margin-top: 8px; min-height: 1.1em; }

.pay-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 14px 0 4px; }
.pay-chip {
  padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border-strong); background: #fff; color: var(--text);
  font: inherit; font-size: .86rem; font-weight: 700; cursor: pointer; transition: all .15s; font-variant-numeric: tabular-nums;
}
.pay-chip:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.pay-chip.recent { border-style: dashed; color: var(--text-2); }
.pay-chips-label { width: 100%; text-align: center; font-size: .68rem; text-transform: uppercase; letter-spacing: .07em; color: var(--text-3); font-weight: 700; margin-top: 4px; }

.pay-sum { margin-top: 16px; border: 1px solid var(--border); border-radius: 16px; overflow: hidden; animation: payIn .2s ease both; }
.pay-sum-row { display: flex; justify-content: space-between; padding: 10px 14px; font-size: .88rem; color: var(--text-2); font-variant-numeric: tabular-nums; }
.pay-sum-row + .pay-sum-row { border-top: 1px dashed var(--border); }
.pay-sum-row.total { background: var(--primary-light); color: var(--primary-dark); font-weight: 800; font-size: 1rem; }

.pay-note { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; padding: 11px 13px; border-radius: 12px; background: var(--warning-bg); color: #92400e; font-size: .82rem; line-height: 1.4; }

.pay-cta {
  width: 100%; margin-top: 18px; padding: 16px; border: 0; border-radius: 16px; cursor: pointer; color: #fff;
  background: linear-gradient(135deg, #4f46e5, #7c3aed); box-shadow: 0 10px 24px -8px rgba(79,70,229,.6);
  font: inherit; font-size: 1.05rem; font-weight: 800; letter-spacing: -.01em; display: flex; align-items: center; justify-content: center; gap: 10px;
  transition: transform .08s, box-shadow .15s, opacity .15s;
}
.pay-cta:hover:not(:disabled) { box-shadow: 0 14px 28px -8px rgba(79,70,229,.7); }
.pay-cta:active:not(:disabled) { transform: translateY(1px) scale(.995); }
.pay-cta:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
.pay-cta svg { width: 20px; height: 20px; }

/* ───────── QR screen ───────── */
.qr-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--border); background: #fcfcfd; }
.qr-payee { display: flex; align-items: center; gap: 10px; min-width: 0; }
.qr-payee-avatar { width: 40px; height: 40px; border-radius: 12px; background: linear-gradient(135deg, #4f46e5, #7c3aed); color: #fff; font-weight: 800; display: grid; place-items: center; flex-shrink: 0; }
.qr-payee-info { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.qr-payee-info small { font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); font-weight: 700; }
.qr-payee-info b { font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.ring { position: relative; width: 58px; height: 58px; flex-shrink: 0; }
.ring svg { width: 58px; height: 58px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 5; }
.ring .track { stroke: #e5e7eb; }
.ring .prog { stroke: var(--primary); stroke-linecap: round; transition: stroke-dashoffset .9s linear, stroke .3s; }
.ring.warn .prog { stroke: var(--warning); }
.ring.danger .prog { stroke: var(--danger); }
.ring.verify .prog { stroke: var(--text-3); }
.ring-text { position: absolute; inset: 0; display: grid; place-items: center; font-size: .78rem; font-weight: 800; font-variant-numeric: tabular-nums; }

.qr-body { padding: 20px 20px 22px; text-align: center; }
.qr-amount { font-size: 2.6rem; font-weight: 800; letter-spacing: -.035em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.qr-amount .cur { font-size: 1.6rem; color: var(--text-3); margin-right: 3px; font-weight: 700; }
.qr-split { display: inline-flex; gap: 6px; align-items: center; margin-top: 8px; padding: 4px 12px; border-radius: 999px; background: #f1f5f9; color: var(--text-2); font-size: .78rem; font-variant-numeric: tabular-nums; }

.qr-frame {
  position: relative; width: min(100%, 300px); margin: 18px auto 14px; padding: 14px; border-radius: 22px; background: #fff;
  box-shadow: 0 0 0 1px var(--border), 0 18px 40px -16px rgba(79,70,229,.35);
}
.qr-frame #qr-container svg { width: 100%; height: auto; display: block; border-radius: 6px; }
.qr-frame .c { position: absolute; width: 26px; height: 26px; border: 4px solid var(--primary); }
.qr-frame .c.tl { top: -3px; left: -3px; border-right: 0; border-bottom: 0; border-top-left-radius: 22px; }
.qr-frame .c.tr { top: -3px; right: -3px; border-left: 0; border-bottom: 0; border-top-right-radius: 22px; }
.qr-frame .c.bl { bottom: -3px; left: -3px; border-right: 0; border-top: 0; border-bottom-left-radius: 22px; }
.qr-frame .c.br { bottom: -3px; right: -3px; border-left: 0; border-top: 0; border-bottom-right-radius: 22px; }
.qr-frame.done { opacity: .35; filter: grayscale(1); }

.qr-hint { font-size: .86rem; color: var(--text-2); }
.qr-apps { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.qr-apps span { font-size: .72rem; font-weight: 700; color: var(--text-2); background: #f1f5f9; padding: 3px 10px; border-radius: 999px; }

.qr-actions { display: flex; gap: 8px; justify-content: center; margin-top: 14px; flex-wrap: wrap; }
.qr-upi-open { display: none; width: 100%; }
@media (hover: none) and (pointer: coarse) { .qr-upi-open { display: inline-flex; } }

.qr-status { margin-top: 18px; display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; background: #f8fafc; border: 1px solid var(--border); text-align: left; }
.qr-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--warning); position: relative; flex-shrink: 0; }
.qr-dot::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--warning); animation: qrPulse 1.6s ease-out infinite; }
.qr-status.verifying .qr-dot { background: var(--primary); } .qr-status.verifying .qr-dot::after { border-color: var(--primary); }
@keyframes qrPulse { 0% { transform: scale(.6); opacity: .9; } 100% { transform: scale(1.6); opacity: 0; } }
.qr-status-text { font-size: .88rem; font-weight: 600; color: var(--text); }
.qr-status-sub { font-size: .75rem; color: var(--text-3); }

.qr-foot { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.pay-btn-outline { padding: 12px; border-radius: 12px; font: inherit; font-weight: 700; font-size: .9rem; cursor: pointer; background: #fff; transition: background .15s; }
.pay-btn-outline.success { border: 1.5px solid var(--success); color: var(--success-dark); }
.pay-btn-outline.success:hover { background: var(--success-bg); }
.pay-btn-outline.danger { border: 1.5px solid #fecaca; color: var(--danger); }
.pay-btn-outline.danger:hover { background: var(--danger-bg); }

/* ───────── result screen ───────── */
.res-card { text-align: center; }
.res-top { padding: 30px 20px 22px; color: #fff; position: relative; overflow: hidden; }
.res-top.success { background: linear-gradient(135deg, #059669, #10b981); }
.res-top.expired { background: linear-gradient(135deg, #b45309, #f59e0b); }
.res-top.cancelled { background: linear-gradient(135deg, #475569, #64748b); }
.res-top::after { content: ''; position: absolute; right: -50px; top: -60px; width: 190px; height: 190px; border-radius: 50%; background: rgba(255,255,255,.12); }
.res-icon { width: 74px; height: 74px; margin: 0 auto 14px; border-radius: 50%; background: rgba(255,255,255,.2); display: grid; place-items: center; position: relative; z-index: 1; animation: resPop .5s cubic-bezier(.2,1.4,.4,1) both; }
.res-icon svg { width: 38px; height: 38px; stroke: #fff; fill: none; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.res-icon svg path { stroke-dasharray: 40; stroke-dashoffset: 40; animation: resDraw .45s .25s ease forwards; }
@keyframes resPop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes resDraw { to { stroke-dashoffset: 0; } }
.res-title { font-size: 1.05rem; font-weight: 700; opacity: .95; position: relative; z-index: 1; }
.res-amount { font-size: 2.8rem; font-weight: 800; letter-spacing: -.035em; margin-top: 4px; font-variant-numeric: tabular-nums; position: relative; z-index: 1; }
.res-sub { font-size: .85rem; opacity: .9; margin-top: 2px; position: relative; z-index: 1; }
.res-body { padding: 18px 20px 22px; text-align: left; }
.res-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; font-size: .9rem; border-bottom: 1px dashed var(--border); }
.res-row:last-of-type { border-bottom: 0; }
.res-row span:first-child { color: var(--text-2); }
.res-row b { font-variant-numeric: tabular-nums; text-align: right; word-break: break-all; }
.res-row .mono { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: .8rem; }
.res-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.res-actions .pay-cta { margin-top: 0; }
.res-link { text-align: center; font-size: .86rem; color: var(--primary); font-weight: 600; text-decoration: none; padding: 6px; }

@media (max-width: 380px) {
  .pay-amount-box input { font-size: 2.5rem; } .qr-amount { font-size: 2.2rem; } .res-amount { font-size: 2.3rem; }
  .pay-body, .qr-body { padding-left: 16px; padding-right: 16px; }
}
body.font-large .pay-body, body.font-large .qr-body { font-size: 1.05em; }
body.font-xlarge .pay-chip, body.font-xlarge .res-row { font-size: 1.05rem; }
@media (prefers-reduced-motion: reduce) { .pay-card, .pay-sum, .res-icon, .res-icon svg path, .qr-dot::after { animation: none !important; } .res-icon svg path { stroke-dashoffset: 0; } .ring .prog { transition: none; } }
