/* ---------------------------------------------------------------------------
   Design notes

   The hardest thing a user does on this page is copy a 12-digit UTR out of
   their payment app without a typo. So the page is built as a payment
   receipt: the amount and the reference are set in tabular figures, the card
   has the notched edge of a torn slip, and the UTR field is the most
   carefully treated element on the screen.

   Typefaces are the platform UI stack and the platform monospace stack. That
   is a deliberate choice, not a default: this page loads over patchy mobile
   data in India and must paint instantly with no webfont shift, and the
   monospace is functional — it makes a mistyped digit visible.
--------------------------------------------------------------------------- */

:root {
  --paper: #eef1f5;
  --card: #ffffff;
  --ink: #141b2d;
  --muted: #5b6577;
  --line: #d9dfe8;
  --accent: #146b5c;        /* the green of a cleared bank credit */
  --accent-soft: #e4f1ee;
  --warn: #9a5410;
  --warn-soft: #fbf0e1;
  --danger: #9d1f33;
  --danger-soft: #fbe9ec;
  --focus: #2a52d6;

  --ui: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Menlo, monospace;

  --radius: 10px;
  --gap: 1.25rem;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--ui);
  font-size: 16px;
  line-height: 1.55;
}

a { color: var(--focus); }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

.wrap {
  max-width: 32rem;
  margin: 0 auto;
  padding: 1.5rem 1.1rem 4rem;
}

/* --- receipt -------------------------------------------------------------- */

.receipt {
  background: var(--card);
  border-radius: var(--radius);
  padding: 1.6rem 1.4rem 1.4rem;
  box-shadow: 0 1px 2px rgba(20, 27, 45, .08);
  position: relative;
}

.receipt::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -9px;
  height: 10px;
  background:
    radial-gradient(circle at 5px -1px, transparent 6px, var(--card) 6.5px) repeat-x;
  background-size: 14px 10px;
}

.eyebrow {
  margin: 0 0 .15rem;
  font-size: .9rem;
  color: var(--muted);
}

.amount {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 2.9rem;
  font-weight: 600;
  letter-spacing: -.02em;
  margin: 0;
  line-height: 1.1;
}

.amount .cur { font-size: 1.6rem; color: var(--muted); font-weight: 400; }

.receipt h1 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: .9rem 0 0;
}

.receipt p.lede {
  margin: .35rem 0 0;
  color: var(--muted);
  font-size: .95rem;
}

.payto {
  margin-top: 1.2rem;
  border-top: 1px dashed var(--line);
  padding-top: 1rem;
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
}

.payto dt { font-size: .85rem; color: var(--muted); margin: 0; }
.payto dd {
  margin: 0;
  font-family: var(--mono);
  font-size: 1.05rem;
  word-break: break-all;
}

.btn {
  display: inline-block;
  font: inherit;
  font-weight: 600;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: .7rem 1.1rem;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}

.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: #22304d; }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--muted); }
.btn-block { display: block; width: 100%; }
.btn-sm { padding: .4rem .7rem; font-size: .88rem; font-weight: 500; }
.btn-danger { background: var(--danger); color: #fff; }

.copy { margin-left: auto; }

.pay-actions { margin-top: 1rem; display: grid; gap: .6rem; }

/* --- steps ---------------------------------------------------------------- */

.steps { margin: 2.4rem 0 0; padding: 0; list-style: none; counter-reset: step; }

.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 2.4rem;
  margin-bottom: 1.15rem;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0; top: .1rem;
  width: 1.7rem; height: 1.7rem;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-family: var(--mono);
  font-size: .85rem;
  display: grid;
  place-items: center;
}

.steps b { display: block; }
.steps span { color: var(--muted); font-size: .94rem; }

/* --- form ----------------------------------------------------------------- */

form.details { margin-top: 2.2rem; }

.field { margin-bottom: 1.15rem; }

.field label {
  display: block;
  font-weight: 600;
  font-size: .95rem;
  margin-bottom: .3rem;
}

.field .hint {
  display: block;
  font-weight: 400;
  color: var(--muted);
  font-size: .85rem;
  margin-bottom: .4rem;
}

.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field input[type="file"],
.field textarea,
.field select {
  width: 100%;
  font: inherit;
  padding: .7rem .75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

.field input.mono {
  font-family: var(--mono);
  font-size: 1.15rem;
  letter-spacing: .08em;
  font-variant-numeric: tabular-nums;
}

.field .optional { color: var(--muted); font-weight: 400; }

.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.notice {
  border-radius: 8px;
  padding: .8rem .9rem;
  font-size: .92rem;
  margin-bottom: 1.2rem;
}

.notice-warn { background: var(--warn-soft); color: var(--warn); }
.notice-error { background: var(--danger-soft); color: var(--danger); }
.notice-ok { background: var(--accent-soft); color: var(--accent); }

.footnote {
  margin-top: 2.5rem;
  font-size: .85rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding-top: 1rem;
}

/* --- status --------------------------------------------------------------- */

.timeline { list-style: none; margin: 1.5rem 0 0; padding: 0; }

.timeline li {
  display: grid;
  /* Three children share this row: the ::before dot, the <b> and the <span>.
     Without explicit placement the third wraps back under the dot and gets a
     1.4rem column to live in. */
  grid-template-columns: 1.1rem 1fr;
  column-gap: .85rem;
  padding-bottom: 1.35rem;
  position: relative;
}

.timeline li::before {
  content: "";
  grid-column: 1;
  grid-row: 1;
  width: .8rem; height: .8rem;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: #fff;
  margin-top: .42rem;
}

.timeline li b,
.timeline li span { grid-column: 2; }

.timeline li.done::before { background: var(--accent); border-color: var(--accent); }
.timeline li.active::before { border-color: var(--ink); background: var(--ink); }
.timeline li.stop::before { background: var(--danger); border-color: var(--danger); }

.timeline li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: .4rem; top: 1.5rem; bottom: .2rem;
  width: 2px;
  background: var(--line);
}

.timeline b { display: block; font-size: .96rem; line-height: 1.4; }
.timeline span { color: var(--muted); font-size: .89rem; display: block; margin-top: .1rem; }

.kv { margin: 1.5rem 0 0; display: grid; grid-template-columns: auto 1fr; gap: .4rem 1rem; font-size: .93rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-family: var(--mono); word-break: break-all; }

/* --- badges --------------------------------------------------------------- */

.badge {
  display: inline-block;
  font-size: .76rem;
  font-weight: 600;
  padding: .15rem .5rem;
  border-radius: 99px;
  white-space: nowrap;
}

.badge-PENDING, .badge-READY_FOR_APPROVAL { background: var(--warn-soft); color: var(--warn); }
.badge-VERIFIED, .badge-ACTIVE { background: var(--accent-soft); color: var(--accent); }
.badge-MANUAL_REVIEW, .badge-SUSPENDED { background: #e8ebf2; color: #3c4762; }
.badge-REJECTED, .badge-CANCELLED, .badge-EXPIRED, .badge-REFUNDED { background: var(--danger-soft); color: var(--danger); }

/* --- admin console -------------------------------------------------------- */

.admin { background: #f7f8fa; }

.admin .bar {
  background: var(--ink);
  color: #fff;
  padding: .7rem 1.1rem;
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.admin .bar a { color: #c8d2e6; text-decoration: none; font-size: .92rem; }
.admin .bar a:hover, .admin .bar a.on { color: #fff; }
.admin .bar .brand { font-weight: 700; margin-right: .5rem; }
.admin .bar form { margin-left: auto; }
.admin .bar button {
  background: transparent; border: 1px solid #3c4762; color: #c8d2e6;
  border-radius: 6px; padding: .3rem .6rem; font: inherit; font-size: .85rem; cursor: pointer;
}

.admin main { max-width: 74rem; margin: 0 auto; padding: 1.4rem 1.1rem 4rem; }

.admin h1 { font-size: 1.3rem; margin: 0 0 1rem; }
.admin h2 { font-size: 1.05rem; margin: 2rem 0 .7rem; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); gap: .7rem; }

.tile {
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  padding: .8rem .9rem; text-decoration: none; color: inherit; display: block;
}
.tile:hover { border-color: var(--muted); }
.tile .n { font-family: var(--mono); font-size: 1.7rem; font-variant-numeric: tabular-nums; display: block; line-height: 1.2; }
.tile .l { font-size: .82rem; color: var(--muted); }
.tile.alert .n { color: var(--danger); }

table { width: 100%; border-collapse: collapse; background: #fff; font-size: .9rem; }
thead th { text-align: left; font-size: .8rem; color: var(--muted); font-weight: 600; padding: .5rem .6rem; border-bottom: 1px solid var(--line); }
tbody td { padding: .55rem .6rem; border-bottom: 1px solid #eef1f5; vertical-align: top; }
tbody tr:hover { background: #fafbfd; }
td.mono, th.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

.scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }

.panel { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 1rem 1.1rem; }
.panel + .panel { margin-top: 1rem; }

.grid2 { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 1rem; align-items: start; }

.toolbar { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
.toolbar input[type="text"], .toolbar input[type="search"], .toolbar select, .toolbar input[type="file"] {
  font: inherit; padding: .45rem .55rem; border: 1px solid var(--line); border-radius: 7px; background: #fff;
}
.toolbar .spacer { flex: 1; }

.chips { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1rem; }
.chips a {
  font-size: .85rem; text-decoration: none; color: var(--muted);
  border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: .25rem .7rem;
}
.chips a.on { background: var(--ink); color: #fff; border-color: var(--ink); }

.flags { display: flex; gap: .3rem; flex-wrap: wrap; margin-top: .3rem; }
.flags span { font-size: .72rem; background: var(--warn-soft); color: var(--warn); padding: .1rem .4rem; border-radius: 4px; }

.shot { max-width: 100%; border: 1px solid var(--line); border-radius: 8px; }

.actions { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr)); margin-top: .7rem; }

.muted { color: var(--muted); }
.small { font-size: .85rem; }

pre.meta { font-family: var(--mono); font-size: .8rem; background: #f4f6fa; padding: .5rem; border-radius: 6px; overflow-x: auto; margin: .2rem 0 0; }

@media (max-width: 720px) {
  .grid2 { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
