/* Revora pay page — tokens match the app (lib/ui/tokens.dart); all text pairs are WCAG AA. */
@font-face { font-family: "Sora"; src: url("/fonts/Sora-800.ttf") format("truetype"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Sora"; src: url("/fonts/Sora-700.ttf") format("truetype"); font-weight: 700; font-display: swap; }

:root {
  --ink: #0B1020; --ink-raised: #141B33; --ignite: #FF6A2B; --volt: #2457E6;
  --ground: #F4F5F8; --surface: #FFFFFF; --sunken: #EEF0F4; --line: #E3E6ED; --line-strong: #D5DAE4;
  --text: #0B1020; --text-soft: #3F4859; --muted: #586174; --on-ink: #FFFFFF; --on-ink-muted: #C9CFDD;
  --paid: #11652F; --paid-bg: #DDF3E4; --success: #15803D; --danger: #B91C1C; --whatsapp: #0F7A3D;
  --verified: #9BE7B4;
  --r-md: 16px; --r-lg: 22px; --r-xl: 26px;
  --shadow: 0 1px 0 var(--line), 0 24px 44px rgba(11,16,32,.14);
  --ease: cubic-bezier(.2,.8,.2,1);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--ground); color: var(--text); }
body { font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Tamil", "Latha", sans-serif; font-size: 17px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
.hidden { display: none !important; }
.center { text-align: center; }
.small { font-size: 14px; }
.muted { color: var(--muted); }
.ok-text { color: var(--paid); font-weight: 600; font-size: 15px; }
button, a { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--volt); outline-offset: 2px; }

/* ---------- header */
.top { background: var(--ink); color: var(--on-ink); padding: 14px 18px 64px; position: relative; overflow: hidden; }
.ring { position: absolute; right: -70px; top: -80px; width: 220px; height: 220px; border-radius: 50%; border: 26px solid var(--ink-raised); }
.bar { display: flex; align-items: center; justify-content: space-between; position: relative; max-width: 480px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--on-ink); text-decoration: none; font-family: Sora, sans-serif; font-weight: 800; font-size: 20px; letter-spacing: -.02em; }
.lang { display: flex; padding: 3px; border-radius: 999px; background: var(--ink-raised); }
.lang button { min-height: 34px; padding: 0 12px; border-radius: 999px; border: 0; background: transparent; color: var(--on-ink-muted); font-weight: 600; font-size: 13px; }
.lang button[aria-pressed="true"] { background: var(--surface); color: var(--ink); font-weight: 700; }
.shop { margin: 22px auto 0; display: flex; align-items: center; gap: 12px; position: relative; max-width: 480px; animation: rise .5s var(--ease) both; }
.badge { width: 52px; height: 52px; border-radius: 16px; background: var(--surface); color: var(--ink); font-family: Sora, sans-serif; font-weight: 800; font-size: 20px; display: flex; align-items: center; justify-content: center; }
.shop-name { font-weight: 700; font-size: 18px; }
.verified { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--verified); }

/* ---------- main */
main { max-width: 480px; margin: -44px auto 0; padding: 0 18px 28px; display: flex; flex-direction: column; gap: 14px; position: relative; }
main > section { display: flex; flex-direction: column; gap: 14px; }
.card { background: var(--surface); border-radius: var(--r-xl); padding: 20px; box-shadow: var(--shadow); }
.amount-card { transform: perspective(900px) rotateX(2deg); animation: rise .55s var(--ease) both; }
.amount { font-family: Sora, sans-serif; font-weight: 800; font-size: 50px; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.plate-row { margin-top: 14px; flex-wrap: wrap; }
.plate { display: inline-flex; align-items: stretch; border: 2px solid var(--ink); border-radius: 7px; overflow: hidden; }
.plate .ind { background: #1E3A8A; color: #fff; font-size: 8px; font-weight: 700; padding: 0 4px 3px; display: flex; align-items: flex-end; }
.plate .num { background: #fff; padding: 3px 9px; font-family: Sora, sans-serif; font-weight: 800; font-size: 16px; letter-spacing: .04em; }
.details-btn { margin-top: 14px; width: 100%; min-height: 48px; border-radius: 14px; border: 1px solid var(--line); background: var(--ground); color: var(--text); font-weight: 600; font-size: 15px; display: flex; align-items: center; justify-content: space-between; padding: 0 14px; }
.details-btn .chev { transition: transform .25s var(--ease); }
.details-btn[aria-expanded="true"] .chev { transform: rotate(180deg); }
.details { margin-top: 10px; display: flex; flex-direction: column; gap: 7px; font-size: 15px; animation: rise .3s var(--ease) both; }
.line { display: flex; justify-content: space-between; gap: 10px; }
.details .soft { color: var(--text-soft); }
.details .good { color: var(--paid); }
.details hr { border: 0; border-top: 1px solid var(--line); margin: 2px 0; width: 100%; }

/* ---------- pay */
.cta { position: relative; overflow: hidden; min-height: 62px; border-radius: 20px; background: var(--ignite); color: var(--ink); font-weight: 800; font-size: 19px; text-decoration: none; display: flex; align-items: center; justify-content: center; gap: 10px; box-shadow: 0 16px 30px rgba(255,106,43,.42); transition: transform .15s var(--ease); animation: rise .6s .08s var(--ease) both; }
.cta:active { transform: scale(.97); }
.cta::after { content: ""; position: absolute; top: 0; bottom: 0; width: 40%; background: rgba(255,255,255,.35); transform: translateX(-120%) skewX(-20deg); animation: shine 2.8s ease-in-out 1s infinite; }
.apps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.app-btn { min-height: 48px; border-radius: 14px; border: 2px solid var(--ink); background: var(--surface); color: var(--ink); font-weight: 700; text-decoration: none; display: flex; align-items: center; justify-content: center; }
.chips { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; font-size: 13px; font-weight: 600; color: var(--text-soft); }
.chips span { padding: 6px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.ghost { width: 100%; margin-top: 12px; min-height: 50px; border-radius: 16px; border: 2px dashed var(--line-strong); background: transparent; color: var(--text); font-weight: 600; font-size: 15px; }
.qr-box { margin: 12px auto 0; padding: 14px; border-radius: 20px; background: var(--surface); box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; gap: 6px; animation: rise .3s var(--ease) both; }
.qr-box img { width: 210px; height: 210px; image-rendering: pixelated; }
.waiting { display: flex; gap: 12px; align-items: center; margin-top: 12px; padding: 16px; }
.dot-pulse { width: 14px; height: 14px; flex: none; border-radius: 50%; background: var(--ignite); animation: beat 1.2s ease-in-out infinite; }
.notice { color: var(--danger); font-weight: 600; text-align: center; }
.trust { display: flex; align-items: flex-start; gap: 10px; padding: 14px; border-radius: 18px; background: #E9F6EE; color: var(--paid); font-size: 14px; line-height: 1.45; }
.trust svg { flex: none; }

/* ---------- paid */
.success { position: relative; width: 120px; height: 120px; margin: 24px auto 0; display: flex; align-items: center; justify-content: center; }
.pulse { position: absolute; inset: 0; border-radius: 50%; border: 4px solid var(--success); animation: ring 1.6s .3s ease-out infinite; }
.tick-circle { width: 112px; height: 112px; border-radius: 50%; background: var(--success); display: flex; align-items: center; justify-content: center; box-shadow: 0 20px 40px rgba(21,128,61,.35); animation: pop .6s var(--ease) both; }
.tick { stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw .5s .35s ease-out forwards; }
h1 { font-size: 26px; margin: 6px 0 0; }
p { margin: 0; }
.receipt { padding: 0; overflow: hidden; }
.receipt .head { padding: 16px 18px; display: flex; align-items: center; gap: 12px; border-bottom: 1px dashed var(--line-strong); }
.receipt .body { padding: 14px 18px; display: flex; flex-direction: column; gap: 8px; font-size: 15px; }
.receipt .foot { padding: 14px 18px; background: #E9F6EE; color: var(--paid); display: flex; justify-content: space-between; align-items: center; font-weight: 700; }
.receipt .foot b { font-family: Sora, sans-serif; font-size: 22px; }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.outline { min-height: 54px; border-radius: 16px; border: 2px solid var(--ink); background: var(--surface); color: var(--ink); font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 8px; }
.solid-green { min-height: 54px; border-radius: 16px; background: var(--whatsapp); color: #fff; font-weight: 700; text-decoration: none; display: flex; align-items: center; justify-content: center; }

/* ---------- loading / error */
.skel { display: flex; flex-direction: column; gap: 12px; }
.sk { height: 16px; border-radius: 8px; background: linear-gradient(90deg, var(--sunken) 0%, #F8F9FB 50%, var(--sunken) 100%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
.sk.big { height: 48px; width: 60%; }
.sk.w40 { width: 40%; } .sk.w70 { width: 70%; } .sk.w100 { width: 100%; height: 48px; }
.err-icon { width: 56px; height: 56px; margin: 0 auto 10px; border-radius: 50%; background: #FBE3E3; color: var(--danger); font-family: Sora, sans-serif; font-weight: 800; font-size: 28px; display: flex; align-items: center; justify-content: center; }
#errorText { color: var(--danger); font-weight: 600; }
footer { text-align: center; font-size: 13px; color: var(--muted); padding-top: 6px; }
footer b { color: var(--ink); }

@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; } }
@keyframes shine { 0% { transform: translateX(-120%) skewX(-20deg); } 55%, 100% { transform: translateX(320%) skewX(-20deg); } }
@keyframes pop { 0% { transform: scale(.4); opacity: 0; } 60% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes ring { 0% { transform: scale(.8); opacity: .6; } 100% { transform: scale(1.6); opacity: 0; } }
@keyframes beat { 0%, 100% { transform: scale(.8); opacity: .6; } 50% { transform: scale(1.15); opacity: 1; } }
@keyframes shimmer { to { background-position: -200% 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .tick { stroke-dashoffset: 0; }
}
@media print {
  .top, #unpaid, .two, footer .lang { display: none !important; }
  body { background: #fff; }
  main { margin-top: 0; }
}
