/* ============================================================
   Design system — tokens and base styles shared by the kiosk
   (index.html) and the staff dashboard (dashboard.html).

   Brand color: every accent token below is derived at runtime from the
   location's LOCATION_ACCENT by ui/theme.js (text on accent is chosen
   for WCAG AA automatically). The values here are only defaults.
   Neutrals and status colors are brand-independent.
============================================================ */
:root {
  /* Neutrals: a warm gray that sits well with any accent */
  --color-bg:            #F6F5F2;
  --color-surface:       #FFFFFF;
  --color-surface-muted: #F1EFEB;
  --color-surface-hover: #F8F7F4;
  --color-border:        #E3E0DA;
  --color-border-strong: #CBC7BF;
  --color-text:          #1B1A17;
  --color-text-muted:    #5C5852;   /* 6.9:1 on white */
  --color-text-subtle:   #6F6A63;   /* 5.3:1 on white; captions */
  --color-disabled-bg:   #ECEAE6;
  --color-disabled-text: #8E8981;
  --color-overlay:       rgb(23 21 18 / 0.48);

  /* Status */
  --color-danger:         #B42318;
  --color-danger-hover:   #9A1D14;
  --color-danger-bg:      #FEF3F2;
  --color-danger-border:  #F3C4BF;
  --on-danger:            #FFFFFF;   /* text on danger fills, 6.6:1 */
  --color-success:        #157A43;
  --color-success-bg:     #EDF7F1;
  --color-success-border: #B3DFC4;

  /* Accent: overridden from LOCATION_ACCENT by ui/theme.js. These defaults
     are theme.js's palette for its neutral DEFAULT_ACCENT (#45413B), never a
     shop's colour. */
  --accent:               #45413B;  /* the brand color as configured */
  --accent-rgb:           69 65 59;
  --accent-solid:         #45413B;  /* fills (buttons); AA with --on-accent */
  --accent-hover:         #3E3B35;
  --accent-pressed:       #37342F;
  --on-accent:            #FFFFFF;
  --accent-ink:           #45413B;  /* accent as text/icons on light surfaces, AA */
  --accent-subtle:        #ECECEB;  /* selected/tinted backgrounds */
  --accent-subtle-strong: #DAD9D8;
  --accent-border:        #A2A09D;  /* selected borders */
  --focus-ring:           rgb(69 65 59 / 0.45);

  /* Typography */
  --font-sans:    'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'DM Serif Display', Georgia, serif;
  --text-display: clamp(30px, 1.6vw + 22px, 44px);
  --text-title:   clamp(24px, 0.6vw + 21px, 30px);
  --text-heading: 18px;
  --text-body:    16px;
  --text-label:   14px;
  --text-caption: 13px;
  --text-micro:   12px;
  --leading-tight: 1.2;
  --leading-snug:  1.35;
  --leading-body:  1.5;

  /* Spacing: a 4/8 px scale */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* Radii */
  --radius-sm: 8px;    /* chips, small controls */
  --radius-md: 12px;   /* buttons, inputs */
  --radius-lg: 16px;   /* cards, panels */
  --radius-xl: 20px;   /* dialogs */

  /* Elevation */
  --shadow-1: 0 1px 2px rgb(23 21 18 / 0.06), 0 1px 1px rgb(23 21 18 / 0.03);
  --shadow-2: 0 6px 16px rgb(23 21 18 / 0.08), 0 2px 4px rgb(23 21 18 / 0.04);
  --shadow-3: 0 24px 56px rgb(23 21 18 / 0.20), 0 6px 16px rgb(23 21 18 / 0.08);

  /* Motion */
  --duration-fast: 150ms;
  --duration-base: 200ms;
  --duration-slow: 250ms;
  --ease:          cubic-bezier(0.2, 0, 0, 1);

  /* Sizing */
  --control-height: 52px;   /* text inputs, selects */
  --button-height:  56px;   /* primary actions */
  --touch-min:      44px;   /* smallest tap target */
  --icon-size:      20px;
}

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

body {
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: var(--leading-body);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button, input, select, textarea { font: inherit; color: inherit; }

/* One focus treatment everywhere; only for keyboard/assistive focus. */
:focus { outline: none; }
:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

/* ---------- Icons (ui/icons.js sprite) ---------- */
.icon {
  width: var(--icon-size);
  height: var(--icon-size);
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: middle;
}
.icon-sm { --icon-size: 16px; }
.icon-lg { --icon-size: 24px; }
.icon-xl { --icon-size: 32px; }

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

/* Visually hidden, still announced by screen readers */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
