:root {
  --ink: #070707;
  --panel: #101010;
  --line: rgb(255 255 255 / 0.12);
  --red: #e8141c;
  --red-hot: #ff2b31;
  --bone: #ededed;
  --mute: #9b9b9b;
  --ok: #34d399;
  --display: "Anton", Impact, sans-serif;
  --mono: "Space Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse at 10% 0%, rgb(232 20 28 / 0.12), transparent 50%),
    radial-gradient(ellipse at 100% 100%, rgb(255 255 255 / 0.04), transparent 50%),
    var(--ink);
  color: var(--bone);
  font: 14px/1.6 var(--mono);
  -webkit-font-smoothing: antialiased;
}
.grain {
  position: fixed; inset: 0; z-index: 50; pointer-events: none;
  background-image: url("/grain.png"); opacity: 0.06;
}
a { color: inherit; }
::selection { background: var(--red); color: #fff; }

/* Header / footer */
.top, .foot {
  width: 100%; max-width: 1200px; margin: 0 auto; padding: 22px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.logo img { height: 30px; width: auto; display: block; }
.secure { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--mute); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 10px var(--ok); }
.foot { flex-wrap: wrap; border-top: 1px solid var(--line); font-size: 11px; color: var(--mute); margin-top: auto; }
.foot p { margin: 0; }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px; }
.foot nav span { color: var(--red); }
.foot a { text-decoration: none; }
.foot a:hover { color: #fff; }

/* Layout */
.wrap {
  width: 100%; max-width: 1200px; margin: 0 auto; padding: 24px 20px 64px;
  display: grid; gap: 40px; align-items: start;
}
@media (min-width: 900px) {
  .wrap { grid-template-columns: 1fr 1.05fr; gap: 72px; padding-top: 56px; }
}

.eyebrow { margin: 0; color: var(--red); font-size: 12px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; }
h1, h2 { font-family: var(--display); font-weight: 400; text-transform: uppercase; line-height: .92; margin: 12px 0 0; }
h1 {
  font-size: clamp(56px, 12vw, 120px);
  background: linear-gradient(180deg, #fff 0%, #d4d4d4 40%, #8d8d8d 75%, #c9c9c9 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
h2 { font-size: 40px; }
.lead { color: rgb(237 237 237 / .75); max-width: 440px; margin: 20px 0 0; }
.methods { list-style: none; padding: 0; margin: 28px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.methods li { border: 1px solid var(--line); padding: 6px 12px; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: rgb(237 237 237 / .8); }

/* Card */
.card {
  position: relative; background: var(--panel); border: 1px solid var(--line);
  padding: 24px; box-shadow: 0 40px 120px -40px rgb(0 0 0 / .9);
}
.card::before { content: ""; position: absolute; left: 0; top: 0; height: 3px; width: 100%; background: var(--red); }
@media (min-width: 600px) { .card { padding: 36px; } }

form { display: grid; gap: 20px; }
.row { display: grid; gap: 20px; }
@media (min-width: 600px) { .row { grid-template-columns: 1fr 1fr; } }
.field { display: grid; gap: 6px; }
.field > span { font-size: 10px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: rgb(237 237 237 / .55); }
input {
  width: 100%; background: transparent; color: #fff; font: inherit; font-size: 15px;
  border: 0; border-bottom: 1px solid rgb(255 255 255 / .18); border-radius: 0; padding: 10px 0; outline: none;
  transition: border-color .3s;
}
input:focus { border-color: var(--red); }
input::placeholder { color: rgb(255 255 255 / .28); }
input:invalid:not(:placeholder-shown):not(:focus) { border-color: rgb(255 43 49 / .6); }

.amount-input { display: flex; align-items: baseline; gap: 10px; border-bottom: 1px solid rgb(255 255 255 / .18); transition: border-color .3s; }
.amount-input:focus-within { border-color: var(--red); }
.amount-input b { font-family: var(--display); font-weight: 400; font-size: 44px; color: var(--red); }
.amount-input input { border: 0; font-family: var(--display); font-size: 56px; line-height: 1.1; padding: 4px 0; letter-spacing: .01em; }
.amount-input input::-webkit-outer-spin-button, .amount-input input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.amount-input input { -moz-appearance: textfield; appearance: textfield; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: -8px; }
.chips button {
  background: transparent; color: rgb(237 237 237 / .75); border: 1px solid var(--line);
  font: inherit; font-size: 12px; padding: 6px 12px; cursor: pointer; transition: all .3s;
}
.chips button:hover, .chips button[aria-pressed="true"] { border-color: var(--red); color: #fff; background: rgb(232 20 28 / .15); }

.pay {
  position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 18px 22px; border: 0; cursor: pointer;
  background: var(--red); color: #fff; font: inherit; font-size: 13px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase;
  transition: background .3s, transform .2s;
}
.pay:hover { background: var(--red-hot); }
.pay:active { transform: scale(.99); }
.pay:disabled { opacity: .6; cursor: progress; }
.pay .arrow { font-size: 18px; transition: transform .3s; }
.pay:hover .arrow { transform: translateX(4px); }
.fine { margin: -8px 0 0; font-size: 11px; color: var(--mute); }

.status { margin: 0; padding: 12px 14px; font-size: 12px; border: 1px solid; }
.status.error { color: #ff8a8e; border-color: rgb(232 20 28 / .45); background: rgb(232 20 28 / .1); }
.status.warn { color: #f5d38a; border-color: rgb(245 211 138 / .35); background: rgb(245 211 138 / .08); }
.status.info { color: var(--bone); border-color: var(--line); background: rgb(255 255 255 / .04); }

/* Policy pages */
.doc { width: 100%; max-width: 760px; margin: 0 auto; padding: 32px 20px 72px; }
.doc h1 { font-size: clamp(44px, 9vw, 80px); }
.doc h2 { font-size: 22px; margin-top: 32px; color: #fff; }
.doc p, .doc li { color: rgb(237 237 237 / .78); }
.doc .updated { color: var(--mute); font-size: 12px; }
.back { display: inline-block; margin-bottom: 24px; font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--mute); text-decoration: none; }
.back:hover { color: #fff; }

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

/* ------------------------------------------------------------------ */
/* Receipt                                                             */
/* ------------------------------------------------------------------ */

:root {
  --marker: "Permanent Marker", cursive;
  --hand: "Caveat", cursive;
}
.card:has(.done:not([hidden])) { padding: 0; background: transparent; border: 0; box-shadow: none; }
.card:has(.done:not([hidden]))::before { display: none; }

.receipt {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #111 0%, #0b0b0b 100%);
  border: 1px solid var(--line);
  box-shadow: 0 40px 120px -40px rgb(0 0 0 / .95);
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.receipt::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: url("/grain.png"); opacity: .05;
}
.rc-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 22px 26px;
}
.rc-logo { height: 28px; width: auto; display: block; }
.rc-meta { text-align: right; }
.rc-eyebrow { margin: 0; color: var(--red); font-size: 10px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; }
.rc-no { margin: 4px 0 0; font-size: 11px; color: var(--mute); }

/* Red torn-paper band with the amount */
.rc-hero {
  position: relative;
  padding: 26px 26px 46px;
  background:
    radial-gradient(ellipse at 85% 0%, rgb(255 255 255 / .14), transparent 55%),
    linear-gradient(160deg, #f0222a 0%, var(--red) 45%, #c40f16 100%);
  clip-path: polygon(0 0, 100% 0, 100% 86%, 96% 90%, 92% 87%, 88% 93%, 83% 88%, 78% 94%, 73% 89%, 68% 95%, 62% 90%, 57% 96%, 52% 90%, 47% 95%, 41% 89%, 36% 94%, 30% 88%, 25% 93%, 19% 88%, 14% 94%, 9% 89%, 4% 93%, 0 89%);
  color: #fff;
}
.rc-label { margin: 0; font-size: 10px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; color: rgb(255 255 255 / .8); }
.rc-amount { margin: 6px 0 0; font-family: var(--display); font-size: clamp(54px, 13vw, 84px); line-height: .95; letter-spacing: .01em; }
.rc-date { margin: 10px 0 0; font-size: 12px; color: rgb(255 255 255 / .85); }
.rc-stamp {
  position: absolute; right: 22px; top: 50%;
  width: 104px; height: 104px; margin-top: -60px;
  display: grid; place-content: center; text-align: center;
  border: 3px solid #fff; border-radius: 50%;
  outline: 1.5px solid rgb(255 255 255 / .7); outline-offset: 4px;
  transform: rotate(-14deg);
  font-family: var(--marker); color: #fff; line-height: 1;
}
.rc-stamp span { font-size: 30px; text-transform: uppercase; }
.rc-stamp small { font-family: var(--mono); font-size: 8px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; margin-top: 6px; }

/* Details */
.rc-grid {
  margin: 0; padding: 22px 26px 8px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px 24px;
}
.rc-grid dt { font-size: 9px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--mute); }
.rc-grid dd { margin: 6px 0 0; color: #fff; font-size: 13px; word-break: break-word; }
.rc-grid .rc-sub { margin-top: 2px; font-size: 11px; color: rgb(237 237 237 / .6); }
.rc-wide { grid-column: 1 / -1; }
.rc-mono { font-size: 12px; letter-spacing: .02em; }
.rc-status { display: flex; align-items: center; gap: 8px; }
.rc-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 10px var(--ok); }

/* Perforated tear line with notches */
.rc-perf { position: relative; height: 28px; margin: 8px 0; }
.rc-perf::before {
  content: ""; position: absolute; left: 22px; right: 22px; top: 50%;
  border-top: 2px dashed rgb(255 255 255 / .16);
}
.rc-perf::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(circle at 0 50%, var(--ink) 13px, transparent 14px),
    radial-gradient(circle at 100% 50%, var(--ink) 13px, transparent 14px);
}

.rc-total { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 4px 26px 0; }
.rc-total span { font-size: 10px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; color: var(--mute); }
.rc-total b {
  font-family: var(--display); font-weight: 400; font-size: 40px; line-height: 1;
  background: linear-gradient(180deg, #fff 0%, #d4d4d4 40%, #8d8d8d 75%, #c9c9c9 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.rc-thanks { margin: 10px 26px 0; font-family: var(--hand); font-size: 26px; color: rgb(237 237 237 / .9); transform: rotate(-2deg); transform-origin: left; }

.rc-foot {
  margin-top: 22px; padding: 18px 26px 22px;
  border-top: 1px solid var(--line);
  display: grid; gap: 10px; font-size: 11px; color: rgb(237 237 237 / .7);
}
.rc-from, .rc-contact { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 14px; }
.rc-from b { color: #fff; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.rc-contact span + span::before { content: "/ "; color: var(--red); }
.rc-fine { margin: 4px 0 0; font-size: 10px; color: var(--mute); }

.ghost {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 18px; border: 1px solid var(--red); background: transparent; color: #fff;
  font: inherit; font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; text-decoration: none; cursor: pointer;
  transition: background .3s;
}
.ghost:hover { background: var(--red); }
.done .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.pay-sm { width: auto; flex: 1 1 auto; gap: 18px; padding: 15px 20px; font-size: 12px; }
.done .ghost { padding: 15px 20px; }

@media (max-width: 480px) {
  .rc-head, .rc-grid, .rc-total, .rc-foot { padding-left: 18px; padding-right: 18px; }
  .rc-hero { padding: 22px 96px 42px 18px; }
  .rc-amount { font-size: clamp(34px, 10.5vw, 48px); }
  .rc-stamp { width: 70px; height: 70px; margin-top: -44px; right: 12px; outline-offset: 3px; }
  .rc-stamp span { font-size: 19px; }
  .rc-stamp small { font-size: 6px; margin-top: 4px; }
  .rc-grid { grid-template-columns: 1fr; }
  .rc-thanks { margin-left: 18px; }
}

/* Print / Save as PDF: just the receipt, one A4 page, in the dark theme */
@page { size: A4; margin: 0; }
@media print {
  html, body {
    background: #070707 !important;
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  body > *:not(main), .intro, .done .actions, .grain { display: none !important; }
  .wrap { display: block; max-width: none; padding: 16mm 18mm; }
  .card { padding: 0 !important; border: 0 !important; background: transparent !important; box-shadow: none !important; }
  .receipt { box-shadow: none; max-width: 174mm; margin: 0 auto; break-inside: avoid; }
  .rc-amount { font-size: 72px; }
}
