/* Order Buzz — shared design tokens and components */
:root {
  --ink: #1C1F3B;
  --ink-2: #4A4F73;
  --ink-3: #8A8FAD;
  --fog: #EEF1F6;
  --paper: #FFFFFF;
  --line: #D9DEEA;
  --amber: #FFB020;
  --green: #16A36A;
  --green-soft: #DDF5EA;
  --red: #E5484D;
  --red-soft: #FDE4E5;
  --blue: #3A6FF2;
  --blue-soft: #E3EBFE;
  --amber-soft: #FFF1D6;
  --brand: var(--amber);
  --on-brand: #1C1F3B;
  --font: "IBM Plex Sans", "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Bricolage Grotesque", "IBM Plex Sans Arabic", system-ui, sans-serif;
  --r-s: 8px;
  --r-m: 12px;
  --r-l: 20px;
  --shadow: 0 1px 0 rgba(28, 31, 59, .06), 0 8px 24px -12px rgba(28, 31, 59, .25);
  color-scheme: light;
}
:root[dir="rtl"] { --font: "IBM Plex Sans Arabic", "IBM Plex Sans", system-ui, sans-serif; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 16px/1.5 var(--font);
  color: var(--ink);
  background: var(--fog);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--display); line-height: 1.12; margin: 0 0 .4em; letter-spacing: -.01em; }
:root[dir="rtl"] h1, :root[dir="rtl"] h2, :root[dir="rtl"] h3 { font-family: var(--font); font-weight: 700; letter-spacing: 0; }
p { margin: 0 0 1em; }
a { color: var(--blue); }
img { max-width: 100%; }
.num { font-family: "Bricolage Grotesque", var(--font); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Buttons */
.btn {
  --bg: var(--paper); --fg: var(--ink); --bd: var(--line);
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 44px; padding: 0 18px;
  font: 600 15px/1 var(--font);
  color: var(--fg); background: var(--bg);
  border: 1.5px solid var(--bd); border-radius: var(--r-m);
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform .06s ease, background-color .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { --bg: var(--ink); --fg: #fff; --bd: var(--ink); }
.btn-brand { --bg: var(--brand); --fg: var(--on-brand); --bd: var(--brand); }
.btn-go { --bg: var(--green); --fg: #fff; --bd: var(--green); }
.btn-danger { --bg: var(--paper); --fg: var(--red); --bd: #F3B7B9; }
.btn-ghost { --bg: transparent; --bd: transparent; }
.btn-big { min-height: 56px; font-size: 17px; border-radius: var(--r-l); padding: 0 24px; }
.btn-block { display: flex; width: 100%; }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 13.5px; border-radius: var(--r-s); }

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

/* Forms */
label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-size: 13.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
label.field > small { display: block; color: var(--ink-3); font-size: 12.5px; margin-top: 4px; }
input:not([type]), input[type=tel], input[type=text], input[type=email], input[type=password], input[type=number], input[type=url],
input[type=date], input[type=search], select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px;
  font: 16px/1.3 var(--font); color: var(--ink);
  background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--r-s);
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--ink-2); outline: none; box-shadow: 0 0 0 3px rgba(58, 111, 242, .2); }
input[type=color] { width: 56px; height: 44px; padding: 3px; border: 1.5px solid var(--line); border-radius: var(--r-s); background: var(--paper); }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--ink); flex: none; }

/* Switch */
.switch { position: relative; display: inline-flex; align-items: center; gap: 12px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch i { width: 46px; height: 28px; border-radius: 99px; background: var(--line); position: relative; transition: background .15s; flex: none; }
.switch i::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: inset-inline-start .15s; }
.switch input:checked + i { background: var(--green); }
.switch input:checked + i::after { inset-inline-start: 21px; }
.switch input:focus-visible + i { outline: 3px solid var(--blue); outline-offset: 2px; }

/* Status chips */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 99px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.chip-green { color: #0C7A4E; background: var(--green-soft); }
.chip-blue { color: #2853C2; background: var(--blue-soft); }
.chip-red { color: #B4262B; background: var(--red-soft); }
.chip-amber { color: #8A5A00; background: var(--amber-soft); }
.chip-grey { color: var(--ink-2); background: var(--fog); }

/* Toasts */
#toasts { position: fixed; z-index: 1000; inset-inline: 0; bottom: 18px; display: grid; justify-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast { pointer-events: auto; max-width: 520px; background: var(--ink); color: #fff; padding: 12px 16px; border-radius: var(--r-m); box-shadow: var(--shadow); font-weight: 500; animation: toast-in .2s ease; }
.toast-ok { background: #0F7D51; }
.toast-error { background: #B4262B; }
.toast.out { opacity: 0; transform: translateY(6px); transition: .25s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* The pager ring — the signature element */
.ring {
  --size: 260px;
  --led: var(--brand);
  position: relative; width: var(--size); aspect-ratio: 1; border-radius: 50%;
  display: grid; place-items: center; isolation: isolate;
  background: var(--paper);
  box-shadow: inset 0 0 0 1px rgba(28,31,59,.08), 0 18px 40px -22px rgba(28,31,59,.45);
}
.ring::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%; z-index: -1;
  background: repeating-conic-gradient(from 0deg, var(--led) 0 7deg, transparent 7deg 15deg);
  -webkit-mask: radial-gradient(circle, transparent 0 calc(50% - 16px), #000 calc(50% - 15px) calc(50% - 5px), transparent calc(50% - 4px));
          mask: radial-gradient(circle, transparent 0 calc(50% - 16px), #000 calc(50% - 15px) calc(50% - 5px), transparent calc(50% - 4px));
  opacity: .28;
}
.ring.is-waiting::before { opacity: .8; animation: ring-chase 6s linear infinite; }
.ring.is-ready { background: var(--brand); }
.ring.is-ready::before { --led: var(--on-brand); opacity: .9; animation: ring-pulse 1s ease-in-out infinite; }
@keyframes ring-chase { to { transform: rotate(1turn); } }
@keyframes ring-pulse { 50% { opacity: .25; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition: none !important; }
}

.powered { text-align: center; font-size: 12.5px; color: var(--ink-3); padding: 18px 0 22px; }
.powered b { font-weight: 600; color: var(--ink-2); }

.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-l); padding: 20px; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--ink); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(1turn); } }
