/* DrinkTix — waveloop theme */

:root {
  /* Inks & papers */
  --ink: #e9edf2;
  --muted: #9ba6b4;
  --faint: #6d7888;
  --paper: #090b10;
  --paper-2: #0f1320;
  --panel: #121729;
  --panel-2: #161e35;
  --line: #27324b;
  --line-2: #3a4768;

  /* Accents */
  --accent: #ff7a00;
  --accent-2: #17d1ff;
  --accent-soft: #ffce40;

  /* Semantic */
  --good: #38d39f;
  --bad: #ff5d5d;
  --warn: #ffce40;

  /* Aliased to original tokens (keep for any inline-style refs in JS) */
  --bg: var(--paper);
  --text: var(--ink);
  --radius: 14px;

  /* Type */
  --font-head: 'Micro 5', ui-monospace, SFMono-Regular, monospace;
  --font-body: 'Cormorant Garamond', Georgia, serif;
  --font-brand: 'Permanent Marker', 'Brusher', 'Playlist Script', 'Bayshore', 'Selima', cursive;
  --font-ui: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;

  font-size: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100%;
}

body {
  position: relative;
  background:
    radial-gradient(circle at 15% 8%, rgba(31, 47, 83, 0.6) 0%, transparent 42%),
    radial-gradient(circle at 88% 18%, rgba(74, 47, 30, 0.55) 0%, transparent 38%),
    radial-gradient(circle at 50% 110%, rgba(23, 209, 255, 0.08) 0%, transparent 55%),
    linear-gradient(150deg, #05070d 0%, #0c1222 48%, #08090f 100%);
  background-attachment: fixed;
  overflow-x: hidden;
}

/* Subtle grid wash — fades to clear at the edges */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(circle at center, black 35%, transparent 80%);
  -webkit-mask-image: radial-gradient(circle at center, black 35%, transparent 80%);
  z-index: 0;
}

.app {
  position: relative;
  z-index: 1;
  max-width: 540px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 0 12px 96px;
}

/* Topbar — sticky with backdrop blur, like waveloop */
header.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 8px;
  margin: 0 -12px 16px;
  padding-left: 20px;
  padding-right: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(7, 10, 18, 0.72);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-brand);
  font-size: 1.6rem;
  letter-spacing: 0.02em;
  text-transform: lowercase;
  color: var(--ink);
}
.brand .dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent), 0 0 24px rgba(255, 122, 0, 0.4);
  font-size: 0;
  line-height: 0;
}

.role-tag {
  font-family: var(--font-head);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-2);
  border: 1px solid rgba(23, 209, 255, 0.35);
  background: rgba(23, 209, 255, 0.08);
  padding: 5px 12px;
  border-radius: 999px;
}

/* Headings */
h1, h2, h3 { margin: 0 0 12px; font-family: var(--font-head); letter-spacing: 0.08em; text-transform: uppercase; font-weight: 400; line-height: 1.1; }
h1 { font-size: 2rem; }
h2 { font-size: 1.45rem; letter-spacing: 0.1em; }
h3 { font-size: 0.82rem; letter-spacing: 0.16em; color: var(--muted); }

.muted { color: var(--muted); font-family: var(--font-ui); }
.center { text-align: center; }

/* Card — waveloop's product-card gradient + subtle outer shadow */
.card {
  background: linear-gradient(145deg, rgba(24, 32, 53, 0.85), rgba(13, 17, 31, 0.88));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  padding: 18px;
  margin: 0 0 14px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  font-family: var(--font-ui);
}

/* Buttons */
.btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  padding: 13px 18px;
  border-radius: 999px;
  font-family: var(--font-head);
  font-size: 0.95rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  width: 100%;
  transition: filter 0.15s ease, transform 0.05s ease;
}
.btn:hover { filter: brightness(1.1); }
.btn:active { transform: translateY(1px); }

.btn.primary {
  color: #1a0c00;
  background: linear-gradient(135deg, #ff7a00, #ffce40);
  border-color: transparent;
  box-shadow: 0 8px 20px -8px rgba(255, 122, 0, 0.55);
}
.btn.accent {
  color: #042029;
  background: linear-gradient(135deg, #17d1ff, #6be5e0);
  border-color: transparent;
  box-shadow: 0 8px 20px -8px rgba(23, 209, 255, 0.5);
}
.btn.ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.18);
  color: var(--ink);
}
.btn.danger {
  color: var(--bad);
  border-color: rgba(255, 93, 93, 0.55);
  background: rgba(255, 93, 93, 0.06);
}
.btn.sm { padding: 8px 14px; font-size: 0.78rem; width: auto; }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; }

/* Forms */
input, select {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--ink);
  padding: 13px 14px;
  border-radius: 12px;
  font-family: var(--font-body);
  font-size: 1.05rem;
  margin-bottom: 10px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus {
  outline: none;
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(23, 209, 255, 0.18);
}
input::placeholder { color: var(--faint); }
label.field {
  display: block;
  font-family: var(--font-head);
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

/* Lists */
.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  gap: 12px;
  font-family: var(--font-ui);
}
.list-item:last-child { border-bottom: none; }

/* Balances — mono tabular, semantic color */
.bal {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--ink);
}
.bal.pos { color: var(--good); }
.bal.zero { color: var(--muted); }

.big-balance {
  font-family: var(--font-head);
  font-size: 3.4rem;
  letter-spacing: 0.04em;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  text-shadow: 0 0 24px rgba(255, 122, 0, 0.35);
  line-height: 1;
}

/* Pills */
.pill {
  font-family: var(--font-head);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--muted);
}
.pill.low { color: var(--bad); border-color: rgba(255, 93, 93, 0.5); }

/* QR */
.qr-wrap { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.qr-wrap img {
  background: #fff;
  padding: 12px;
  border-radius: 14px;
  box-shadow: 0 0 0 1px rgba(23, 209, 255, 0.2), 0 0 24px -4px rgba(23, 209, 255, 0.25);
}
.code-mono {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  word-break: break-all;
}

/* Tabs */
.tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.tabs button {
  flex: 1;
  padding: 11px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-family: var(--font-head);
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.tabs button:hover { color: var(--ink); border-color: rgba(255, 255, 255, 0.25); }
.tabs button.active {
  background: linear-gradient(135deg, rgba(255, 122, 0, 0.18), rgba(23, 209, 255, 0.12));
  color: var(--ink);
  border-color: rgba(255, 122, 0, 0.5);
  box-shadow: 0 6px 18px -8px rgba(255, 122, 0, 0.45);
}

/* Scanner */
.scanner {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.scanner video { width: 100%; display: block; }
.scanner .frame {
  position: absolute;
  inset: 12% 12%;
  border: 3px solid var(--accent-2);
  border-radius: 14px;
  box-shadow:
    0 0 0 100vmax rgba(0, 0, 0, 0.4),
    0 0 24px rgba(23, 209, 255, 0.5),
    inset 0 0 14px rgba(23, 209, 255, 0.25);
  animation: scanPulse 2.4s ease-in-out infinite;
}
@keyframes scanPulse {
  0%, 100% { box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.4), 0 0 14px rgba(23, 209, 255, 0.35), inset 0 0 12px rgba(23, 209, 255, 0.18); }
  50% { box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.4), 0 0 32px rgba(23, 209, 255, 0.7), inset 0 0 22px rgba(23, 209, 255, 0.4); }
}
canvas.hidden { display: none; }

/* Quantity steppers */
.stepper { display: flex; align-items: center; gap: 12px; }
.stepper button {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
  font-family: var(--font-head);
  font-size: 1.3rem;
  cursor: pointer;
  transition: filter 0.15s;
}
.stepper button:hover { filter: brightness(1.2); }
.qty {
  min-width: 24px;
  text-align: center;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 1.05rem;
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  background: rgba(13, 17, 31, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--ink);
  padding: 14px 20px;
  border-radius: 12px;
  z-index: 50;
  max-width: 90%;
  font-family: var(--font-ui);
  font-size: 0.95rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
}
.toast.show { opacity: 1; }
.toast.good {
  border-color: rgba(56, 211, 159, 0.55);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55), 0 0 24px -4px rgba(56, 211, 159, 0.35);
}
.toast.bad {
  border-color: rgba(255, 93, 93, 0.6);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55), 0 0 24px -4px rgba(255, 93, 93, 0.4);
}

/* Spacing utility — preserved from original (margin-only, no fixed height) */
.spacer { margin-top: 12px; }

/* Brand hero — top of login screen (image + title) */
.brand-hero {
  text-align: center;
  padding: 20px 16px 22px;
}
.brand-hero .hero-img {
  display: block;
  width: 78%;
  max-width: 320px;
  height: auto;
  margin: 0 auto 12px;
  border-radius: 50%;
  box-shadow: 0 18px 40px -10px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.06);
}
.brand-hero .brand-title {
  font-family: var(--font-brand);
  font-size: 3.4rem;
  text-transform: lowercase;
  letter-spacing: 0.01em;
  line-height: 0.95;
  color: var(--ink);
  margin: 6px 0 14px;
  text-shadow: 0 4px 24px rgba(255, 122, 0, 0.25);
}
.brand-hero .brand-title em {
  font-style: normal;
  color: #b78cff;
}
.brand-hero p { margin: 0; }

/* Totals row */
.totals {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-head);
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 12px;
}
.totals .bal { font-size: 1.15rem; color: var(--accent); }

/* ───────────────────────────────────────────────────────────────────────
   drinktix wordmark + body font overrides (logo-matching). Appended last so
   they win the cascade over the base theme above.
   ─────────────────────────────────────────────────────────────────────── */
@font-face {
  font-family: 'Kaushan Script';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../vendor/fonts/kaushan-script.woff2) format('woff2');
}

:root { --purple: #b388e0; }

/* Body font: Avenir Next (native on iPad/Apple), with graceful fallbacks. */
:root { --font-ui: 'Avenir Next', 'Avenir', -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, sans-serif; }

/* Title wordmark — brush script to match the logo, lowercase, purple final x */
.brand {
  font-family: 'Kaushan Script', cursive;
  font-size: 1.8rem;
  letter-spacing: 0;
  text-transform: none;
}
.wordmark {
  font-family: 'Kaushan Script', cursive;
  font-size: 2.8rem;
  letter-spacing: 0;
  text-transform: none;
  font-weight: 400;
  line-height: 1.1;
}
.brand .x, .wordmark .x { color: var(--purple); }

/* ───────────────────────────────────────────────────────────────────────
   LIGHT THEME — much lighter palette. Appended last to override the dark
   base. Flips paper/ink + the dark-specific literals (body bg, cards,
   topbar, inputs, borders).
   ─────────────────────────────────────────────────────────────────────── */
:root {
  --paper: #f6f2ea;     /* warm cream, nods to the logo */
  --paper-2: #efe8dc;
  --panel: #ffffff;
  --panel-2: #f4efe6;
  --ink: #1d2128;
  --muted: #5f6b7a;
  --faint: #9aa4b2;
  --line: rgba(20, 24, 31, 0.12);
  --line-2: rgba(20, 24, 31, 0.20);
  --accent-2: #0aa6cf;  /* darker cyan for contrast on light */
}

body {
  background:
    radial-gradient(circle at 12% 6%, rgba(255, 206, 64, 0.20) 0%, transparent 42%),
    radial-gradient(circle at 88% 14%, rgba(255, 122, 0, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 50% 110%, rgba(10, 166, 207, 0.10) 0%, transparent 55%),
    linear-gradient(160deg, #fbf7f0 0%, #f4eee4 50%, #f7f3ec 100%);
}
/* Lighten the grid wash so it reads as a faint texture on cream */
body::before {
  background-image:
    linear-gradient(rgba(20, 24, 31, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 24, 31, 0.04) 1px, transparent 1px);
}

header.topbar {
  background: rgba(251, 247, 240, 0.82);
  border-bottom: 1px solid var(--line);
}

.card {
  background: linear-gradient(145deg, #ffffff, #f6f1e8);
  border: 1px solid var(--line);
  box-shadow: 0 8px 22px rgba(31, 27, 20, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

input, select {
  background: #ffffff;
  border: 1px solid var(--line-2);
  color: var(--ink);
}
input::placeholder { color: var(--faint); }

.btn {
  background: rgba(20, 24, 31, 0.04);
  border: 1px solid var(--line-2);
  color: var(--ink);
}
.btn.ghost { background: transparent; border-color: var(--line-2); color: var(--ink); }

.list-item { border-bottom: 1px solid var(--line); }
.pill { border: 1px solid var(--line-2); color: var(--muted); }
.tabs button { background: var(--panel-2); }

.brand { color: var(--ink); }
.big-balance { text-shadow: none; }

/* ───────────────────────────────────────────────────────────────────────
   Drop Micro 5 — use the body font (Avenir Next) but bold for headings/UI.
   The brush-script wordmark (.brand/.wordmark) is intentionally left alone.
   ─────────────────────────────────────────────────────────────────────── */
:root {
  --font-head: 'Avenir Next', 'Avenir', -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, sans-serif;
}
h1, h2, h3 { text-transform: none; letter-spacing: 0; font-weight: 700; }
h3 { letter-spacing: 0.02em; }
.btn { text-transform: none; letter-spacing: 0; font-weight: 700; }
label.field { text-transform: none; letter-spacing: 0.02em; font-weight: 700; }
.role-tag { text-transform: none; letter-spacing: 0.02em; font-weight: 700; }
.pill { text-transform: none; letter-spacing: 0.02em; font-weight: 700; }
.big-balance { font-weight: 800; letter-spacing: 0; }
/* keep the brush wordmark on its own font */
.brand, .wordmark { font-family: 'Kaushan Script', cursive; }

/* Wordmark must read as one word: the base .brand is display:flex with a gap,
   which split "drinkti" and the <span>x</span> into two gapped flex items. */
.brand { display: inline-block; gap: 0; }
/* Kaushan's 'i' and 'x' carry wide side-bearings, so the boxes touch but the
   ink looks split. Pull the x in so the wordmark reads as one word. */
.brand .x, .wordmark .x { margin-left: -0.18em; }
