/* ==========================================================================
   Base — reset, typography, global utilities
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background var(--dur-med) var(--ease), color var(--dur-med) var(--ease);
}

h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  color: var(--text-primary);
  margin: 0 0 var(--sp-2);
  line-height: 1.2;
  letter-spacing: -0.01em;
}
h1 { font-size: var(--fs-3xl); font-weight: 650; }
h2 { font-size: var(--fs-2xl); font-weight: 650; }
h3 { font-size: var(--fs-xl); font-weight: 600; }
h4 { font-size: var(--fs-lg); font-weight: 600; }
p  { margin: 0 0 var(--sp-3); color: var(--text-secondary); }

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }

img, svg { display: block; max-width: 100%; }

/* Tabular figures for every currency amount, everywhere */
.money, .mono, .t9-table td.num, input[data-type="currency"] {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

::selection { background: var(--brand); color: #fff; }

/* Scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--scrollbar) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: var(--scrollbar); border-radius: var(--r-pill); }

/* Visible keyboard focus, always */
:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---- Layout utilities ---- */
.container { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 var(--sp-6); }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: var(--sp-1); } .gap-2 { gap: var(--sp-2); } .gap-3 { gap: var(--sp-3); }
.gap-4 { gap: var(--sp-4); } .gap-5 { gap: var(--sp-5); } .gap-6 { gap: var(--sp-6); }
.grid { display: grid; gap: var(--sp-5); }
.hidden { display: none !important; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.w-full { width: 100%; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ---- Perforated "receipt-stub" edge — the visual signature ---- */
.stub-edge {
  position: relative;
}
.stub-edge::before {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 14px;
  background-image: radial-gradient(circle at 10px 0, transparent 6px, var(--bg) 6.5px);
  background-size: 20px 14px;
  background-repeat: repeat-x;
}

/* ---- Stamp badge (rotated, dashed ring) — used for Paid/Verified ---- */
.stamp {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: 3px var(--sp-3);
  border: 1.5px dashed currentColor;
  border-radius: var(--r-pill);
  font-family: var(--font-display);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transform: rotate(-2deg);
}
