/* The pawner portal. Large type and large targets on purpose: the people
   reading this are often older, on a small phone, in a hurry to pay. System
   fonts only -- loading a web font would tell a third party every time a
   pawner opens their tickets. */

:root {
  --ink: #14213D;
  --ink-2: #3D4A63;
  --muted: #6B665E;
  --ground: #F2EFE9;
  --surface: #FFFFFF;
  --surface-2: #FAF8F4;
  --brass: #A8743A;
  --brass-ink: #FFFFFF;
  --line: #E0DACE;
  --line-2: #EFEBE3;
  --alert: #A32C2C;
  --alert-bg: #FAEDEC;
  --warn: #8A5410;
  --warn-bg: #FBF1E3;
  --radius: 12px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #ECEAE5;
    --ink-2: #B3BAC7;
    --muted: #98948C;
    --ground: #0E131C;
    --surface: #171E2A;
    --surface-2: #1C2431;
    --brass: #D69A57;
    --brass-ink: #1A1204;
    --line: #2B3444;
    --line-2: #232B39;
    --alert: #EE8A82;
    --alert-bg: #2B1817;
    --warn: #DDA35A;
    --warn-bg: #2A2013;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "PingFang SC",
               "Microsoft YaHei", sans-serif;
  font-size: 17px;
  line-height: 1.55;
}

a { color: var(--brass); }

:focus-visible { outline: 3px solid var(--brass); outline-offset: 2px; }

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

/* The shop name gives way; the language switch does not. A long
   registered name used to push EN off the right of a 375px phone,
   where nothing could scroll to reach it, so an English-reading
   pawner had no way back to English. */
.shop { font-weight: 700; font-size: 16px; min-width: 0; overflow-wrap: anywhere; }

.lang { display: flex; flex: none; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.lang a {
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  border-right: 1px solid var(--line);
}
.lang a:last-child { border-right: 0; }
.lang a[aria-current="true"] { background: var(--ink); color: var(--surface); }

.page {
  max-width: 480px;
  margin: 0 auto;
  padding: 22px 16px 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

h1 { font-size: 26px; line-height: 1.25; margin: 0; text-wrap: balance; }

.lead { margin: 0; color: var(--ink-2); }

.card {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

label { font-weight: 600; font-size: 16px; }

input[type="text"] {
  width: 100%;
  font: inherit;
  font-size: 20px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--ink);
}

input.code { letter-spacing: 0.3em; text-align: center; font-size: 26px; font-variant-numeric: tabular-nums; }

button {
  font: inherit;
  font-weight: 700;
  font-size: 18px;
  min-height: 54px;
  padding: 12px 18px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--brass);
  color: var(--brass-ink);
  cursor: pointer;
}

button.ghost {
  min-height: 44px;
  font-size: 15px;
  font-weight: 600;
  background: transparent;
  color: var(--ink-2);
  border-color: var(--line);
}

.error { margin: 0; color: var(--alert); background: var(--alert-bg); padding: 10px 12px; border-radius: 8px; }

.warning { margin: 0; color: var(--warn); background: var(--warn-bg); padding: 10px 12px; border-radius: 8px; font-weight: 600; }

.note { margin: 0; color: var(--muted); font-size: 15px; }
.note.pay { color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line-2); padding: 14px; border-radius: var(--radius); }

.greet { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.greet p { margin: 4px 0 0; color: var(--ink-2); }
.greet form { margin: 0; }

.ticket {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ticket.is-late { border-color: var(--warn); }

/* The status pill drops below the number when there is no room beside it,
   rather than the ticket number being broken across two lines. */
.ticket header { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 10px; }

.k { display: block; font-size: 13px; font-weight: 600; letter-spacing: 0.04em; color: var(--muted); }

.no { display: block; font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }

.pill {
  flex: none;
  font-size: 13px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink-2);
}
.is-late .pill { background: var(--warn-bg); border-color: transparent; color: var(--warn); }

.amount { display: flex; flex-direction: column; gap: 2px; }
.big { font-size: 36px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.sub { color: var(--muted); font-size: 15px; }

dl { margin: 0; border-top: 1px solid var(--line-2); }
dl div { display: flex; justify-content: space-between; gap: 14px; padding: 8px 0; border-bottom: 1px solid var(--line-2); }
dl div:last-child { border-bottom: 0; }
/* A long item list must not squeeze the label beside it into one
   character per line. */
dt { flex: none; color: var(--muted); }
dd { margin: 0; min-width: 0; text-align: right; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }

.foot { max-width: 480px; margin: 0 auto; padding: 0 16px 32px; color: var(--muted); font-size: 14px; }

/* The one thing on the card a pawner is meant to press. Full width and tall
   enough for a thumb, because most of them are on a phone held one-handed,
   and some are holding the pawn ticket in the other hand. */
/* The pay button, and the one link that has to look like it. */
button.pay, a.pay {
  width: 100%;
  margin-top: 2px;
  padding: 15px 16px;
  font-size: 17px;
  font-weight: 700;
  font-family: inherit;
  color: var(--brass-ink);
  background: var(--brass);
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
}
button.pay:hover { filter: brightness(1.06); }
button.pay:active { transform: translateY(1px); }
button.pay:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }

/* An anchor styled as the pay button needs saying out loud: inline is the
   default, so width and vertical padding do nothing until it is a block. */
a.pay { display: block; text-align: center; text-decoration: none; }
a.pay:hover { filter: brightness(1.06); }
a.pay:active { transform: translateY(1px); }
a.pay:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }

/* ---- the public pages ---------------------------------------------------
   The front page, the three policy pages and the shop's own particulars.
   A stranger reads these: somebody deciding whether the site is real, or a
   payment processor's reviewer looking for a company number. They are the
   only pages here that are not noindex. */

h2 { font-size: 18px; line-height: 1.35; margin: 0; color: var(--ink); }
.card h2 { margin-top: 2px; }
.card h2 ~ h2 { margin-top: 10px; }

.shop-id {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
}
.shop-id dd { text-align: left; overflow-wrap: anywhere; }
.shop-id dl div { gap: 18px; }
.shop-id dd a { overflow-wrap: anywhere; }

/* Can and cannot, told apart without relying on colour alone. */
ul.ticks, ul.crosses, .warning-box ul, .policy ul { margin: 0; padding-left: 1.35em; }
ul.ticks li, ul.crosses li { padding-left: 2px; }
ul.ticks { list-style: none; padding-left: 0; }
ul.ticks li { padding-left: 1.6em; position: relative; }
ul.ticks li::before { content: "\2713"; position: absolute; left: 0; font-weight: 700; color: var(--brass); }
ul.crosses { list-style: none; padding-left: 0; }
ul.crosses li { padding-left: 1.6em; position: relative; }
ul.crosses li::before { content: "\00D7"; position: absolute; left: 0; font-weight: 700; font-size: 19px; line-height: 1.2; color: var(--muted); }
ul.ticks li + li, ul.crosses li + li, .warning-box li + li, .policy li + li { margin-top: 7px; }

ol.steps { margin: 0; padding-left: 1.3em; }
ol.steps li { padding-left: 2px; }
ol.steps li + li { margin-top: 7px; }

/* The phishing advice. It is the one thing on the front page that is worth
   interrupting somebody for, so it is the one thing that is not a card. */
.warning-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  color: var(--warn);
  background: var(--warn-bg);
  border: 1px solid var(--warn);
  border-radius: var(--radius);
}
.warning-box h2 { color: inherit; }

.policy { gap: 4px; }
.policy h2 { margin-top: 14px; }
.policy h2:first-child { margin-top: 0; }
.policy p { margin: 0; color: var(--ink-2); }
.policy ul { color: var(--ink-2); }

.shop a { color: inherit; text-decoration: none; }

.foot { display: flex; flex-direction: column; gap: 10px; }
.foot p { margin: 0; }
.legal { display: flex; flex-wrap: wrap; gap: 6px 16px; }

/* The number a login code was sent for, shown back. Large and spaced like
   the card itself, because the reader is comparing it digit by digit
   against the MyKad in their other hand. */
.ic-echo {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  padding: 14px 16px;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
}
.ic-echo .k { flex-basis: 100%; }
.ic-echo-value {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.ic-echo a { font-size: 15px; }
