/* Bitaqa design system: one set of tokens, one button pair, one card, one field, for every page.
   Palette "rose-grey-green" and type "Reddit Sans" dealt by tasteskill for a café product. */
:root {
  --bg: #ebe5e3;
  --surface: #e1dad7;
  --paper: #f8f5f3;          /* raised panels */
  --ink: #2b2622;
  --muted: #655c58;
  --line: rgba(43, 38, 34, .13);
  --line-strong: rgba(43, 38, 34, .26);
  --action: #0f7d45;
  --action-ink: #fff;
  --danger: #a33a24;
  --danger-bg: #f6e3dd;
  --ok-bg: #dcefe3;
  --gold: #f2b632;

  --font: "Reddit Sans", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;

  --r-sm: 8px; --r-md: 12px; --r-lg: 20px; --r-btn: 10px;
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px;
  --btn-h: 44px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --m-in: 150ms; --m-out: 120ms; --m-press: 90ms;

  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 400 16px/1.55 var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
h1, h2, h3 { font-weight: 500; letter-spacing: -0.02em; margin: 0; line-height: 1.15; }
h1 { font-size: clamp(28px, 2.2vw + 18px, 40px); letter-spacing: -0.03em; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
p { margin: 0; }
a { color: inherit; }
code, .mono { font-family: var(--mono); font-size: .92em; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.label { font-size: 13px; font-weight: 500; color: var(--muted); }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; padding: 0; border: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; opacity: 0; }
svg.ui { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

:focus-visible { outline: 2px solid var(--action); outline-offset: 2px; }

/* ---------- Layout ---------- */
.wrap { width: min(1200px, 100% - 2 * var(--gut, 40px)); margin-inline: auto; }
@media (max-width: 640px) { :root { --gut: 16px; } }
.stack { display: flex; flex-direction: column; gap: var(--s-4); }
.row { display: flex; align-items: center; gap: var(--s-3); }
.spread { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: var(--bg); border-bottom: 1px solid var(--line);
}
.topbar .wrap { height: 64px; display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; font-size: 19px; letter-spacing: -0.02em; }
.brand__mark { width: 30px; height: 30px; border-radius: 9px; background: var(--ink); color: var(--bg); display: grid; place-items: center; }
.brand__mark svg { width: 20px; height: 20px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 99px;
  font-size: 13px; font-weight: 500; background: var(--surface); color: var(--muted);
}
.chip--ok { background: var(--ok-bg); color: var(--action); }

/* ---------- Buttons: one primary, one secondary, one text link ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: var(--btn-h); padding: 0 20px; border-radius: var(--r-btn);
  font: 500 16px/1 var(--font); text-decoration: none; cursor: pointer; white-space: nowrap;
  border: 1px solid var(--line-strong); background: var(--paper); color: var(--ink);
  transition: transform var(--m-out) var(--ease), background-color var(--m-out) var(--ease), border-color var(--m-out) var(--ease);
}
.btn--primary { background: var(--action); border-color: var(--action); color: var(--action-ink); }
.btn--danger { color: var(--danger); }
.btn--sm { --btn-h: 40px; padding: 0 14px; font-size: 15px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn--block { width: 100%; }
@media (hover: hover) and (pointer: fine) {
  .btn:hover:not(:disabled) { transform: translateY(-1px); transition-duration: var(--m-in); border-color: var(--ink); }
  .btn--primary:hover:not(:disabled) { background: color-mix(in srgb, var(--action) 86%, var(--ink)); border-color: transparent; }
}
.btn:active:not(:disabled) { transform: translateY(1px) scale(.985); transition-duration: var(--m-press); }
.icon-btn { --btn-h: 40px; width: 40px; padding: 0; }

.link {
  color: var(--ink); text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat,
    linear-gradient(var(--line-strong), var(--line-strong)) 0 100% / 100% 1px no-repeat;
  transition: background-size var(--m-out) var(--ease);
}
.link:hover { background-size: 100% 1px, 100% 1px; transition-duration: var(--m-in); }

/* ---------- Panels and cards ---------- */
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s-5); }
.panel__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-3); margin-bottom: var(--s-4); }
.panel__head p { font-size: 14px; color: var(--muted); }
@media (max-width: 640px) { .panel { padding: var(--s-4); border-radius: var(--r-md); } }

/* ---------- Fields ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field > .label { font-size: 14px; font-weight: 500; color: var(--ink); }
.field__hint { font-size: 13px; color: var(--muted); }
.field__error { font-size: 13px; color: var(--danger); }
.input {
  width: 100%; height: 48px; padding: 0 14px; border-radius: var(--r-sm);
  border: 1px solid var(--line-strong); background: #fff; color: var(--ink);
  font: 400 16px var(--font);
  transition: border-color 140ms var(--ease), box-shadow 140ms var(--ease);
}
.input:focus { outline: none; border-color: var(--action); box-shadow: 0 0 0 3px color-mix(in srgb, var(--action) 22%, transparent); }
.input[aria-invalid="true"] { border-color: var(--danger); }
.input-group { display: flex; align-items: stretch; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: #fff; overflow: hidden; transition: border-color 140ms, box-shadow 140ms; }
.input-group:focus-within { border-color: var(--action); box-shadow: 0 0 0 3px color-mix(in srgb, var(--action) 22%, transparent); }
.input-group .input { border: 0; box-shadow: none; border-radius: 0; }
.input-group__addon { display: flex; align-items: center; padding: 0 12px; color: var(--muted); font-size: 14px; background: var(--surface); white-space: nowrap; }
.input-group button { border: 0; background: none; width: 48px; display: grid; place-items: center; color: var(--muted); cursor: pointer; }
.input-group button:hover { color: var(--ink); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-4); }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }

/* ---------- Messages ---------- */
.msg { border-radius: var(--r-md); padding: 12px 14px; font-weight: 500; font-size: 15px; display: flex; gap: 10px; align-items: flex-start; }
.msg svg.ui { margin-top: 1px; }
.msg.ok { background: var(--ok-bg); color: var(--action); }
.msg.err { background: var(--danger-bg); color: var(--danger); }
.toasts { position: fixed; z-index: 50; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; width: min(420px, calc(100% - 32px)); }
.toast { background: var(--ink); color: var(--bg); border-radius: var(--r-md); padding: 12px 16px; font-weight: 500; display: flex; gap: 10px; align-items: center;
  animation: toast-in 240ms cubic-bezier(.22, 1, .36, 1); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Wallet card (the same look as the Google Wallet pass) ---------- */
.wallet {
  --card: #6f4e37; --on: #fff;
  background: var(--card); color: var(--on);
  border-radius: 22px; overflow: hidden; width: 100%; max-width: 380px;
  box-shadow: 0 1px 0 rgba(255,255,255,.08) inset, 0 18px 40px -18px rgba(43, 38, 34, .45);
  transition: background-color 240ms var(--ease);
}
.wallet__top { display: flex; align-items: center; gap: 12px; padding: 18px 20px 6px; }
.wallet__logo { width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.14); overflow: hidden; flex: none; display: grid; place-items: center; }
.wallet__logo img { width: 100%; height: 100%; object-fit: cover; }
.wallet__issuer { font-size: 14px; font-weight: 500; opacity: .92; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wallet__title { padding: 4px 20px 14px; font-size: 22px; font-weight: 500; letter-spacing: -0.01em; }
.wallet__fields { display: flex; justify-content: space-between; gap: 12px; padding: 0 20px 16px; }
.wallet__field span { display: block; font-size: 12px; opacity: .78; }
.wallet__field b { font-size: 18px; font-weight: 500; font-variant-numeric: tabular-nums; }
.wallet__strip { display: block; width: 100%; aspect-ratio: 1032 / 336; }
.wallet__qr { padding: 18px 20px 20px; display: grid; justify-items: center; gap: 8px; }
.wallet__qr-box { background: #fff; border-radius: 14px; padding: 10px; width: 148px; aspect-ratio: 1; display: grid; place-items: center; }
.wallet__qr-box img, .wallet__qr-box svg { width: 100%; height: 100%; display: block; }
.wallet__code { font-family: var(--mono); font-size: 13px; opacity: .85; }
.wallet__note { padding: 0 20px 16px; font-size: 14px; opacity: .92; }

/* Stamps drawn in HTML (browser card, barista view) */
.stamps { display: grid; grid-template-columns: repeat(var(--per-row, 5), 1fr); gap: 10px; }
.stamp { aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; border: 2px solid rgba(255,255,255,.4); background: rgba(255,255,255,.08); }
.stamp svg { width: 58%; height: 58%; }
.stamp.on { background: #fff8ee; border-color: #fff8ee; animation: stamp-in 320ms cubic-bezier(.22, 1, .36, 1) both; }
.ready .stamp.on { box-shadow: 0 0 0 3px var(--gold); }
@keyframes stamp-in { from { transform: scale(.7); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media (max-width: 640px) { .panel__head { flex-direction: column; align-items: flex-start; gap: 2px; } }
.input-group .input:focus-visible { outline: 2px solid var(--action); outline-offset: -2px; }
.brand { min-height: 44px; }
.brand__logo { display: block; height: 28px; width: auto; }
