/* =========================================================================
   Spoonity Rewards — landing page styles
   Author: front-end build
   Structure:
     1. Design tokens (custom properties)
     2. Reset & base
     3. Utilities & primitives (container, buttons, eyebrow, logo)
     4. Header
     5. Hero + wallet-pass mockup
     6. Sections (value props, how it works)
     7. Enrollment / embed
     8. Footer
     9. Responsive breakpoints
    10. Motion preferences
   ========================================================================= */

/* -------------------------------------------------------------------------
   1. DESIGN TOKENS
   Anchored on the real Spoonity brand: purple primary, warm orange accent.
   ------------------------------------------------------------------------- */
:root {
  /* Brand colour ramp — Breakfast Bonanza */
  --color-primary:       #1B3564;   /* deep navy */
  --color-primary-600:   #152A52;   /* hover / pressed */
  --color-primary-700:   #0F1F3D;   /* deep, footer */
  --color-primary-050:   #EEF3FB;   /* tint band background */
  --color-primary-100:   #C5D5EE;   /* tint border */

  --color-accent:        #F47920;   /* Breakfast Bonanza orange */
  --color-accent-050:    #FEF1E4;

  /* Ink & neutrals */
  --color-ink:           #0F1F3D;   /* headings, near-black navy */
  --color-body:          #3D4B5C;   /* body copy */
  --color-muted:         #6B7685;   /* meta / captions */
  --color-surface:       #FFFFFF;
  --color-bg:            #FFFDF5;   /* warm cream page background */
  --color-border:        #E2E8F2;
  --color-border-strong: #C5D2E8;

  /* Typography — performant system stack, no network font, no layout shift */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, "Noto Sans", sans-serif;

  /* Fluid type scale (clamp: min, preferred, max) */
  --fs-eyebrow:  0.8125rem;                                  /* 13px */
  --fs-body:     clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);    /* 16–17 */
  --fs-lead:     clamp(1.125rem, 1.05rem + 0.45vw, 1.3125rem);
  --fs-h3:       clamp(1.1875rem, 1.1rem + 0.4vw, 1.375rem);
  --fs-h2:       clamp(1.75rem, 1.45rem + 1.4vw, 2.5rem);
  --fs-h1:       clamp(2.25rem, 1.7rem + 2.6vw, 3.75rem);

  --lh-tight:   1.08;
  --lh-snug:    1.25;
  --lh-body:    1.65;

  /* Spacing scale (4px base) */
  --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;
  --space-8: 4rem;
  --space-9: 6rem;
  --space-10: 8rem;

  /* Radii */
  --radius-sm:   8px;
  --radius-md:  14px;
  --radius-lg:  22px;
  --radius-xl:  28px;
  --radius-full: 999px;

  /* Shadows — three soft elevation tiers */
  --shadow-sm: 0 1px 2px rgba(26, 20, 38, 0.06),
               0 1px 3px rgba(26, 20, 38, 0.05);
  --shadow-md: 0 8px 24px -8px rgba(26, 20, 38, 0.16),
               0 2px 6px rgba(26, 20, 38, 0.06);
  --shadow-lg: 0 30px 60px -24px rgba(45, 20, 90, 0.34),
               0 12px 24px -16px rgba(26, 20, 38, 0.18);

  /* Layout */
  --container: 1140px;
  --container-narrow: 760px;

  /* Motion */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur:  0.22s;

  /* Per-section overrides — edited live by brand-editor.js */
  --header-bg:        rgba(255, 253, 245, 0.88);

  --pass-bg-1:        #FEF9E4;
  --pass-bg-2:        #FDE68A;
  --pass-bg-3:        #F9C310;
  --pass-text:        #0F1F3D;
  --pass-text-muted:  rgba(15, 31, 61, 0.60);
  --pass-barcode:     #1B3564;

  --footer-bg-1:      #FDE68A;
  --footer-bg-2:      #F9C310;
  --footer-border:    #F0B800;
  --footer-text:      rgba(15, 31, 61, 0.75);
  --footer-nav-text:  rgba(15, 31, 61, 0.80);
  --footer-legal:     rgba(15, 31, 61, 0.55);

  --btn-primary-bg:   #F9C310;
  --btn-primary-hover:#E8B40A;
  --btn-primary-fg:   #0F1F3D;

  /* Hero spotlight blobs */
  --hero-spot-1:      var(--color-primary-050);
  --hero-spot-2:      var(--color-accent-050);

  /* CTA banner */
  --cta-bg-end:       #0F1F3D;
}

/* -------------------------------------------------------------------------
   2. RESET & BASE
   ------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

* { margin: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 84px;             /* offset for sticky header */
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--color-body);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: var(--color-primary); text-decoration-thickness: 1px; text-underline-offset: 2px; }

h1, h2, h3 { color: var(--color-ink); line-height: var(--lh-snug); letter-spacing: -0.015em; }

:where(h1) { line-height: var(--lh-tight); letter-spacing: -0.025em; }

/* Visible, on-brand focus ring for keyboard users */
:where(a, button, input, [tabindex]):focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

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

/* Skip link */
.skip-link {
  position: absolute;
  top: var(--space-3);
  left: var(--space-3);
  z-index: 100;
  background: var(--color-primary);
  color: #fff;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 600;
}

/* -------------------------------------------------------------------------
   3. UTILITIES & PRIMITIVES
   ------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 5vw, 2.5rem);
}

.section { padding-block: clamp(3.5rem, 7vw, 6rem); }

.section__head { max-width: 42rem; margin-bottom: clamp(2rem, 4vw, 3.25rem); }

.section__title { font-size: var(--fs-h2); }

/* Eyebrow / kicker */
.eyebrow {
  display: inline-block;
  font-size: var(--fs-eyebrow);
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: var(--space-3);
}
.eyebrow--on-tint { color: var(--color-primary-600); }

/* Logo via CSS mask so it inherits brand colour through `currentColor` */
.logo {
  display: block;
  width: 210px;
  height: 38px;
  background-color: currentColor;
  -webkit-mask: url("../assets/spoonity-logo.svg") no-repeat left center / contain;
          mask: url("../assets/spoonity-logo.svg") no-repeat left center / contain;
}
.logo--header { color: var(--color-primary); }
.logo--footer { color: #1B3564; width: 210px; height: 38px; }
.logo--pass   { color: #1B3564; width: 140px; height: 32px; }

/* Buttons */
.btn {
  --btn-bg: var(--color-primary);
  --btn-fg: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font: inherit;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  border: 1.5px solid transparent;
  border-radius: var(--radius-md);
  padding: 0.75rem 1.4rem;
  background: var(--btn-bg);
  color: var(--btn-fg);
  transition: transform var(--dur) var(--ease),
              background-color var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease),
              border-color var(--dur) var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn--primary {
  --btn-bg: var(--btn-primary-bg);
  --btn-fg: var(--btn-primary-fg);
  box-shadow: var(--shadow-md);
}
.btn--primary:hover { --btn-bg: var(--btn-primary-hover); box-shadow: var(--shadow-lg); }

.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--color-primary);
  border-color: var(--color-border-strong);
}
.btn--ghost:hover { --btn-bg: var(--color-primary-050); border-color: var(--color-primary); }

.btn--sm { padding: 0.55rem 1.05rem; font-size: 0.9375rem; }
.btn--lg { padding: 0.95rem 1.8rem; font-size: 1.0625rem; }

.btn__ext { flex: none; }

/* Live dot */
.dot {
  display: inline-block;
  width: 0.5rem; height: 0.5rem;
  border-radius: 50%;
  background: var(--color-accent);
}
.dot--live { position: relative; background: #34C759; }
.dot--live::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: 50%;
  background: inherit;
  animation: pulse-ring 2s var(--ease) infinite;
}
@keyframes pulse-ring {
  0%   { transform: scale(1);   opacity: 0.55; }
  70%  { transform: scale(2.6); opacity: 0;    }
  100% { transform: scale(2.6); opacity: 0;    }
}

/* -------------------------------------------------------------------------
   4. HEADER
   ------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--color-border);
}
.site-header__inner {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  min-height: 68px;
}
.site-nav { margin-inline-start: auto; }
.site-nav__list {
  display: flex;
  gap: clamp(1rem, 2.4vw, 2rem);
  list-style: none;
  padding: 0;
}
.site-nav__list a {
  color: var(--color-body);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.96875rem;
  padding: 0.4rem 0;
  position: relative;
}
.site-nav__list a::after {
  content: "";
  position: absolute; left: 0; bottom: -2px;
  width: 0; height: 2px;
  background: var(--color-accent);
  border-radius: 2px;
  transition: width var(--dur) var(--ease);
}
.site-nav__list a:hover { color: var(--color-ink); }
.site-nav__list a:hover::after { width: 100%; }

.header__cta { margin-inline-start: var(--space-2); }

/* -------------------------------------------------------------------------
   5. HERO
   ------------------------------------------------------------------------- */
.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(60% 70% at 88% 8%, var(--hero-spot-1) 0%, transparent 60%),
    radial-gradient(50% 60% at 6% 100%, var(--hero-spot-2) 0%, transparent 55%),
    var(--color-bg);
}
.hero__inner {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
  padding-block: clamp(3rem, 7vw, 6rem);
}
.hero__brand-logo {
  width: clamp(180px, 28vw, 260px);
  height: auto;
  margin-bottom: var(--space-5);
}

.hero__title {
  font-size: var(--fs-h1);
  font-weight: 800;
  max-width: 14ch;
  margin-bottom: var(--space-5);
}
.hero__subhead {
  font-size: var(--fs-lead);
  color: var(--color-body);
  max-width: 46ch;
  margin-bottom: var(--space-6);
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}
.hero__assurance {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.9375rem;
  color: var(--color-muted);
  font-weight: 500;
}

/* --- Wallet pass mockup --- */
.hero__visual { display: flex; justify-content: center; }
.pass-stage {
  position: relative;
  width: min(360px, 100%);
  isolation: isolate;
}

.wallet-pass {
  position: relative;
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.5rem 1.25rem;
  color: var(--pass-text);
  background:
    radial-gradient(120% 100% at 0% 0%, var(--pass-bg-1) 0%, transparent 55%),
    linear-gradient(155deg, var(--pass-bg-2) 0%, var(--pass-bg-3) 100%);
  box-shadow: var(--shadow-lg);
  transform: rotate(-3deg);
  transition: transform 0.4s var(--ease);
  overflow: hidden;
}
.wallet-pass::before {           /* subtle sheen */
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(115deg, rgba(255,255,255,0.35) 0%, transparent 40%);
  pointer-events: none;
}
.pass-stage:hover .wallet-pass { transform: rotate(-1deg) translateY(-4px); }

.wallet-pass__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.75rem;
}
.wallet-pass__live {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
  background: rgba(249, 195, 16, 0.35);
  color: var(--pass-text);
}
.wallet-pass__program {
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--pass-text-muted);
  margin-bottom: 0.35rem;
}
.wallet-pass__balance {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
}
.wallet-pass__points {
  font-size: 2.85rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.wallet-pass__unit { font-size: 1rem; color: var(--pass-text-muted); }

.wallet-pass__meta {
  display: flex;
  gap: 2.5rem;
  margin-bottom: 1.5rem;
}
.wallet-pass__meta dt {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--pass-text-muted);
  margin-bottom: 0.2rem;
}
.wallet-pass__meta dd { font-size: 0.9375rem; font-weight: 600; }

.wallet-pass__barcode {
  display: flex;
  align-items: stretch;
  gap: 2px;
  height: 52px;
  padding: 8px 10px;
  background: #fff;
  border-radius: var(--radius-sm);
}
.wallet-pass__barcode span {
  flex: 1;
  background: var(--pass-barcode);
  border-radius: 1px;
}
/* Vary bar widths for a realistic barcode look */
.wallet-pass__barcode span:nth-child(3n)   { flex: 2; }
.wallet-pass__barcode span:nth-child(4n)   { flex: 0.5; }
.wallet-pass__barcode span:nth-child(5n)   { flex: 1.5; }
.wallet-pass__barcode span:nth-child(7n)   { flex: 0.7; }

/* Floating "+points added" toast */
.pass-toast {
  position: absolute;
  top: -14px;
  right: -10px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--color-surface);
  color: var(--color-ink);
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.5rem 0.8rem;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--color-border);
  animation: toast-float 4.5s var(--ease) infinite;
}
.pass-toast__plus {
  color: #fff;
  background: #34C759;
  font-variant-numeric: tabular-nums;
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
}
@keyframes toast-float {
  0%, 100% { transform: translateY(0);     opacity: 0; }
  10%, 70% { transform: translateY(-6px);  opacity: 1; }
  85%      { transform: translateY(-12px); opacity: 0; }
}

/* -------------------------------------------------------------------------
   6. SECTIONS — value props & how it works
   ------------------------------------------------------------------------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1rem, 2.5vw, 1.75rem);
  list-style: none;
  padding: 0;
}
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 3vw, 2.25rem);
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease),
              border-color var(--dur) var(--ease);
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary-100);
}
.card__icon {
  display: grid;
  place-items: center;
  width: 3rem; height: 3rem;
  border-radius: var(--radius-md);
  background: var(--color-primary-050);
  color: var(--color-primary);
  margin-bottom: var(--space-4);
}
.card__icon svg { width: 26px; height: 26px; }
.card__title { font-size: var(--fs-h3); margin-bottom: var(--space-2); }
.card__body  { color: var(--color-body); }

/* How it works — numbered steps */
.how { background: var(--color-surface); border-block: 1px solid var(--color-border); }
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  list-style: none;
  padding: 0;
  counter-reset: step;
}
.step { position: relative; }
.step__num {
  display: grid;
  place-items: center;
  width: 2.75rem; height: 2.75rem;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: #fff;
  font-weight: 700;
  font-size: 1.125rem;
  margin-bottom: var(--space-4);
  box-shadow: var(--shadow-sm);
}
.step__title { font-size: var(--fs-h3); margin-bottom: var(--space-2); }
.step__body  { color: var(--color-body); }
.step em { font-style: normal; font-weight: 600; color: var(--color-ink); }

/* Connector line between steps (desktop) */
@media (min-width: 721px) {
  .step:not(:last-child)::before {
    content: "";
    position: absolute;
    top: 1.375rem;
    left: calc(2.75rem + 0.75rem);
    right: calc(-1 * clamp(1.5rem, 4vw, 3rem) + 0.5rem);
    height: 2px;
    background: linear-gradient(90deg, var(--color-primary-100), transparent);
  }
}

/* -------------------------------------------------------------------------
   7a. ENROLL TABS
   ------------------------------------------------------------------------- */
.enroll-tabs {
  display: flex;
  gap: 0.25rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  padding: 0.3rem;
  margin-bottom: clamp(1.5rem, 3vw, 2.25rem);
  box-shadow: var(--shadow-sm);
}
.enroll-tab {
  flex: 1;
  padding: 0.55rem 1.25rem;
  border: none;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--color-muted);
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: background var(--dur) var(--ease),
              color var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease);
  white-space: nowrap;
}
.enroll-tab:hover:not(.enroll-tab--active) {
  color: var(--color-ink);
  background: var(--color-primary-050);
}
.enroll-tab--active {
  background: var(--color-primary);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

/* -------------------------------------------------------------------------
   7b. MEMBER LOOKUP
   ------------------------------------------------------------------------- */
.member-lookup__card {
  padding: clamp(1.5rem, 4vw, 2.5rem);
}
.member-lookup__form {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.member-lookup__label {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-ink);
}
.member-lookup__input-row {
  display: flex;
  gap: var(--space-3);
}
.member-lookup__input {
  flex: 1;
  padding: 0.65rem 1rem;
  border: 1.5px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-family: var(--font-sans);
  color: var(--color-ink);
  background: var(--color-surface);
  outline: none;
  transition: border-color var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease);
}
.member-lookup__input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-050);
}
.member-lookup__btn {
  white-space: nowrap;
}
.member-lookup__hint {
  font-size: 0.8125rem;
  color: var(--color-muted);
  margin: 0;
}
.member-lookup__error {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: var(--space-3);
  padding: 0.65rem 1rem;
  background: #FFF3F3;
  border: 1px solid #FFCDD2;
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  color: #C0392B;
}
.member-lookup__reset {
  display: block;
  width: 100%;
  margin-top: var(--space-5);
  padding: 0;
  background: none;
  border: none;
  font-size: 0.875rem;
  font-family: var(--font-sans);
  color: var(--color-muted);
  cursor: pointer;
  text-align: center;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.member-lookup__reset:hover { color: var(--color-ink); }

/* Member account info */
.member-account { display: flex; flex-direction: column; gap: var(--space-5); }
.member-account__header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.member-account__tier-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fff;
  background: var(--color-primary);
  text-transform: uppercase;
}
.member-account__name {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-ink);
}
.member-account__id {
  font-size: 0.875rem;
  color: var(--color-muted);
  font-variant-numeric: tabular-nums;
}
.member-account__points-block {
  text-align: center;
  padding: var(--space-5) var(--space-4);
  background: var(--color-primary-050);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-primary-100);
}
.member-account__points-label {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: var(--space-1);
}
.member-account__points-value {
  font-size: clamp(2.5rem, 6vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--color-ink);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.member-account__progress-section { display: flex; flex-direction: column; gap: var(--space-2); }
.member-account__progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-body);
}
.member-account__progress-bar {
  height: 10px;
  background: var(--color-border);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.member-account__progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  border-radius: var(--radius-full);
  transition: width 0.8s var(--ease);
}
.member-account__progress-caption {
  font-size: 0.875rem;
  color: var(--color-muted);
  margin: 0;
}
.member-account__next-tier {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
}
.member-account__next-tier-heading {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--color-ink);
  margin: 0 0 var(--space-3);
}
.member-account__next-tier-heading svg { color: var(--color-accent); flex-shrink: 0; }
.member-account__next-tier-perks {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.member-account__next-tier-perks li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9375rem;
  color: var(--color-body);
}
.member-account__next-tier-perks li::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-accent);
  flex-shrink: 0;
}

/* -------------------------------------------------------------------------
   7. ENROLLMENT / EMBED
   ------------------------------------------------------------------------- */
.enroll {
  background:
    radial-gradient(70% 60% at 50% -10%, var(--color-primary-050) 0%, transparent 60%),
    var(--color-bg);
}
.enroll__inner { display: grid; justify-items: center; }
.enroll__head { text-align: center; max-width: 44rem; margin-bottom: clamp(1.75rem, 4vw, 2.75rem); }
.enroll__lede { font-size: var(--fs-lead); color: var(--color-body); margin-top: var(--space-3); }

.enroll__card {
  width: 100%;
  max-width: 600px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: clamp(1.25rem, 3vw, 2rem);
  box-shadow: var(--shadow-lg);
}
.enroll__frame {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--color-primary-050);
  border: 1px solid var(--color-border);
}
.enroll__iframe {
  display: block;
  width: 100%;
  height: clamp(560px, 78vh, 760px);
  border: 0;
  background: transparent;
}

/* Fallback panel (shown if the iframe is blocked / fails to load) */
.enroll__fallback {
  text-align: center;
  padding: clamp(2rem, 5vw, 3.5rem) clamp(1rem, 4vw, 2rem);
}
.enroll__fallback-title { font-size: var(--fs-h3); margin-bottom: var(--space-3); }
.enroll__fallback-body {
  color: var(--color-body);
  max-width: 38ch;
  margin: 0 auto var(--space-6);
}

.enroll__alt {
  text-align: center;
  font-size: 0.9375rem;
  color: var(--color-muted);
  margin-top: var(--space-4);
}
.enroll__alt a { font-weight: 600; }

/* Setup placeholder — shown until a valid enrollment link is configured */
.enroll__setup {
  text-align: center;
  padding: clamp(2.5rem, 6vw, 4rem) clamp(1rem, 4vw, 2rem);
}
.enroll__setup-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  margin-bottom: var(--space-4);
  border-radius: var(--radius-full);
  background: var(--color-primary-050);
  color: var(--color-primary);
}
.enroll__setup-title { font-size: var(--fs-h3); margin-bottom: var(--space-3); }
.enroll__setup-body {
  color: var(--color-body);
  max-width: 40ch;
  margin: 0 auto;
  line-height: var(--lh-body);
}

.enroll__trust {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(1rem, 3vw, 2.25rem);
  list-style: none;
  padding: 0;
  margin-top: var(--space-6);
}
.enroll__trust li {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-body);
}
.enroll__trust svg { color: var(--color-primary); }

/* -------------------------------------------------------------------------
   8. FOOTER
   ------------------------------------------------------------------------- */
.site-footer {
  background: linear-gradient(135deg, var(--footer-bg-1) 0%, var(--footer-bg-2) 100%);
  color: var(--footer-text);
  padding-block: clamp(2.25rem, 4vw, 3rem);
  border-top: 1px solid var(--footer-border);
}
/* Clean, centered single column */
.site-footer__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-4);
}
.site-footer__nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2) var(--space-5);
}
.site-footer__nav a {
  color: var(--footer-nav-text);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
}
.site-footer__nav a:hover { color: var(--footer-text); text-decoration: underline; text-underline-offset: 3px; }

.site-footer__legal {
  max-width: 54ch;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--footer-legal);
}

/* -------------------------------------------------------------------------
   9. RESPONSIVE
   ------------------------------------------------------------------------- */

/* Tablet & below: stack hero, drop in-header nav links */
@media (max-width: 900px) {
  .hero__inner { grid-template-columns: 1fr; }
  .hero__copy { order: 1; }
  .hero__visual { order: 2; margin-top: var(--space-4); }
  .hero__title { max-width: 18ch; }
}

@media (max-width: 760px) {
  .site-nav { display: none; }                 /* keep header clean on small screens */
  .header__cta { margin-inline-start: auto; }
  .card-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; gap: var(--space-6); }
}

/* Small phones */
@media (max-width: 380px) {
  .hero__actions { flex-direction: column; align-items: stretch; }
  .hero__actions .btn { width: 100%; }
  .wallet-pass__meta { gap: 1.5rem; }
}

/* Wide screens: a touch more breathing room */
@media (min-width: 1280px) {
  :root { --container: 1180px; }
}

/* -------------------------------------------------------------------------
   10. MOTION PREFERENCES
   ------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .wallet-pass { transform: rotate(-2deg); }
  .pass-toast { opacity: 1; }
}

/* -------------------------------------------------------------------------
   11. TIERS PAGE
   ------------------------------------------------------------------------- */
.page-hero {
  background:
    radial-gradient(60% 70% at 88% 8%, var(--color-primary-050) 0%, transparent 60%),
    radial-gradient(50% 60% at 6% 100%, var(--color-accent-050) 0%, transparent 55%),
    var(--color-bg);
  padding-block: clamp(3rem, 7vw, 5.5rem);
  text-align: center;
}
.page-hero__title { font-size: var(--fs-h1); font-weight: 800; margin-bottom: var(--space-4); }
.page-hero__sub { font-size: var(--fs-lead); color: var(--color-body); max-width: 52ch; margin-inline: auto; }

.tiers-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(1rem, 2vw, 1.5rem);
  list-style: none;
  padding: 0;
}

.tier-card {
  position: relative;
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: clamp(1.5rem, 3vw, 2rem) clamp(1.25rem, 2.5vw, 1.75rem);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease),
              border-color var(--dur) var(--ease);
  text-align: left;
}
.tier-card:hover,
.tier-card:focus-visible {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  outline: none;
}
.tier-card--basic  { --tier-color: #6B6577; --tier-bg: #F5F4F7; }
.tier-card--silver { --tier-color: #6E7989; --tier-bg: #EFF2F5; }
.tier-card--gold   { --tier-color: #B8860B; --tier-bg: #FEF8E7; }
.tier-card--elite  { --tier-color: var(--color-primary); --tier-bg: var(--color-primary-050); }

.tier-card:hover  { border-color: var(--tier-color); }

.tier-card__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.25rem; height: 3.25rem;
  border-radius: var(--radius-lg);
  background: var(--tier-bg);
  color: var(--tier-color);
  margin-bottom: var(--space-4);
  font-size: 1.5rem;
}
.tier-card__name {
  font-size: var(--fs-h3);
  font-weight: 700;
  color: var(--color-ink);
  margin-bottom: var(--space-2);
}
.tier-card__threshold {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--tier-color);
  margin-bottom: var(--space-4);
}
.tier-card__perks {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}
.tier-card__perks li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  font-size: 0.9375rem;
  color: var(--color-body);
}
.tier-card__perks li::before {
  content: "";
  flex: none;
  width: 1rem; height: 1rem;
  margin-top: 2px;
  border-radius: 50%;
  background: var(--tier-color);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='white' d='M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E") no-repeat center / contain;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='white' d='M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E") no-repeat center / contain;
}
.tier-card__cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--tier-color);
  text-decoration: none;
}
.tier-card__cta svg { transition: transform var(--dur) var(--ease); }
.tier-card:hover .tier-card__cta svg { transform: translateX(3px); }

/* Tier modal overlay */
.tier-modal-overlay {
  position: fixed; inset: 0;
  z-index: 200;
  background: rgba(26, 20, 38, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s var(--ease);
}
.tier-modal-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}
.tier-modal {
  position: relative;
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  padding: clamp(1.75rem, 4vw, 3rem);
  max-width: 500px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  transform: translateY(16px) scale(0.98);
  transition: transform 0.25s var(--ease);
  max-height: calc(100vh - 2 * var(--space-5));
  overflow-y: auto;
}
.tier-modal-overlay.is-open .tier-modal {
  transform: translateY(0) scale(1);
}
.tier-modal__close {
  position: absolute;
  top: var(--space-4); right: var(--space-4);
  width: 2rem; height: 2rem;
  border: none;
  border-radius: 50%;
  background: var(--color-primary-050);
  color: var(--color-body);
  font-size: 1.125rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  line-height: 1;
  transition: background var(--dur) var(--ease);
}
.tier-modal__close:hover { background: var(--color-primary-100); color: var(--color-ink); }
.tier-modal__badge {
  width: 4rem; height: 4rem;
  border-radius: var(--radius-lg);
  display: grid;
  place-items: center;
  font-size: 2rem;
  margin-bottom: var(--space-4);
}
.tier-modal__name { font-size: var(--fs-h2); font-weight: 800; margin-bottom: var(--space-2); }
.tier-modal__threshold {
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: var(--space-5);
}
.tier-modal__desc { color: var(--color-body); margin-bottom: var(--space-5); line-height: var(--lh-body); }
.tier-modal__perks-title {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin-bottom: var(--space-3);
}
.tier-modal__perks {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}
.tier-modal__perks li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  font-size: 1rem;
  color: var(--color-body);
}
.tier-modal__perks li strong { color: var(--color-ink); }
.tier-modal__perk-icon {
  flex: none;
  width: 1.5rem; height: 1.5rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.75rem;
}
.tier-modal__enroll {
  display: block;
  text-align: center;
}

@media (max-width: 900px) {
  .tiers-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .tiers-grid { grid-template-columns: 1fr; }
}

/* -------------------------------------------------------------------------
   12. ENROLL PAGE
   ------------------------------------------------------------------------- */
.enroll-page {
  min-height: calc(100vh - 68px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-block: clamp(3rem, 7vw, 5rem);
  background:
    radial-gradient(60% 70% at 88% 8%, var(--color-primary-050) 0%, transparent 60%),
    radial-gradient(50% 60% at 6% 100%, var(--color-accent-050) 0%, transparent 55%),
    var(--color-bg);
}
.enroll-page__head {
  text-align: center;
  max-width: 44rem;
  margin-bottom: clamp(1.75rem, 4vw, 2.75rem);
}
.enroll-page__title { font-size: var(--fs-h1); font-weight: 800; margin-bottom: var(--space-4); }
.enroll-page__sub { font-size: var(--fs-lead); color: var(--color-body); }
.enroll-page__card {
  width: 100%;
  max-width: 620px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: clamp(1.25rem, 3vw, 2rem);
  box-shadow: var(--shadow-lg);
}
.enroll-page__trust {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(1rem, 3vw, 2.25rem);
  list-style: none;
  padding: 0;
  margin-top: var(--space-6);
}
.enroll-page__trust li {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-body);
}
.enroll-page__trust svg { color: var(--color-primary); }

/* -------------------------------------------------------------------------
   13. LOYALTY CARD MOCKUP (.lc)
   Replicates the physical tier card design in pure CSS.
   ------------------------------------------------------------------------- */
.lc {
  width: 100%;
  aspect-ratio: 1.586;        /* credit-card ratio */
  border-radius: var(--radius-lg);
  padding: 0.75rem 0.9rem 0.55rem;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #fff;
  box-shadow: var(--shadow-lg);
  margin-bottom: var(--space-4);
  user-select: none;
}

/* Per-tier colour ramps */
.lc--base  {
  background: linear-gradient(140deg, #9B35D8 0%, #6322AA 50%, #401888 100%);
}
.lc--silver {
  background: linear-gradient(140deg, #D4D4D4 0%, #A8A8A8 50%, #787878 100%);
  color: #1A1A1A;
}
.lc--gold {
  background: linear-gradient(140deg, #E8BE10 0%, #C49A00 50%, #8A6B00 100%);
}
.lc--elite {
  background: linear-gradient(140deg, #3A3A3A 0%, #1A1A1A 50%, #050505 100%);
}

/* Top row: brand + points */
.lc__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.lc__brand {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.lc__name {
  font-size: clamp(0.75rem, 2.2vw, 1rem);
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.1;
}
.lc--silver .lc__name { color: #111; }
.lc__name sup {
  font-size: 0.55em;
  font-weight: 700;
  vertical-align: super;
}
.lc__tagline {
  font-size: clamp(0.44rem, 1.1vw, 0.56rem);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.75;
}
.lc__pts {
  text-align: right;
  line-height: 1;
}
.lc__pts-label {
  display: block;
  font-size: clamp(0.44rem, 1.1vw, 0.56rem);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.75;
  margin-bottom: 1px;
}
.lc__pts-value {
  display: block;
  font-size: clamp(0.9rem, 2.5vw, 1.25rem);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

/* Shimmer band with floating sparkle dots */
.lc__shimmer {
  position: relative;
  flex: 1;
  margin-block: 0.3rem;
  border-radius: 4px;
  overflow: hidden;
}
.lc--base   .lc__shimmer { background: linear-gradient(90deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.14) 40%, rgba(255,255,255,0.06) 100%); }
.lc--silver .lc__shimmer { background: linear-gradient(90deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.28) 40%, rgba(255,255,255,0.08) 100%); }
.lc--gold   .lc__shimmer { background: linear-gradient(90deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.22) 40%, rgba(255,255,255,0.06) 100%); }
.lc--elite  .lc__shimmer { background: linear-gradient(90deg, rgba(255,255,255,0.02) 0%, rgba(255,255,255,0.10) 40%, rgba(255,255,255,0.03) 100%); }

/* Sparkle dots positioned via inline CSS vars */
.lc__dot {
  position: absolute;
  left: var(--x, 60%);
  top:  var(--y, 50%);
  width:  var(--s, 6px);
  height: var(--s, 6px);
  border-radius: 50%;
  background: var(--c, #fff);
  opacity: var(--o, 0.6);
  transform: translate(-50%, -50%);
}

/* Name / tier row */
.lc__info {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 0.35rem;
}
.lc__info > div { display: flex; flex-direction: column; gap: 1px; }
.lc__info > div:last-child { text-align: right; }
.lc__label {
  font-size: clamp(0.4rem, 1vw, 0.52rem);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.7;
}
.lc__value {
  font-size: clamp(0.72rem, 2vw, 0.95rem);
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* Barcode area */
.lc__barcode {
  background: #fff;
  border-radius: 4px;
  padding: 5px 7px 3px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.lc__bars {
  display: flex;
  align-items: stretch;
  gap: 1.5px;
  height: clamp(20px, 4vw, 32px);
  width: 100%;
}
.lc__bars span {
  flex: 1;
  background: #111;
  border-radius: 1px;
}
.lc__bars span:nth-child(3n)  { flex: 2; }
.lc__bars span:nth-child(4n)  { flex: 0.5; }
.lc__bars span:nth-child(5n)  { flex: 1.5; }
.lc__bars span:nth-child(7n)  { flex: 0.7; }
.lc__bars span:nth-child(2n)  { background: #222; }
.lc__code {
  font-size: clamp(0.38rem, 0.9vw, 0.52rem);
  color: #222;
  font-family: monospace;
  letter-spacing: 0.04em;
  line-height: 1;
}

/* Larger card shown inside modals */
.lc--modal {
  max-width: 380px;
  width: 100%;
  margin-inline: auto;
  margin-bottom: var(--space-5);
}

/* Tier card: switch from badge to full-width lc */
.tier-card .lc {
  margin-bottom: var(--space-3);
}
.tier-card--basic  { border-color: var(--color-border); }
.tier-card--silver { border-color: #C0C0C0; }
.tier-card--gold   { border-color: #D4A500; }
.tier-card--elite  { border-color: #3A3A3A; }

/* =========================================================================
   BRAND EDITOR SIDEBAR
   ========================================================================= */

/* Design tool FABs — stacked bottom-left, each with a label to its right */
.be-fab {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  z-index: 8100;
  width: 48px; height: 48px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: var(--color-surface);
  border: 2px solid rgba(255,255,255,0.18);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 18px rgba(0,0,0,0.28);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
              opacity 0.3s ease,
              visibility 0.4s,
              background 0.18s;
  line-height: 1;
  animation: fab-attention 2.8s ease-in-out infinite;
}
.be-fab:hover { transform: scale(1.08); background: var(--color-primary-600); }
.be-fab:hover, .be-fab:focus-visible { animation-play-state: paused; }
.be-fab.is-active { background: var(--color-primary-700); animation: none; }

/* Always-visible pill label sitting to the right of the FAB */
.be-fab::after {
  content: attr(data-label);
  position: absolute;
  left: calc(100% + 0.6rem);
  top: 50%;
  transform: translateY(-50%);
  white-space: nowrap;
  background: var(--color-primary);
  color: var(--color-surface);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 0.34rem 0.72rem;
  border-radius: var(--radius-full);
  box-shadow: 0 3px 12px rgba(0,0,0,0.22);
  pointer-events: none;
}
.be-fab:hover::after { background: var(--color-primary-600); }

/* Soft pulsing ring to signal the buttons are interactive */
@keyframes fab-attention {
  0%, 100% { box-shadow: 0 4px 18px rgba(0,0,0,0.28), 0 0 0 0 rgba(27,53,100,0.45); }
  50%      { box-shadow: 0 4px 18px rgba(0,0,0,0.28), 0 0 0 9px rgba(27,53,100,0); }
}

/* While the brand editor is open, glide the FAB out to the left and fade.
   It eases back in when the editor closes (transition runs in both directions). */
body.be-editor-open .be-fab {
  opacity: 0;
  transform: translateX(-160%) scale(0.82);
  visibility: hidden;
  pointer-events: none;
  animation-play-state: paused;
}

.brand-editor-backdrop {
  position: fixed;
  inset: 0;
  z-index: 7998;
  background: rgba(0,0,0,0.28);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.brand-editor-backdrop.is-visible { opacity: 1; pointer-events: auto; }

/* ---- Sidebar fixed color tokens (immune to theme changes) ---- */
#brand-editor {
  --be-bg:          #ffffff;
  --be-surface:     #f4f4f5;
  --be-surface-2:   #e4e4e7;
  --be-border:      rgba(0,0,0,0.08);
  --be-border-s:    rgba(0,0,0,0.14);
  --be-ink:         #18181b;
  --be-body:        rgba(24,24,27,0.70);
  --be-muted:       rgba(24,24,27,0.42);
  --be-accent:      #6366f1;
  --be-accent-dim:  rgba(99,102,241,0.18);
  --be-selected-bg: rgba(99,102,241,0.22);
  --be-selected-bd: #6366f1;
}

.brand-editor {
  position: fixed;
  top: 0; left: 0;
  width: min(380px, 100vw);
  height: 100dvh;
  z-index: 7999;
  background: var(--be-bg);
  border-right: 1px solid var(--be-border-s);
  box-shadow: 10px 0 40px rgba(0,0,0,0.45);
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.36s cubic-bezier(0.22, 0.61, 0.36, 1);
  will-change: transform;
  color: var(--be-ink);
}
.brand-editor.is-open { transform: translateX(0); }

.brand-editor__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1.125rem;
  border-bottom: 1px solid var(--be-border-s);
  flex-shrink: 0;
  gap: 0.5rem;
  background: var(--be-bg);
}
.brand-editor__title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--be-ink);
  margin: 0;
}
.brand-editor__close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--be-muted);
  padding: 0.375rem;
  border-radius: var(--radius-sm);
  line-height: 1;
  display: flex;
  align-items: center;
}
.brand-editor__close:hover { background: var(--be-surface-2); color: var(--be-ink); }

.brand-editor__body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* Upload brand config — first thing in the editor, also a drop target */
.be-loadtheme {
  padding: 1.125rem 1.125rem 1.25rem;
  border-bottom: 1px solid var(--be-border);
  border-radius: var(--radius-md);
  transition: background 0.15s, box-shadow 0.15s;
}
.be-loadtheme.is-dragover {
  background: var(--be-accent-dim);
  box-shadow: inset 0 0 0 2px var(--be-accent);
}
.be-loadtheme__btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1rem;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-md);
  background: #FF7E3D;
  color: #fff;
  cursor: pointer;
  transition: filter 0.18s, transform 0.15s;
  line-height: 1;
}
.be-loadtheme__btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.be-loadtheme__btn:active { transform: translateY(0); }
.be-loadtheme__btn svg { flex: none; }
.be-loadtheme__hint {
  margin: 0.6rem 0 0;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--be-body);
  text-align: center;
}
.be-loadtheme__hint code {
  font-size: 0.76rem;
  background: var(--be-surface-2);
  color: var(--be-ink);
  padding: 0.1em 0.35em;
  border-radius: 3px;
  font-family: ui-monospace, "Cascadia Code", "Source Code Pro", monospace;
}

/* Collapsible sections */
.be-section { border-bottom: 1px solid var(--be-border); }
.be-section__btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1.125rem;
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--be-ink);
  text-align: left;
  gap: 0.5rem;
}
.be-section__btn:hover { background: var(--be-surface); }
.be-section__icon { color: var(--be-muted); display: flex; align-items: center; flex-shrink: 0; }
.be-section__chevron {
  transition: transform 0.2s var(--ease);
  flex-shrink: 0;
  color: var(--be-muted);
  display: flex;
}
.be-section.is-open .be-section__chevron { transform: rotate(180deg); }
.be-section__body {
  display: none;
  padding: 0.5rem 0.75rem 1rem;
}
.be-section.is-open .be-section__body { display: block; }

/* Field rows — full-width clickable buttons */
.be-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
  width: 100%;
  background: var(--be-surface);
  border: 1.5px solid transparent;
  border-radius: 6px;
  padding: 0.45rem 0.6rem;
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: background 0.12s, border-color 0.12s;
}
.be-row:last-child { margin-bottom: 0; }
.be-row:hover { background: var(--be-surface-2); }
.be-row.is-selected {
  background: var(--be-selected-bg);
  border-color: var(--be-selected-bd);
}
.be-row label, .be-row .be-row__label {
  flex: 1;
  font-size: 0.8rem;
  color: var(--be-body);
  font-weight: 500;
  min-width: 0;
  pointer-events: none;
  cursor: pointer;
  text-align: left;
}
.be-row.is-selected label,
.be-row.is-selected .be-row__label { color: var(--be-ink); }
.be-row--col {
  flex-direction: column;
  align-items: stretch;
  cursor: default;
}
.be-row--col:hover { background: var(--be-surface); }
.be-row--col label { margin-bottom: 0.3rem; cursor: default; }
.be-row__help {
  margin: 0.4rem 0 0;
  font-size: 0.72rem;
  line-height: 1.45;
  color: var(--be-body);
}

/* Publish design → backend (/design) — generates the enrollment link */
.be-publish-btn {
  margin-top: 0.6rem;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.6rem 1rem;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-md);
  background: var(--be-accent);
  color: #fff;
  cursor: pointer;
  transition: filter 0.18s, transform 0.15s;
  line-height: 1;
}
.be-publish-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.be-publish-btn:active { transform: translateY(0); }
.be-publish-btn:disabled,
.be-publish-btn.is-loading {
  opacity: 0.65;
  cursor: progress;
  transform: none;
  filter: none;
}

/* Color picker */
.be-swatch {
  position: relative;
  width: 28px; height: 28px;
  border-radius: 5px;
  border: 2px solid var(--be-border-s);
  cursor: pointer;
  flex-shrink: 0;
  overflow: hidden;
}
.be-swatch-preview {
  display: block;
  width: 100%;
  height: 100%;
}
.be-swatch input[type="color"] {
  position: absolute;
  inset: -4px;
  width: calc(100% + 8px);
  height: calc(100% + 8px);
  opacity: 0;
  cursor: pointer;
  border: none;
  padding: 0;
}

.be-hex {
  width: 76px;
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 0.75rem;
  padding: 0.3rem 0.4rem;
  border: 1.5px solid var(--be-border-s);
  border-radius: 5px;
  color: var(--be-ink);
  background: var(--be-bg);
  text-transform: uppercase;
  flex-shrink: 0;
}
.be-hex:focus { outline: none; border-color: var(--be-accent); background: var(--be-surface); }
.be-hex.is-targeted { border-color: var(--be-accent); background: var(--be-selected-bg); }

/* Text input */
.be-text {
  width: 100%;
  font: inherit;
  font-size: 0.8125rem;
  padding: 0.45rem 0.6rem;
  border: 1.5px solid var(--be-border-s);
  border-radius: 5px;
  color: var(--be-ink);
  background: var(--be-bg);
}
.be-text:focus { outline: none; border-color: var(--be-accent); }

/* Image upload row */
.be-img-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.be-img-row:last-child { margin-bottom: 0; }
.be-img-row label {
  font-size: 0.8rem;
  color: var(--be-body);
  font-weight: 500;
  flex: 1;
}
.be-img-preview {
  width: 46px; height: 30px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  border: 1px solid var(--be-border-s);
  background: repeating-conic-gradient(#333 0% 25%, #555 0% 50%) 0 0 / 8px 8px;
  flex-shrink: 0;
}
.be-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font: inherit;
  font-size: 0.775rem;
  font-weight: 600;
  padding: 0.35rem 0.65rem;
  border: 1.5px solid var(--be-border-s);
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: var(--be-body);
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s, background 0.15s;
  flex-shrink: 0;
}
.be-upload-btn:hover { border-color: var(--be-accent); background: var(--be-surface); color: var(--be-ink); }

/* Palette panel */
.be-palette-panel {
  padding: 0.875rem 1.125rem 1rem;
  border-bottom: 2px solid var(--be-border-s);
  background: var(--be-bg);
}
.be-palette-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.625rem;
}
.be-palette-heading {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--be-muted);
  margin: 0;
}
.be-palette-restore {
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  background: none;
  border: 1px solid var(--be-border-s);
  border-radius: 4px;
  color: var(--be-accent);
  cursor: pointer;
  padding: 0.2rem 0.55rem;
  white-space: nowrap;
  transition: background 0.12s;
}
.be-palette-restore:hover { background: var(--be-accent-dim); }
.be-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-bottom: 0.875rem;
}
/* Wrapper so the remove ✕ can sit outside the chip */
.be-swatch-chip-wrap {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
}
.be-swatch-chip-wrap:hover .be-swatch-remove { opacity: 1; pointer-events: auto; }
.be-swatch-remove {
  position: absolute;
  top: -5px; right: -5px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #ef4444;
  border: 1.5px solid #18181b;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s, transform 0.12s;
  z-index: 2;
  padding: 0;
  line-height: 1;
}
.be-swatch-remove:hover { transform: scale(1.2); }
.be-swatch-chip {
  position: relative;
  width: 30px; height: 30px;
  border-radius: var(--radius-sm);
  border: 2px solid rgba(0,0,0,0.08);
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.14s, box-shadow 0.14s;
  overflow: visible;
}
.be-swatch-chip:hover { transform: scale(1.12); box-shadow: 0 4px 12px rgba(0,0,0,0.2); z-index: 1; }
.be-swatch-chip:hover .be-swatch-tip { opacity: 1; pointer-events: none; }
.be-swatch-tip {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #18181b;
  color: #fff;
  font-size: 0.7rem;
  font-family: ui-monospace, monospace;
  white-space: nowrap;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.15s;
  pointer-events: none;
  z-index: 10;
}
.be-swatch-tip::after {
  content: '';
  position: absolute;
  top: 100%; left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: #18181b;
}

.be-autoassign-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.65rem 1rem;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-md);
  background: #FF7E3D;
  color: #fff;
  cursor: pointer;
  transition: filter 0.18s, transform 0.15s;
  line-height: 1;
}
.be-autoassign-btn:hover { filter: brightness(1.1); transform: translateY(-1px); }
.be-autoassign-btn:active { transform: translateY(0); }
.be-autoassign-sub {
  display: block;
  font-size: 0.72rem;
  font-weight: 400;
  opacity: 0.75;
  margin-top: 0.2rem;
}

/* Mini palette inside each section */
.be-section-palette {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  padding: 0.5rem 0.625rem 0.625rem;
  border-bottom: 1px solid var(--be-border);
  background: var(--be-bg);
  margin: -0.5rem -0.75rem 0.625rem;
}
.be-section-palette .be-swatch-chip-wrap .be-swatch-chip {
  width: 22px;
  height: 22px;
  border-radius: 4px;
}
.be-section-palette .be-swatch-remove {
  width: 12px; height: 12px;
  top: -4px; right: -4px;
}
.be-section-palette .be-swatch-chip.is-active {
  outline: 2px solid var(--be-accent);
  outline-offset: 1px;
  transform: scale(1.18);
}
.be-hex.is-targeted {
  border-color: var(--be-accent);
  background: var(--be-selected-bg);
}

/* Contrast warnings */
.be-contrast-group { margin-top: 0.625rem; display: flex; flex-direction: column; gap: 0.3rem; }
.be-contrast {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.38rem 0.55rem;
  border-radius: var(--radius-sm);
  line-height: 1.3;
}
.be-contrast svg { flex-shrink: 0; }
.be-contrast__ratio { margin-left: auto; font-variant-numeric: tabular-nums; opacity: 0.8; font-weight: 400; font-size: 0.72rem; }
.be-contrast--fail { background: #FEF2F2; color: #991B1B; border: 1px solid #FECACA; }
.be-contrast--warn { background: #FFFBEB; color: #78350F; border: 1px solid #FDE68A; }
.be-contrast--pass { background: #F0FDF4; color: #166534; border: 1px solid #BBF7D0; }

.brand-editor__actions {
  padding: 0.875rem 1.125rem;
  border-top: 1px solid var(--be-border-s);
  background: var(--be-bg);
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}
.brand-editor__actions .btn {
  flex: 1;
  justify-content: center;
  font-size: 0.8125rem;
  background: #ffffff !important;
  color: var(--be-body) !important;
  border: 1.5px solid var(--be-border-s) !important;
}
.brand-editor__actions .btn:hover {
  background: var(--be-surface) !important;
  color: var(--be-ink) !important;
}
.brand-editor__actions .btn--primary {
  background: #FF7E3D !important;
  color: #fff !important;
  border-color: #FF7E3D !important;
}

/* =========================================================================
   THEME TOAST — brand-config load confirmation
   ========================================================================= */
.theme-toast {
  position: fixed;
  bottom: 1.75rem;
  left: 50%;
  transform: translateX(-50%) translateY(0.75rem);
  background: var(--color-ink);
  color: #fff;
  padding: 0.55rem 1.25rem;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.22s, transform 0.22s;
  pointer-events: none;
  white-space: nowrap;
  z-index: 9000;
}
.theme-toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---- Powered by Spoonity badge ---- */
.powered-by__link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  opacity: 0.7;
  transition: opacity 0.2s;
}
.powered-by__link:hover { opacity: 1; }
.powered-by__label {
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--footer-legal);
  white-space: nowrap;
}
.spoonity-badge--light,
.spoonity-badge--dark  { height: 20px; width: auto; display: block; }
/* Default (light footer background) */
.spoonity-badge--dark  { display: none; }
/* Dynamic — set by JS via data-footer-theme */
.site-footer[data-footer-theme="light"] .spoonity-badge--dark  { display: none; }
.site-footer[data-footer-theme="light"] .spoonity-badge--light { display: block; }
.site-footer[data-footer-theme="dark"]  .spoonity-badge--light { display: none; }
.site-footer[data-footer-theme="dark"]  .spoonity-badge--dark  { display: block; }
