:root {
  --purple: #431E75;
  --purple-hover: #391963;
  --purple-deep: #281246;
  --lavender: #BEB4D5;
  --lavender-2: #E0D9EC;
  --lavender-3: #F3F0F8;
  --bg: #FFFFFF;
  --surface: #FFFFFF;
  --line: #E6E1EF;
  --line-2: #D9D9D9;
  --text: #121212;
  --muted: #6E6585;
  --reward: #3DA5F4;
  --reward-deep: #1C7FD0;
  --danger: #DC3545;
  --radius: 18px;
  --radius-lg: 28px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --font-body: "Quicksand", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head: "MuseoModerno", "Quicksand", system-ui, sans-serif;
  color-scheme: light;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

a { color: var(--purple); text-decoration: none; }

.wrap {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Top bar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 0;
}
.topbar .brand img { height: 32px; width: auto; }
.topbar .tagline {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-align: right;
}

/* Type */
.eyebrow {
  display: inline-block;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--purple);
  background: var(--lavender-2);
  border-radius: 999px;
}

h1, h2 { font-family: var(--font-head); color: var(--purple); }
h1 {
  margin: 14px 0 12px;
  font-size: clamp(36px, 9vw, 60px);
  line-height: 1;
  letter-spacing: -0.02em;
  font-weight: 700;
}
h1 .hl { color: var(--reward); }
h2 {
  margin: 0 0 6px;
  font-size: 24px;
  letter-spacing: -0.01em;
  font-weight: 600;
}
.lead {
  margin: 0;
  font-size: 18px;
  color: #3B3450;
  max-width: 36ch;
}
.muted { color: var(--muted); }

/* Stamp dots (shared by signup, pass, staff) */
.stamp {
  --size: 38px;
  flex: 0 0 auto;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 2px solid var(--lavender);
  color: var(--purple);
  transition: background .3s var(--ease), border-color .3s var(--ease), transform .3s var(--ease);
}
.stamp svg { width: 56%; height: 56%; opacity: 0; transition: opacity .2s; }
.stamp.on { background: var(--lavender); border-color: var(--lavender); }
.stamp.on svg { opacity: 1; }
.stamp.gift { border: 2px dashed var(--reward); color: var(--reward); }
.stamp.gift svg { opacity: 1; width: 50%; height: 50%; }
.stamp.gift.on { background: var(--reward); border: 2px solid var(--reward); color: #fff; }

/* Form card */
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  box-shadow: 0 24px 48px -28px rgba(67, 30, 117, .35);
}
@media (min-width: 600px) { .card { padding: 32px; } }

.field { display: block; margin-bottom: 14px; }
.field > span {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 700;
  color: var(--purple);
}
.field input,
.field textarea {
  display: block;
  width: 100%;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  background: var(--lavender-3);
  border: 1.5px solid transparent;
  border-radius: 14px;
  outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.field input { height: 52px; padding: 0 16px; }
.field textarea { min-height: 84px; padding: 12px 16px; line-height: 1.45; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: #A59CBB; font-weight: 500; }
.field input:focus, .field textarea:focus {
  border-color: var(--purple);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(67, 30, 117, .12);
}

.consent {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 18px 0 22px;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--muted);
  cursor: pointer;
}
.consent input {
  appearance: none;
  -webkit-appearance: none;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  margin: 0;
  border-radius: 7px;
  border: 1.5px solid var(--lavender);
  background: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background .2s, border-color .2s, box-shadow .2s;
}
.consent input::after {
  content: "";
  width: 6px;
  height: 11px;
  border: solid #fff;
  border-width: 0 2.5px 2.5px 0;
  transform: translateY(-1px) rotate(45deg) scale(0);
  transition: transform .18s var(--ease);
}
.consent input:checked { background: var(--purple); border-color: var(--purple); }
.consent input:checked::after { transform: translateY(-1px) rotate(45deg) scale(1); }
.consent input:focus-visible { box-shadow: 0 0 0 4px rgba(67, 30, 117, .18); }
.consent a { color: var(--purple); text-decoration: underline; text-underline-offset: 2px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 54px;
  padding: 0 28px;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: transform .15s var(--ease), background .2s, box-shadow .25s var(--ease), opacity .2s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.98); }
.btn-primary {
  width: 100%;
  color: #fff;
  background: var(--purple);
  box-shadow: 0 12px 28px -12px rgba(67, 30, 117, .6);
}
.btn-primary:hover { background: var(--purple-hover); }
.btn-primary[disabled] { opacity: .7; cursor: progress; }

/* ---------- Signup ---------- */
.signup {
  display: grid;
  min-height: 100svh;
}
.signup-photo {
  position: relative;
  min-height: 240px;
  background: var(--purple) url("img/hero-juice.webp") center / cover no-repeat;
}
.signup-photo .sticker {
  position: absolute;
  left: 20px;
  bottom: -26px;
  display: grid;
  place-items: center;
  width: 104px;
  height: 104px;
  padding: 12px;
  text-align: center;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 15px;
  line-height: 1.05;
  color: #fff;
  background: var(--reward);
  border: 4px solid #fff;
  border-radius: 50%;
  transform: rotate(-10deg);
  box-shadow: 0 12px 24px -10px rgba(0, 0, 0, .35);
}
.signup-photo .sticker b { display: block; font-size: 28px; }
.signup-main {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 48px 20px 36px;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
}
.signup-logo { height: 36px; width: auto; align-self: flex-start; }
.signup-main h1 { margin: 6px 0 8px; }
.signup-main form { display: flex; flex-direction: column; gap: 16px; }
.signup-main .field, .signup-main .consent { margin: 0; }
.signup-main .consent { margin-top: 4px; }
.signup-main .btn { margin-top: 6px; }
.explainer { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.explainer .stamp { --size: 34px; }
.explainer .plus { color: var(--muted); font-weight: 700; padding: 0 2px; }

@media (min-width: 900px) {
  .signup { grid-template-columns: 1fr 1fr; }
  .signup-photo { min-height: 100svh; position: sticky; top: 0; }
  .signup-photo .sticker { left: auto; right: -52px; bottom: auto; top: 18%; width: 124px; height: 124px; font-size: 17px; }
  .signup-photo .sticker b { font-size: 34px; }
  .signup-main { justify-content: center; padding: 56px 48px; }
}

/* ---------- Card page ---------- */
.ready {
  display: grid;
  gap: 32px;
  padding: 8px 0 40px;
}
@media (min-width: 900px) {
  .ready {
    grid-template-columns: minmax(0, 420px) minmax(0, 1fr);
    gap: 72px;
    align-items: start;
    padding: 32px 0 64px;
  }
  .ready .pass-col { order: 2; position: sticky; top: 32px; }
  .ready .info-col { order: 1; padding-top: 16px; }
}
.ready h1 { font-size: clamp(34px, 8vw, 54px); }
/* Mobile: the real card goes into Wallet, so the preview is desktop-only and the wallet button is the main action. */
@media (max-width: 899px) {
  .ready .pass-col { display: none; }
  .ready { padding-top: 12px; }
  .ready .wallet-buttons { max-width: none; margin-top: 24px; }
  .ready .wallet-item:first-child .wallet-btn { height: 64px; }
  .ready .wallet-item:first-child .wallet-btn .txt b { font-size: 19px; }
  .ready .section-title { margin-top: 48px; }
}

.pass-col { display: flex; justify-content: center; }

.pass {
  position: relative;
  width: 100%;
  max-width: 360px;
  border-radius: 20px;
  background: var(--purple);
  color: #fff;
  overflow: hidden;
  box-shadow: 0 40px 80px -30px rgba(67, 30, 117, .65);
  animation: passIn .7s var(--ease) both;
}
@keyframes passIn {
  from { opacity: 0; transform: translateY(18px) rotate(-1.5deg) scale(.98); }
  to { opacity: 1; transform: none; }
}
.pass-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 12px;
}
.pass-logo img { height: 28px; width: auto; }
.pass-field { text-align: right; }
.pass-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--lavender);
}
.pass-value { display: block; font-size: 20px; font-weight: 700; line-height: 1.2; }
.pass-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 20px 16px;
}
.pass-strip .slot { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.pass-strip .stamp { --size: clamp(34px, 10vw, 42px); border-color: rgba(190, 180, 213, .5); background: rgba(0, 0, 0, .18); }
.pass-strip .stamp.on { background: var(--lavender); border-color: var(--lavender); }
.pass-strip .stamp.gift { background: none; border-color: var(--reward); }
.pass-strip .stamp.gift.on { background: var(--reward); }
.pass-strip .slot small { font-size: 9px; font-weight: 800; letter-spacing: .08em; color: var(--reward); }
.pass-strip .slot small.num { color: var(--lavender); font-weight: 700; }
.pass-fields {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 14px 18px 4px;
}
.pass-fields .pass-value { font-size: 16px; font-weight: 600; }
.pass-fields .pass-field:first-child { text-align: left; min-width: 0; }
.pass-fields .pass-field:first-child .pass-value { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pass-aux { padding: 10px 18px 0; font-size: 13px; }
.pass-aux.reward { color: #fff; font-weight: 700; }
.pass-qr {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 22px 18px 24px;
}
.qr-box {
  background: #fff;
  padding: 10px;
  border-radius: 10px;
  width: 152px;
  height: 152px;
}
.qr-box canvas, .qr-box img { width: 132px !important; height: 132px !important; }
.qr-fallback {
  width: 132px; height: 132px;
  display: grid; place-items: center;
  color: var(--purple); font-size: 11px; text-align: center;
}
.pass-qr .alt { font-size: 12px; color: var(--lavender); letter-spacing: .14em; font-variant-numeric: tabular-nums; }

/* Wallet buttons */
.wallet-buttons {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 28px 0 0;
  max-width: 380px;
}
.wallet-item { display: flex; flex-direction: column; gap: 6px; }
.wallet-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 56px;
  padding: 0 20px;
  border-radius: 14px;
  color: #fff;
  background: #000;
  transition: transform .15s var(--ease), box-shadow .25s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.wallet-btn:hover { box-shadow: 0 12px 28px -12px rgba(0, 0, 0, .6); }
.wallet-btn:active { transform: scale(.985); }
.wallet-btn .txt { display: flex; flex-direction: column; line-height: 1.1; text-align: left; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.wallet-btn .txt small { font-size: 11px; font-weight: 500; opacity: .85; }
.wallet-btn .txt b { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.wallet-btn.google { background: #1F1F1F; }
.wallet-btn svg { flex: 0 0 auto; }
.wallet-btn.is-disabled { opacity: .35; pointer-events: none; filter: grayscale(1); }
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 9px 16px 9px 12px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  color: var(--purple);
  background: var(--lavender-2);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: background .2s;
  -webkit-tap-highlight-color: transparent;
}
.share-btn:hover { background: var(--lavender); }
.share-btn:active { transform: scale(.985); }
.share-btn svg { width: 18px; height: 18px; }

.steps {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: s;
}
.step {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 14px;
  align-items: start;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--lavender-3);
}
.step::before {
  counter-increment: s;
  content: counter(s);
  width: 40px; height: 40px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 18px;
  color: #fff;
  background: var(--purple);
}
.step b { display: block; font-size: 16px; color: var(--purple); margin-bottom: 2px; }
.step span { font-size: 14.5px; color: var(--muted); }

.section-title { margin: 44px 0 14px; }

.photo-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 28px;
}
.photo-row img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 16px; }

/* ---------- Staff ---------- */
.staff-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0 18px;
}
.staff-head h1 { font-size: clamp(32px, 7vw, 44px); margin: 10px 0 0; }
.staff-count { font-size: 14px; font-weight: 600; color: var(--muted); }

.notice {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  margin-bottom: 18px;
  font-size: 14px;
  color: var(--purple-deep);
  border-radius: 14px;
  background: var(--lavender-2);
}
.notice svg { flex: 0 0 18px; width: 18px; height: 18px; color: var(--purple); margin-top: 1px; }

.search {
  position: sticky;
  top: 0;
  z-index: 5;
  margin: 10px 0;
  padding: 6px 0;
  background: var(--bg);
}
.search label { position: relative; display: block; }
.search svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.search input {
  width: 100%;
  height: 50px;
  padding: 0 16px 0 46px;
  font: inherit;
  color: var(--text);
  background: var(--lavender-3);
  border: 1.5px solid transparent;
  border-radius: 999px;
  outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.search input:focus { background: #fff; border-color: var(--purple); box-shadow: 0 0 0 4px rgba(67, 30, 117, .12); }

.customers { display: grid; gap: 10px; padding: 6px 0 48px; }
@media (min-width: 900px) { .customers { grid-template-columns: 1fr 1fr; } }

.cust {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  transition: border-color .25s, box-shadow .25s;
}
.cust.ready-reward { border-color: var(--reward); box-shadow: 0 0 0 3px rgba(61, 165, 244, .15); }
.cust-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.cust-name { font-weight: 700; font-size: 16px; color: var(--purple); overflow-wrap: anywhere; }
.cust-meta { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.cust-id {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--purple);
  padding: 4px 8px;
  border-radius: 8px;
  background: var(--lavender-3);
  font-variant-numeric: tabular-nums;
}
.cust-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.dots { display: flex; gap: 6px; align-items: center; }
.dots .stamp { --size: 28px; border-width: 1.5px; }
.dots .stamp.gift { margin-left: 4px; }
.cust-actions { display: flex; gap: 8px; }
.btn-sm { height: 42px; padding: 0 18px; font-size: 14px; }
.btn-stamp { color: #fff; background: var(--purple); }
.btn-stamp:hover { background: var(--purple-hover); }
.btn-stamp[disabled] { opacity: .3; cursor: not-allowed; }
.btn-redeem { color: #fff; background: var(--reward); animation: pop .35s var(--ease); }
.btn-redeem:hover { background: var(--reward-deep); }
@keyframes pop { from { transform: scale(.85); opacity: 0; } to { transform: none; opacity: 1; } }
.cust-foot { font-size: 12.5px; color: var(--muted); }
.empty { padding: 40px 0; text-align: center; color: var(--muted); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 20px);
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  border-radius: 999px;
  background: var(--purple);
  box-shadow: 0 20px 40px -12px rgba(67, 30, 117, .6);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s var(--ease);
  max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.footer {
  padding: 28px 0 36px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  justify-content: space-between;
}

.fade-up { animation: fadeUp .6s var(--ease) both; }
.fade-up.d1 { animation-delay: .06s; }
.fade-up.d2 { animation-delay: .12s; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

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

/* Form validation */
.error { display: block; font-size: 13px; font-weight: 600; color: var(--danger); }
.error:empty { display: none; }
.field .error { margin-top: 6px; }
.field.invalid input { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(220, 53, 69, .12); }
.consent.invalid input { border-color: var(--danger); }
#err-consent { margin-top: -8px; padding-left: 34px; }

/* ---------- Staff: broadcast ---------- */
.broadcast {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  margin-bottom: 18px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
}
.broadcast-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.broadcast-head h2 { margin: 0; font-size: 20px; }
.broadcast-reach { font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.broadcast .field { margin: 0; }
.broadcast-meta { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; font-size: 12.5px; }
.broadcast-counter { flex: 0 0 auto; color: var(--muted); font-variant-numeric: tabular-nums; }
.broadcast-counter.over { color: var(--danger); }
.broadcast-send { align-self: flex-start; min-width: 120px; }
@media (max-width: 599px) { .broadcast-send { align-self: stretch; } }
.sent { margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--line); }
.sent-title { display: block; margin-bottom: 6px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.sent ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.sent li { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: baseline; font-size: 13px; }
.sent-date { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.sent-body { color: var(--text); overflow-wrap: anywhere; }
.sent-count { color: var(--muted); white-space: nowrap; }
@media (max-width: 599px) {
  .sent li { grid-template-columns: 1fr auto; gap: 2px 10px; }
  .sent-body { grid-column: 1 / -1; grid-row: 2; }
}

.badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  font-size: 11px;
  font-weight: 700;
  vertical-align: 2px;
  color: var(--purple);
  border-radius: 999px;
  background: var(--lavender-2);
}
