/* CardKRP — 2026 design system */

:root {
  /* Palette */
  --bg: #fafaf7;
  --bg-elevated: #ffffff;
  --bg-tinted: #f3f4f1;
  --fg: #0a0a0a;
  --fg-soft: #2a2a2a;
  --muted: #6a6a6a;
  --muted-soft: #a0a0a0;
  --border: #e6e6e2;
  --border-strong: #d4d4d0;

  --accent: #0a0a0a;
  --accent-soft: #1e1e1e;
  --accent-fg: #ffffff;
  --highlight: #fff8e1;
  --gradient-1: linear-gradient(135deg, #0a0a0a 0%, #2a2a2a 100%);
  --gradient-soft: linear-gradient(180deg, #fafaf7 0%, #f3f4f1 100%);
  --gradient-warm: linear-gradient(135deg, #fff7e6 0%, #ffe7c2 100%);
  --gradient-blue: linear-gradient(135deg, #1c3a6e 0%, #3a6ea8 100%);
  --gradient-mesh: radial-gradient(60% 60% at 20% 10%, rgba(255, 192, 80, 0.18) 0%, transparent 60%),
                   radial-gradient(50% 50% at 90% 30%, rgba(120, 80, 220, 0.16) 0%, transparent 60%),
                   radial-gradient(70% 70% at 50% 110%, rgba(50, 180, 130, 0.14) 0%, transparent 60%);

  --danger: #b00020;
  --danger-bg: #fff1f1;
  --ok: #0a7a3e;
  --ok-bg: #ecf9f0;

  /* Type */
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI Variable", "Segoe UI", system-ui, "Helvetica Neue", Helvetica, Arial, "PingFang HK", "Noto Sans CJK TC", "Microsoft JhengHei", sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --tracking-tight: -0.022em;
  --tracking-tighter: -0.032em;

  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-2xl: 36px;
  --r-full: 999px;

  --shadow-1: 0 1px 2px rgba(10,10,10,0.04), 0 1px 1px rgba(10,10,10,0.03);
  --shadow-2: 0 4px 12px rgba(10,10,10,0.06), 0 1px 3px rgba(10,10,10,0.04);
  --shadow-3: 0 24px 60px -20px rgba(10,10,10,0.18), 0 8px 24px rgba(10,10,10,0.06);
  --shadow-4: 0 60px 120px -30px rgba(10,10,10,0.28), 0 24px 48px rgba(10,10,10,0.10);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --t-fast: 120ms;
  --t-med: 200ms;
  --t-slow: 320ms;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0b0c;
    --bg-elevated: #131315;
    --bg-tinted: #18181b;
    --fg: #f5f5f4;
    --fg-soft: #d6d6d4;
    --muted: #9b9b98;
    --muted-soft: #6a6a68;
    --border: #232326;
    --border-strong: #2f2f33;

    --accent: #f5f5f4;
    --accent-soft: #e6e6e3;
    --accent-fg: #0a0a0a;
    --highlight: #2a2412;
    --gradient-1: linear-gradient(135deg, #f5f5f4 0%, #d6d6d4 100%);
    --gradient-soft: linear-gradient(180deg, #0b0b0c 0%, #18181b 100%);
    --gradient-warm: linear-gradient(135deg, #2a1f12 0%, #3a2a1a 100%);

    --shadow-1: 0 1px 2px rgba(0,0,0,0.4);
    --shadow-2: 0 4px 12px rgba(0,0,0,0.5);
    --shadow-3: 0 24px 60px -20px rgba(0,0,0,0.7);
    --shadow-4: 0 60px 120px -30px rgba(0,0,0,0.85);
  }
}

* { box-sizing: border-box; }
*::selection { background: var(--accent); color: var(--accent-fg); }

html, body { margin: 0; padding: 0; background: var(--bg); color: var(--fg); }
body {
  font-family: var(--font-sans);
  font-feature-settings: "ss01", "cv11", "calt";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  line-height: 1.55;
  min-height: 100dvh;
}

a { color: inherit; text-decoration: none; transition: opacity var(--t-fast) var(--ease); }
a:hover { opacity: 0.7; }
img, svg { display: block; max-width: 100%; }

/* Layout — fluid, fills the screen */
.container {
  width: 100%;
  margin: 0 auto;
  padding: clamp(1.25rem, 3vw, 3rem) clamp(1rem, 4vw, 4rem) 5rem;
}
.container.narrow { max-width: 32rem; }
.container.medium { max-width: 64rem; }

/* ─── Header ──────────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px clamp(16px, 4vw, 32px);
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
}

.brand {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: var(--tracking-tight);
}
.brand .dot { color: var(--muted-soft); }

.header-right {
  display: flex; align-items: center; gap: 14px;
}
.btn-link {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--fg);
  padding: 6px 10px;
  letter-spacing: var(--tracking-tight);
}
.btn-link:hover { opacity: 1; color: var(--muted); }
.btn.btn-sm {
  padding: 8px 14px;
  min-height: 36px;
  font-size: 0.88rem;
  border-radius: var(--r-sm);
}
@media (max-width: 540px) {
  .header-right { gap: 8px; }
  .header-right .lang { font-size: 0.72rem; }
  .header-right .lang a { padding: 4px 8px; }
  .header-right .btn-link { font-size: 0.85rem; padding: 4px 6px; }
  .header-right .btn.btn-sm { padding: 7px 12px; font-size: 0.82rem; }
}
@media (max-width: 400px) {
  .header-right .lang { display: none; }
}

.lang {
  display: inline-flex; align-items: center; gap: 2px;
  background: var(--bg-tinted);
  padding: 4px;
  border-radius: var(--r-full);
  font-size: 0.78rem;
  font-weight: 600;
}
.lang a {
  padding: 5px 12px;
  border-radius: var(--r-full);
  color: var(--muted);
  transition: all var(--t-fast) var(--ease);
}
.lang a:hover { opacity: 1; color: var(--fg); }
.lang a.active {
  background: var(--bg-elevated);
  color: var(--fg);
  box-shadow: var(--shadow-1);
}

.nav-auth {
  display: flex; gap: 18px; align-items: center;
  font-size: 0.92rem;
  flex-wrap: wrap;
}
.nav-auth a {
  color: var(--muted);
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--r-full);
  transition: background 150ms var(--ease), color 150ms var(--ease);
}
.nav-auth a:hover { color: var(--fg); opacity: 1; background: rgba(255,255,255,0.06); }
.nav-auth a.is-active {
  background: rgba(255,231,194,0.15);
  color: #ffe7c2;
}
.nav-auth .sep { width: 1px; height: 18px; background: var(--border); }
.nav-auth .user-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 10px 4px 4px;
  background: var(--bg-tinted);
  border-radius: var(--r-full);
  font-size: 0.85rem;
  color: var(--muted);
}
.nav-auth .user-chip .avatar {
  width: 24px; height: 24px;
  border-radius: var(--r-full);
  background: var(--gradient-1);
  color: var(--accent-fg);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 700;
}

.link-btn {
  background: none; border: 0; padding: 0;
  color: var(--muted); font: inherit; font-weight: 500;
  cursor: pointer;
}
.link-btn:hover { color: var(--fg); }

/* ─── Typography ──────────────────────────────────────────────────── */
h1, h2, h3, h4 { letter-spacing: var(--tracking-tight); font-weight: 600; }
h1 { font-size: clamp(1.8rem, 4.5vw, 2.4rem); margin: 0 0 14px; line-height: 1.1; }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); margin: 0 0 12px; line-height: 1.1; letter-spacing: var(--tracking-tighter); }
h3 { font-size: 1.1rem; margin: 0 0 6px; }
.lead { font-size: 1.1rem; color: var(--muted); }
.muted { color: var(--muted); }
.tiny { font-size: 0.82rem; }

/* ─── Buttons ─────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px;
  min-height: 48px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--fg);
  font: inherit;
  font-weight: 600;
  letter-spacing: var(--tracking-tight);
  cursor: pointer;
  transition: transform var(--t-fast) var(--ease), background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), opacity var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
  user-select: none;
}
.btn:hover { opacity: 1; transform: translateY(-1px); box-shadow: var(--shadow-2); }
.btn:active { transform: translateY(0); box-shadow: var(--shadow-1); }
.btn-primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-soft); border-color: var(--accent-soft); }
.btn-ghost { background: transparent; border-color: var(--border); }
.btn-ghost:hover { background: var(--bg-tinted); }
.btn-block { width: 100%; }
.btn-lg { padding: 14px 24px; min-height: 54px; font-size: 1.02rem; border-radius: var(--r-md); }

/* ─── Forms ───────────────────────────────────────────────────────── */
.form { display: flex; flex-direction: column; gap: 14px; margin: 22px 0; }
.form label { display: flex; flex-direction: column; gap: 6px; }
.form label > span { font-weight: 600; font-size: 0.85rem; letter-spacing: var(--tracking-tight); }
.form label small { font-size: 0.8rem; color: var(--muted); margin-top: 2px; }
.form input, .form select, .form textarea {
  font: inherit;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-elevated);
  color: var(--fg);
  width: 100%;
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
  min-height: 48px;
}
.form input::placeholder { color: var(--muted-soft); }
.form input:focus, .form select:focus, .form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 12%, transparent);
}

/* ─── Alerts ──────────────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--r-md);
  margin: 12px 0;
  font-size: 0.92rem;
  border: 1px solid;
}
.alert-error { background: var(--danger-bg); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 22%, transparent); }
.alert-ok    { background: var(--ok-bg);    color: var(--ok);    border-color: color-mix(in srgb, var(--ok) 22%, transparent); }
.alert p { margin: 4px 0; }

/* ─── Generic card ────────────────────────────────────────────────── */
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 22px;
  box-shadow: var(--shadow-1);
  transition: transform var(--t-med) var(--ease), box-shadow var(--t-med) var(--ease), border-color var(--t-med) var(--ease);
}
.card.highlight {
  background: var(--gradient-warm);
  border-color: color-mix(in srgb, #d9a35a 30%, transparent);
}
.card.link {
  display: block;
  color: var(--fg);
  cursor: pointer;
}
.card.link:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-3);
  border-color: var(--border-strong);
  opacity: 1;
}
.card .card-icon {
  width: 42px; height: 42px;
  border-radius: var(--r-md);
  background: var(--bg-tinted);
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
  font-size: 1.2rem;
}

.bento {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin: 18px 0;
}

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px;
  border-radius: var(--r-full);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 20px;
  box-shadow: var(--shadow-1);
}
.eyebrow .pulse {
  width: 7px; height: 7px; border-radius: var(--r-full);
  background: var(--ok);
  animation: pulse 2s var(--ease) infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent); }
  70%  { box-shadow: 0 0 0 10px color-mix(in srgb, var(--ok) 0%, transparent); }
  100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 0%, transparent); }
}

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border-radius: var(--r-full);
  background: var(--bg-tinted);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}
.badge.success { background: var(--ok-bg); color: var(--ok); }
.badge.warn    { background: var(--highlight); color: #8a6a00; }

/* ─── Reveal animation ────────────────────────────────────────────── */
.reveal { animation: reveal var(--t-slow) var(--ease) both; }
@keyframes reveal { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.reveal:nth-child(2) { animation-delay: 60ms; }
.reveal:nth-child(3) { animation-delay: 120ms; }
.reveal:nth-child(4) { animation-delay: 180ms; }
.reveal:nth-child(5) { animation-delay: 240ms; }
.reveal:nth-child(6) { animation-delay: 300ms; }

/* ╔══════════════════════════════════════════════════════════════════╗
   ║  LANDING PAGE                                                     ║
   ╚══════════════════════════════════════════════════════════════════╝ */

.lp-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(48px, 8vw, 96px) 0 clamp(40px, 8vw, 80px);
}
.lp-hero__bg {
  position: absolute; inset: -10% -10% auto -10%;
  height: 120%;
  background: var(--gradient-mesh);
  filter: blur(40px);
  z-index: -1;
  pointer-events: none;
  opacity: 0.85;
}
.lp-hero__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(36px, 6vw, 64px);
  align-items: center;
  padding-bottom: 0;
}
@media (min-width: 980px) {
  .lp-hero__inner { grid-template-columns: 1.05fr 1fr; }
}

.lp-hero__title {
  font-size: clamp(2.6rem, 7vw, 4.8rem);
  line-height: 0.98;
  letter-spacing: var(--tracking-tighter);
  font-weight: 700;
  margin: 0 0 22px;
  background: var(--gradient-1);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lp-hero__lead {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: var(--muted);
  max-width: 520px;
  margin: 0 0 28px;
  letter-spacing: var(--tracking-tight);
  line-height: 1.5;
}
.cta-row {
  display: inline-flex; gap: 10px; flex-wrap: wrap;
}
.trust-row {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-top: 28px;
}

/* Phone mockup */
.lp-hero__device {
  display: flex;
  justify-content: center;
  position: relative;
}
.phone {
  width: 100%;
  max-width: 340px;
  aspect-ratio: 9/19;
  background: #0a0a0a;
  border-radius: 44px;
  padding: 12px;
  position: relative;
  box-shadow: var(--shadow-4),
              inset 0 0 0 1.5px rgba(255,255,255,0.08),
              inset 0 0 30px rgba(255,255,255,0.04);
  transform: perspective(1400px) rotateY(-8deg) rotateX(2deg) rotate(0.5deg);
  transition: transform var(--t-slow) var(--ease);
}
.phone:hover { transform: perspective(1400px) rotateY(-3deg) rotateX(1deg); }
.phone__notch {
  position: absolute;
  top: 18px; left: 50%; transform: translateX(-50%);
  width: 100px; height: 24px;
  background: #000;
  border-radius: var(--r-full);
  z-index: 2;
}
.phone__screen {
  width: 100%; height: 100%;
  background: linear-gradient(180deg, #f0f0ee 0%, #e2e2dc 100%);
  border-radius: 32px;
  padding: 50px 16px 18px;
  position: relative;
  overflow: hidden;
}
.phone__statusbar {
  display: flex; justify-content: space-between;
  font-size: 0.7rem; font-weight: 700;
  color: #1a1a1a;
  letter-spacing: 0;
  margin-bottom: 16px;
}
.phone__wallet-title {
  font-size: 0.7rem; font-weight: 700;
  color: #4a4a4a;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.phone__wallet { display: flex; flex-direction: column; gap: 12px; }

.loyalty-card-3d {
  width: 100%;
  aspect-ratio: 1.586/1;
  border-radius: 16px;
  background: linear-gradient(135deg, #1a1a1a 0%, #404040 100%);
  color: #fff;
  padding: 14px 16px;
  display: flex; flex-direction: column; justify-content: space-between;
  box-shadow: 0 10px 24px rgba(0,0,0,0.35);
  position: relative;
  overflow: hidden;
}
.loyalty-card-3d::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(120% 80% at 0% 0%, rgba(255,255,255,0.16), transparent 60%);
  pointer-events: none;
}
.loyalty-card-3d.alt {
  background: linear-gradient(135deg, #1c3a6e 0%, #3a6ea8 100%);
}
.lc-brand { font-size: 0.85rem; font-weight: 600; letter-spacing: var(--tracking-tight); }
.lc-balance { font-size: 1.6rem; font-weight: 700; letter-spacing: var(--tracking-tighter); }
.lc-sub { font-size: 0.7rem; opacity: 0.7; letter-spacing: var(--tracking-tight); }

.lc-stamps {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 4px 6px;
  margin-top: 8px;
}
.lc-stamps .dot {
  width: 11px; height: 11px;
  border-radius: var(--r-full);
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.2);
}
.lc-stamps .dot.filled {
  background: #ffe7c2;
  border-color: #ffe7c2;
  box-shadow: 0 0 8px rgba(255,231,194,0.5);
}

/* ─── Sections ────────────────────────────────────────────────────── */
.lp-section { padding: clamp(48px, 8vw, 96px) 0; }
.lp-section__head { text-align: center; max-width: 720px; margin: 0 auto 36px; }
.lp-section__head .badge { margin-bottom: 14px; }

/* Steps */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}
.step {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 26px 24px;
  position: relative;
  overflow: hidden;
}
.step__num {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--muted-soft);
  margin-bottom: 14px;
}
.step h3 { margin-bottom: 8px; font-size: 1.2rem; }
.step .muted { font-size: 0.96rem; }
.step__visual {
  margin-top: 22px;
  min-height: 160px;
  border-radius: var(--r-md);
  background: var(--bg-tinted);
  display: flex; align-items: center; justify-content: center;
  position: relative;
  overflow: hidden;
}

/* Counter QR mock */
.counter-qr {
  width: 130px;
  aspect-ratio: 3/4;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  padding: 16px;
  box-shadow: var(--shadow-2);
}
.counter-qr__pattern {
  width: 80px; height: 80px;
  border-radius: 8px;
  background:
    conic-gradient(from 45deg at 25% 25%, #0a0a0a 25%, transparent 0 50%, #0a0a0a 0 75%, transparent 0),
    linear-gradient(45deg, #0a0a0a 25%, transparent 25%, transparent 50%, #0a0a0a 50%, #0a0a0a 75%, transparent 75%);
  background-size: 16px 16px, 8px 8px;
  background-color: #fff;
  border: 8px solid #fff;
  outline: 1px solid var(--border);
}
.counter-qr__label { font-size: 0.7rem; font-weight: 700; text-align: center; color: var(--muted); }

/* Scan animation */
.scan-anim {
  position: relative;
  width: 160px;
  height: 100px;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, #1a1a1a 0%, #404040 100%);
  overflow: hidden;
}
.scan-anim__viewer {
  position: absolute; inset: 16px;
  border: 2px solid rgba(255,255,255,0.4);
  border-radius: 6px;
}
.scan-anim__line {
  position: absolute; left: 16px; right: 16px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #ffe7c2, transparent);
  top: 16px;
  animation: scanline 2s var(--ease) infinite;
  box-shadow: 0 0 12px rgba(255,231,194,0.7);
}
@keyframes scanline {
  0%   { top: 16px; }
  50%  { top: calc(100% - 18px); }
  100% { top: 16px; }
}

/* Mini card visual */
.mini-card {
  width: 160px;
  aspect-ratio: 1.586/1;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, #1c3a6e 0%, #3a6ea8 100%);
  box-shadow: var(--shadow-3);
}

/* Bento variant for landing */
.lp-bento { grid-template-columns: repeat(6, 1fr); }
.lp-bento .card { grid-column: span 3; }
.lp-bento__hero { grid-column: span 6; min-height: 220px; display: flex; align-items: center; gap: 24px; }
.lp-bento__hero > div:first-child { flex: 1; }
.lp-bento__hero-visual { flex: 0 0 auto; width: 220px; height: 160px; position: relative; }
.wallet-stack { position: relative; width: 100%; height: 100%; }
.wallet-mini {
  position: absolute;
  width: 75%;
  aspect-ratio: 1.586/1;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-3);
}
.wallet-mini--1 { left: 0; top: 24%; background: linear-gradient(135deg, #1a1a1a, #404040); transform: rotate(-8deg); }
.wallet-mini--2 { left: 18%; top: 8%;  background: linear-gradient(135deg, #1c3a6e, #3a6ea8); transform: rotate(-2deg); }
.wallet-mini--3 { right: 0; top: 30%; background: linear-gradient(135deg, #7c3a8e, #c66ea8); transform: rotate(7deg); }

@media (max-width: 880px) {
  .lp-bento { grid-template-columns: 1fr 1fr; }
  .lp-bento .card { grid-column: span 1; }
  .lp-bento__hero { grid-column: span 2; flex-direction: column; }
  .lp-bento__hero-visual { width: 100%; }
}
@media (max-width: 560px) {
  .lp-bento { grid-template-columns: 1fr; }
  .lp-bento__hero { grid-column: span 1; }
}

/* ─── Pricing ─────────────────────────────────────────────────────── */
.pricing {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin: 28px 0;
}
.price-card { position: relative; }
.price-card .tier { font-size: 0.78rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; }
.price-card .price { font-size: 2.6rem; font-weight: 700; letter-spacing: var(--tracking-tighter); margin: 12px 0 4px; line-height: 1; }
.price-card .price small { font-size: 0.9rem; color: var(--muted); font-weight: 500; letter-spacing: 0; }
.price-card .features-list { list-style: none; padding: 0; margin: 16px 0 0; font-size: 0.92rem; color: var(--muted); }
.price-card .features-list li { padding: 8px 0; border-top: 1px dashed var(--border); }

/* ─── FAQ ─────────────────────────────────────────────────────────── */
.faq { max-width: 760px; margin: 0 auto; }
.faq__item {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 16px 18px;
  margin: 8px 0;
  background: var(--bg-elevated);
  box-shadow: var(--shadow-1);
}
.faq__item summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex; align-items: center; justify-content: space-between;
  letter-spacing: var(--tracking-tight);
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after {
  content: "+";
  font-size: 1.4rem;
  color: var(--muted);
  transition: transform var(--t-fast) var(--ease);
  font-weight: 300;
}
.faq__item[open] summary::after { transform: rotate(45deg); }
.faq__item p { margin: 12px 0 0; font-size: 0.95rem; line-height: 1.55; }

/* ─── Final CTA ───────────────────────────────────────────────────── */
.final-cta {
  background: var(--gradient-1);
  color: var(--accent-fg);
  border-color: transparent;
  padding: 40px clamp(20px, 4vw, 48px);
  border-radius: var(--r-2xl);
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
}
.final-cta h2 { color: var(--accent-fg); margin: 0 0 8px; }
.final-cta .muted { color: color-mix(in srgb, var(--accent-fg) 70%, transparent); }
.final-cta .btn-primary {
  background: var(--accent-fg); color: var(--accent); border-color: var(--accent-fg);
}
.final-cta .btn-primary:hover { background: color-mix(in srgb, var(--accent-fg) 88%, transparent); }

/* ─── Footer ──────────────────────────────────────────────────────── */
.site-footer {
  text-align: center;
  padding: 32px 16px 48px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  font-size: 0.88rem;
}

/* ─── Dashboard / generic helpers ─────────────────────────────────── */
.stat-num { font-size: clamp(2.2rem, 5vw, 3rem); font-weight: 700; letter-spacing: var(--tracking-tighter); line-height: 1; font-variant-numeric: tabular-nums; }
.stat-label { color: var(--muted); font-size: 0.92rem; margin-top: 6px; }
.center { text-align: center; }
.stack > * + * { margin-top: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.divider { height: 1px; background: var(--border); margin: 24px 0; }

/* Loyalty card preview used elsewhere */
.loyalty-card {
  width: 100%;
  max-width: 360px;
  aspect-ratio: 1.586 / 1;
  border-radius: var(--r-lg);
  background: var(--gradient-1);
  color: var(--accent-fg);
  padding: 18px 20px;
  display: flex; flex-direction: column; justify-content: space-between;
  box-shadow: var(--shadow-3);
  position: relative;
  overflow: hidden;
}
.loyalty-card::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(120% 80% at 0% 0%, rgba(255,255,255,0.18), transparent 60%);
  pointer-events: none;
}

/* ─── Branded customer hero (merchant takeover) ───────────────────── */
.branded-hero {
  padding: clamp(48px, 8vw, 96px) 0 80px;
  position: relative;
  overflow: hidden;
}
.branded-hero::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(60% 60% at 20% 10%, rgba(255,255,255,0.18) 0%, transparent 60%),
              radial-gradient(50% 50% at 90% 20%, rgba(255,255,255,0.1) 0%, transparent 60%);
  pointer-events: none;
}
.branded-inner {
  padding: clamp(20px, 4vw, 36px) clamp(16px, 4vw, 32px) 0;
  text-align: center;
  position: relative;
}
.branded-logo {
  width: 72px; height: 72px;
  object-fit: contain;
  background: rgba(255,255,255,0.94);
  border-radius: var(--r-lg);
  padding: 8px;
  margin: 0 auto 18px;
  box-shadow: var(--shadow-3);
}
.branded-hero h1 {
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  font-weight: 700;
  letter-spacing: var(--tracking-tighter);
  line-height: 1.1;
  margin: 0 0 8px;
}

/* ─── Template editor layout ──────────────────────────────────────── */
.tpl-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  margin-top: 18px;
}
@media (min-width: 880px) {
  .tpl-grid { grid-template-columns: 1.2fr 1fr; }
}
.tpl-preview-wrap { display: flex; flex-direction: column; }
.tpl-preview-sticky {
  position: sticky;
  top: 80px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 18px;
  background: var(--bg-tinted);
  border-radius: var(--r-lg);
}
.tpl-preview-sticky .loyalty-card { max-width: 320px; }

/* ─── Bar chart ───────────────────────────────────────────────────── */
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 140px;
  padding: 12px 0 8px;
  border-bottom: 1px solid var(--border);
}
.bar-wrap {
  flex: 1;
  display: flex; flex-direction: column; align-items: center;
  gap: 4px;
  min-width: 16px;
}
.bar {
  width: 100%;
  background: var(--gradient-1);
  border-radius: 4px 4px 0 0;
  min-height: 2px;
}
.bar-wrap small { font-size: 0.65rem; color: var(--muted-soft); }

.row-actions { display: inline; }
.row-actions summary { color: var(--muted); cursor: pointer; }
.row-actions > div { display: flex; flex-direction: column; gap: 6px; padding: 8px 0; }

/* ─── Back link (sub-pages) ───────────────────────────────────────── */
.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  border-radius: var(--r-full);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.85);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 150ms var(--ease), transform 150ms var(--ease);
  margin-top: 8px;
}
.back-link:hover {
  background: rgba(255,255,255,0.12);
  transform: translateX(-2px);
  opacity: 1;
}
/* Light fallback for non-dark pages */
body:not(.lp-body) .back-link {
  background: var(--bg-tinted);
  border-color: var(--border);
  color: var(--fg);
}

/* ─── Impersonation banner ────────────────────────────────────────── */
.imp-banner {
  background: linear-gradient(90deg, #b97a2a 0%, #d49a4a 100%);
  color: #1a0e00;
  padding: 12px 20px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 60;
  box-shadow: 0 4px 14px rgba(185, 122, 42, 0.35);
  border-bottom: 2px solid rgba(0,0,0,0.2);
}
.imp-banner__text { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 200px; }
.imp-banner__icon {
  width: 36px; height: 36px;
  border-radius: var(--r-full);
  background: rgba(0,0,0,0.85);
  color: #ffe7c2;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.05rem;
  flex-shrink: 0;
}
.imp-banner strong { font-size: 0.95rem; font-weight: 800; display: block; }
.imp-banner__sub { font-size: 0.78rem; opacity: 0.75; font-weight: 500; margin-top: 2px; }
.imp-banner__exit {
  background: #0a0a0a;
  color: #ffe7c2;
  border: 0;
  padding: 10px 18px;
  border-radius: var(--r-full);
  font: inherit;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  transition: background 150ms var(--ease), transform 150ms var(--ease);
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.35);
}
.imp-banner__exit:hover { background: #1a1a1a; transform: translateY(-1px); }

/* ─── Data table ──────────────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.data-table th, .data-table td {
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.data-table th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; background: var(--bg-tinted); }
.data-table tr:last-child td { border-bottom: 0; }

/* ─── Staff PWA scan ──────────────────────────────────────────────── */
.staff-body {
  background: #0a0a0a;
  color: #f5f5f4;
  min-height: 100dvh;
}
.staff-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  background: #18181b;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.staff-top__left { display: flex; flex-direction: column; }
.staff-top__left strong { font-size: 0.95rem; }
.staff-top .muted { color: #9b9b98; }
.staff-top .link-btn { color: #9b9b98; }
.staff-top .link-btn:hover { color: #fff; }

.staff-main { padding: 16px; padding-bottom: env(safe-area-inset-bottom, 0); }
.staff-stage.hidden { display: none; }

.scan-viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 3/4;
  max-height: 70vh;
  margin: 0 auto;
  background: #000;
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-3);
}
.scan-viewport video { width: 100%; height: 100%; object-fit: cover; }
.scan-frame {
  position: absolute; inset: 18% 14%;
  pointer-events: none;
}
.scan-frame span {
  position: absolute; width: 28px; height: 28px;
  border-color: rgba(255,231,194,0.95);
  border-style: solid; border-width: 0;
}
.scan-frame span:nth-child(1) { top: 0; left: 0; border-top-width: 3px; border-left-width: 3px; border-top-left-radius: 8px; }
.scan-frame span:nth-child(2) { top: 0; right: 0; border-top-width: 3px; border-right-width: 3px; border-top-right-radius: 8px; }
.scan-frame span:nth-child(3) { bottom: 0; left: 0; border-bottom-width: 3px; border-left-width: 3px; border-bottom-left-radius: 8px; }
.scan-frame span:nth-child(4) { bottom: 0; right: 0; border-bottom-width: 3px; border-right-width: 3px; border-bottom-right-radius: 8px; }
.scan-line {
  position: absolute; top: 20%; left: 16%; right: 16%;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255,231,194,0.9), transparent);
  box-shadow: 0 0 14px rgba(255,231,194,0.7);
  animation: scanline-staff 1.8s var(--ease) infinite;
}
@keyframes scanline-staff { 0% { top: 20%; } 50% { top: 78%; } 100% { top: 20%; } }
.scan-hint {
  text-align: center; color: #9b9b98;
  font-size: 0.92rem; margin: 18px 0;
}

.scan-card {
  background: #131315;
  border-color: rgba(255,255,255,0.08);
  color: #f5f5f4;
}
.scan-card .muted { color: #9b9b98; }
.scan-card__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.scan-card__name { font-size: 1.4rem; margin: 4px 0; }
.scan-card__balance { display: flex; align-items: baseline; gap: 10px; margin: 16px 0 8px; }
.scan-card .stat-num { color: #ffe7c2; }
.scan-stamps { margin: 8px 0 12px; gap: 6px; }
.scan-stamps .dot { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.2); }
.scan-stamps .dot.filled { background: #ffe7c2; border-color: #ffe7c2; box-shadow: 0 0 8px rgba(255,231,194,0.5); }
.scan-actions {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px;
  margin-top: 16px;
}
.scan-actions .btn { min-height: 56px; font-size: 1rem; }
.scan-actions .btn-primary { background: #ffe7c2; color: #2a1f12; border-color: #ffe7c2; }
.scan-actions .btn-ghost { background: rgba(255,255,255,0.06); color: #f5f5f4; border-color: rgba(255,255,255,0.15); }
.scan-card .alert.hidden { display: none; }

/* ─── Mobile tweaks ───────────────────────────────────────────────── */
@media (max-width: 540px) {
  .nav-auth { gap: 12px; font-size: 0.85rem; }
  .form input, .form select, .form textarea { padding: 12px 13px; min-height: 46px; }
  .card { padding: 18px; }
  .phone { max-width: 280px; }
  .final-cta { text-align: center; justify-content: center; }
}
