/* PaidFast pay page. Colours = theme/tokens.ts (Rand Green). Light + dark follow the phone's setting. */
:root {
  --brand: #0E9F6E; --brand-deep: #064A33; --brand-soft: #DCF4E9;
  --bg: #F1F3F2; --surface: #FFFFFF; --surface-2: #F6F8F7; --text: #111A16; --text-2: #3D4943; --muted: #6B7871; --line: #E2E7E4;
  --paid: #12924F; --paid-bg: #DFF5E8; --partly: #0E7C86; --partly-bg: #DDF2F3; --overdue: #D93A3F; --overdue-bg: #FCE5E5;
  --radius-card: 20px; --radius-field: 14px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000; --surface: #17191A; --surface-2: #202324; --text: #F3F5F4; --text-2: #C9CFCC; --muted: #8E9894; --line: #2A2E2F;
    --brand-soft: #032318; --paid-bg: #10301F; --partly-bg: #0D2A2D; --overdue-bg: #3A1618;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 400 16px/1.45 'Instrument Sans', -apple-system, 'Segoe UI', Arial, sans-serif; -webkit-text-size-adjust: 100%; }
main { max-width: 480px; margin: 0 auto; padding: calc(16px + env(safe-area-inset-top)) 16px calc(28px + env(safe-area-inset-bottom)); }
h1, h2, .amount { font-family: 'Bricolage Grotesque', 'Instrument Sans', Arial, sans-serif; letter-spacing: -0.02em; }
h2 { font-size: 18px; margin: 26px 4px 10px; }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }

/* header */
.biz { display: flex; align-items: center; gap: 12px; padding: 4px 2px 0; }
.logo { width: 44px; height: 44px; border-radius: 12px; background: var(--brand); color: #fff; display: grid; place-items: center; font: 800 16px 'Bricolage Grotesque', Arial, sans-serif; overflow: hidden; flex: none; }
.logo img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.biz-name { font-weight: 600; font-size: 16px; line-height: 1.25; overflow-wrap: anywhere; }
.biz-sub { font-size: 13px; color: var(--muted); }

/* amount card */
.hero { margin-top: 16px; border-radius: 28px; padding: 22px 20px 20px; color: #fff; background: linear-gradient(165deg, #0B7A55 0%, #0E9F6E 55%, #2BC48A 100%); }
.hero .label { font-size: 15px; opacity: .88; font-weight: 500; }
.amount { font-size: 44px; font-weight: 800; line-height: 1.12; margin: 4px 0 2px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.amount .cents { font-size: 26px; opacity: .7; }
.hero .meta { font-size: 14px; opacity: .92; }
.chip { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 3px 10px; font-size: 13px; font-weight: 600; margin-top: 12px; background: rgba(255,255,255,.2); color: #fff; }
.chip::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.hero.paid { background: var(--surface); color: var(--text); box-shadow: inset 0 0 0 2px var(--paid); }
.hero.paid .chip { background: var(--paid-bg); color: var(--paid); }
.stamp { display: inline-block; margin-top: 10px; border: 3px solid var(--paid); color: var(--paid); border-radius: 10px; font: 800 22px 'Bricolage Grotesque', Arial, sans-serif; padding: 0 12px; transform: rotate(-8deg); letter-spacing: .04em; }

/* cards + rows */
.card { background: var(--surface); border-radius: var(--radius-card); overflow: hidden; }
.row { display: flex; align-items: center; gap: 12px; padding: 13px 16px; min-height: 56px; }
.row + .row { border-top: 1px solid var(--line); }
.row .k { font-size: 13px; color: var(--muted); }
.row .v { font-size: 16.5px; font-weight: 500; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.row .grow { flex: 1; min-width: 0; }
.row.ref { background: var(--brand-soft); }
.row.ref .v { font-weight: 700; }
.copy { flex: none; border: 0; border-radius: 999px; background: var(--surface-2); color: var(--brand); font: 600 14px 'Instrument Sans', Arial, sans-serif; padding: 8px 14px; min-width: 76px; cursor: pointer; }
.row.ref .copy { background: var(--surface); }
.copy:focus-visible, .btn:focus-visible, summary:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.copy.done { background: var(--brand); color: #fff; }
.hint { font-size: 13.5px; color: var(--muted); margin: 8px 4px 0; }
.qr { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-top: 1px solid var(--line); }
.qr img { width: 112px; height: 112px; object-fit: contain; background: #fff; border-radius: 10px; padding: 6px; flex: none; }

/* buttons */
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 52px; margin-top: 12px; border-radius: 999px; border: 0;
  background: var(--brand); color: #fff; font: 600 16px 'Instrument Sans', Arial, sans-serif; text-decoration: none; cursor: pointer; }
.btn.soft { background: var(--surface); color: var(--text); }
.btn svg { width: 20px; height: 20px; }

/* invoice details */
details { margin-top: 12px; }
summary { list-style: none; cursor: pointer; background: var(--surface); border-radius: var(--radius-card); padding: 15px 16px; font-weight: 600; display: flex; justify-content: space-between; }
summary::-webkit-details-marker { display: none; }
summary::after { content: 'Show'; color: var(--brand); font-weight: 600; font-size: 14px; }
details[open] summary { border-radius: var(--radius-card) var(--radius-card) 0 0; }
details[open] summary::after { content: 'Hide'; }
.doc { background: var(--surface); border-radius: 0 0 var(--radius-card) var(--radius-card); padding: 4px 16px 16px; border-top: 1px solid var(--line); }
.doc table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.doc th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12.5px; padding: 10px 0 6px; }
.doc td { padding: 8px 0; border-top: 1px solid var(--line); vertical-align: top; }
.doc .r { text-align: right; white-space: nowrap; padding-left: 10px; }
.sums { margin-top: 8px; font-size: 14px; font-variant-numeric: tabular-nums; }
.sums div { display: flex; justify-content: space-between; padding: 3px 0; }
.sums .grand { border-top: 1.5px solid var(--text); margin-top: 4px; padding-top: 7px; font: 800 17px 'Bricolage Grotesque', Arial, sans-serif; }
.sums .after { color: var(--brand); font-weight: 600; }
.note { font-size: 13px; color: var(--muted); margin-top: 10px; white-space: pre-line; }

/* states */
.loading, .gone { text-align: center; padding: 80px 16px; }
.spinner { width: 34px; height: 34px; margin: 0 auto 14px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }
.gone h1 { font-size: 26px; margin: 14px 0 8px; }
.gone .icon { width: 64px; height: 64px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; margin: 0 auto; }
.foot { text-align: center; font-size: 13px; color: var(--muted); margin-top: 26px; }
.foot a { color: var(--muted); }
.toast { position: fixed; left: 50%; top: calc(14px + env(safe-area-inset-top)); transform: translateX(-50%); background: #111A16; color: #fff; padding: 10px 16px; border-radius: 14px;
  font-size: 14.5px; font-weight: 600; opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 10; max-width: calc(100vw - 32px); }
.toast.on { opacity: 1; }
@media (prefers-color-scheme: dark) { .toast { background: #F3F5F4; color: #111A16; } }

/* Terms and Privacy pages */
.legal { max-width: 680px; padding-top: 28px; font-size: 15.5px; line-height: 1.6; }
.legal h1 { font-size: 34px; margin: 6px 0 2px; }
.legal h2 { font-size: 19px; margin: 28px 0 8px; }
.legal p, .legal li { color: var(--text-2); }
.legal ul { padding-left: 20px; }
.legal li { margin: 6px 0; }
.legal a { color: var(--brand); }
.legal .crumb { margin: 0; font-weight: 600; }
.legal .crumb a { text-decoration: none; }

/* reset / confirmed pages */
.auth { max-width: 440px; padding-top: 40px; }
.auth h1 { font-size: 28px; margin: 4px 0 6px; }
.auth form { margin-top: 18px; display: grid; gap: 10px; }
.field { display: block; background: var(--surface); border-radius: var(--radius-field); padding: 10px 14px; }
.field span { display: block; font-size: 12.5px; color: var(--muted); font-weight: 500; }
.field input { width: 100%; border: 0; background: transparent; color: var(--text); font: 400 17px 'Instrument Sans', Arial, sans-serif; padding: 3px 0 0; outline: none; }
.field:focus-within { box-shadow: inset 0 0 0 2px var(--brand); }
.show { font-size: 14px; color: var(--text-2); display: flex; gap: 8px; align-items: center; margin: 2px 4px; }
.err { color: var(--overdue); font-size: 14px; margin: 0 4px; min-height: 1em; }
.btn:disabled { opacity: .6; }
