/* =============================================================================
   base.css — design tokens, reset, typography, layout primitives
   Shared by every page. Change the look of the whole product HERE:
   edit the custom properties in :root and everything follows.
   ============================================================================= */

:root {
  /* Colour — warm paper background, deep green brand, saffron for attention */
  --bg:            #f6f4ee;
  --surface:       #ffffff;
  --surface-sunk:  #efece3;
  --ink:           #1d2a22;
  --ink-muted:     #5f6b63;
  --line:          #e2ded2;
  --line-strong:   #cfc9b8;

  --brand:         #1f6b43;
  --brand-strong:  #17512f;
  --brand-soft:    #e3f0e8;
  --on-brand:      #ffffff;

  --accent:        #c97a14;
  --accent-soft:   #fbefd9;

  --danger:        #b3392f;
  --danger-soft:   #f8e4e1;
  --info:          #2b6a9e;
  --info-soft:     #e2eef7;
  --ok:            #2b7a4b;
  --ok-soft:       #e3f1e8;

  /* Type */
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --text-xs: 0.75rem;
  --text-sm: 0.8125rem;
  --text-md: 0.9375rem;
  --text-lg: 1.125rem;
  --text-xl: 1.5rem;
  --text-2xl: 2rem;

  /* Space & shape */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(29, 42, 34, 0.06);
  --shadow:    0 4px 16px rgba(29, 42, 34, 0.08);
  --shadow-lg: 0 18px 48px rgba(29, 42, 34, 0.18);

  --focus-ring: 0 0 0 3px rgba(31, 107, 67, 0.35);
  --header-h: 60px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--text-md);
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -0.015em; }
h1 { font-size: var(--text-xl); }
h2 { font-size: var(--text-lg); }
h3 { font-size: var(--text-md); }
p  { margin: 0; }
a  { color: var(--brand); }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
table { border-collapse: collapse; width: 100%; }

:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--radius-sm); }

[hidden] { display: none !important; }

/* Numbers that line up in columns (prices, quantities, totals) */
.num, .money { font-variant-numeric: tabular-nums; }
.money { font-weight: 600; }

.muted  { color: var(--ink-muted); }
.small  { font-size: var(--text-sm); }
.tiny   { font-size: var(--text-xs); }
.right  { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Layout helpers */
.stack   > * + * { margin-top: var(--space-4); }
.stack-sm > * + * { margin-top: var(--space-2); }
.row     { display: flex; align-items: center; gap: var(--space-3); }
.row-wrap { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.spread  { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.grow    { flex: 1 1 auto; min-width: 0; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
