/* Loyalty in Pocket — base stylesheet
   Design tokens: dark indigo + warm accent. Mobile-first. No framework. */

:root {
  --bg: #0b1220;
  --bg-alt: #111a2e;
  --surface: #182238;
  --border: rgba(255, 255, 255, 0.08);
  --text: #e9edf6;
  --text-muted: #97a2bd;
  --accent: #f5b765;
  --accent-strong: #f0a341;
  --primary: #6e8bff;
  --primary-strong: #5b7aff;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
  --radius: 14px;
  --radius-sm: 8px;
  --maxw: 1120px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-display: "Inter", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-strong); }

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(11, 18, 32, 0.85);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: var(--text);
  font-size: 1.05rem;
}
.brand-mark {
  display: inline-block;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 14px var(--accent);
}
.nav-links { display: flex; gap: 22px; align-items: center; }
.nav-links a { color: var(--text-muted); font-weight: 500; }
.nav-links a:hover { color: var(--text); }

/* Buttons */
.btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  border: 0;
  cursor: pointer;
  transition: transform 0.06s ease, background 0.15s ease;
  font-family: inherit;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--accent);
  color: #1a1206;
}
.btn-primary:hover { background: var(--accent-strong); color: #1a1206; }
.btn-lg { padding: 16px 28px; font-size: 1.05rem; }
.btn-sm { padding: 8px 14px; font-size: 0.9rem; }

/* Hero */
.hero {
  padding: 64px 0 32px;
  background:
    radial-gradient(800px 400px at 20% 0%, rgba(110, 139, 255, 0.18), transparent 60%),
    radial-gradient(600px 400px at 90% 20%, rgba(245, 183, 101, 0.14), transparent 60%);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 64px;
  align-items: center;
}
.eyebrow {
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin: 0 0 16px;
  font-weight: 600;
}
.hero h1 {
  font-size: clamp(2rem, 4.4vw, 3.4rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 18px;
  font-family: var(--font-display);
}
.accent { color: var(--accent); }
.lede {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin: 0 0 28px;
}
.cta-row {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.cta-note { color: var(--text-muted); font-size: 0.95rem; }
.hero-bullets {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}
.hero-bullets li { color: var(--text-muted); }
.hero-bullets strong { color: var(--text); }

/* Phone mockup */
.hero-card { display: flex; justify-content: center; }
.phone-mock {
  width: 290px;
  border-radius: 38px;
  padding: 16px;
  background: linear-gradient(180deg, #1f2a45, #141d33);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.phone-screen {
  background: #fdfdfd;
  color: #1a1f2e;
  border-radius: 26px;
  padding: 24px 22px 28px;
  text-align: center;
}
.member-qr {
  width: 180px;
  height: 180px;
  margin: 6px auto 18px;
  border-radius: 12px;
  background: #1a1f2e;
  padding: 12px;
}
.qr-grid {
  width: 100%; height: 100%;
  background-image:
    linear-gradient(90deg, #fdfdfd 50%, transparent 50%),
    linear-gradient(180deg, #fdfdfd 50%, transparent 50%);
  background-size: 14px 14px, 14px 14px;
  border-radius: 6px;
  opacity: 0.92;
}
.member-name { font-weight: 700; margin: 0 0 4px; color: #1a1f2e; }
.member-sub { color: #5d6680; font-size: 0.88rem; margin: 0 0 16px; }
.merchant-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}
.chip {
  background: #f1f3f8;
  color: #1a1f2e;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.78rem;
  font-weight: 500;
}

/* Sections */
.section { padding: 80px 0; }
.section-alt { background: var(--bg-alt); }
.section-title {
  font-size: clamp(1.6rem, 2.6vw, 2.2rem);
  margin: 0 0 40px;
  letter-spacing: -0.01em;
  text-align: center;
}

/* How */
.how-steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.how-steps li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
}
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #1a1206;
  font-weight: 700;
  margin-bottom: 14px;
}
.how-steps h3 { margin: 0 0 10px; font-size: 1.15rem; }
.how-steps p { margin: 0; color: var(--text-muted); }

/* Pricing */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.price-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  position: relative;
}
.price-card.featured {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent) inset;
}
.ribbon {
  position: absolute;
  top: -12px;
  left: 24px;
  background: var(--accent);
  color: #1a1206;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
}
.price-card h3 { margin: 0 0 14px; font-size: 1.1rem; }
.price { margin: 0 0 18px; display: flex; align-items: baseline; gap: 6px; }
.amount { font-size: 2.2rem; font-weight: 700; }
.period { color: var(--text-muted); font-size: 0.95rem; }
.price-card ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
  color: var(--text-muted);
}
.price-card ul li::before { content: "✓ "; color: var(--accent); margin-right: 4px; }
.fine-print {
  margin-top: 28px;
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

/* CTA section */
.section-cta { padding: 64px 0; text-align: center; }
.cta-block h2 {
  font-size: clamp(1.4rem, 2.4vw, 2rem);
  margin: 0 0 14px;
  letter-spacing: -0.01em;
}
.cta-block p { color: var(--text-muted); margin: 0 0 26px; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 40px 0 28px;
  margin-top: 40px;
}
.footer-grid {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
  flex-wrap: wrap;
}
.brand-footer { margin: 0 0 4px; }
.muted { color: var(--text-muted); margin: 0; }
.small { font-size: 0.88rem; }
.footer-nav { display: flex; gap: 22px; flex-wrap: wrap; }
.footer-nav a { color: var(--text-muted); }
.footer-nav a:hover { color: var(--text); }
.footer-legal { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--border); }

/* Responsive */
@media (max-width: 880px) {
  .hero-grid { grid-template-columns: 1fr; gap: 32px; }
  .how-steps { grid-template-columns: 1fr; }
  .pricing-grid { grid-template-columns: 1fr; }
  .nav-links a:not(.btn) { display: none; }
}

/* ============================================================
   App components — forms, dashboard, member card, scanner, admin
   ============================================================ */

.muted-link { color: var(--text-muted); font-weight: 500; }
.muted-link:hover { color: var(--text); }

/* Forms */
.stacked-form { display: grid; gap: 18px; max-width: 100%; }
.field { display: grid; gap: 6px; }
.field-label { font-size: 0.92rem; color: var(--text); font-weight: 600; }
.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field input[type="number"],
.field input[type="search"] {
  width: 100%;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.field input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(110, 139, 255, 0.18);
}
.field input::placeholder { color: var(--text-muted); }
.check {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 10px;
  align-items: start;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.45;
}
.check input { margin-top: 4px; }
.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--surface); }
.link-button {
  background: transparent;
  border: 0;
  color: var(--text-muted);
  padding: 0;
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
}
.link-button:hover { color: var(--text); }

/* Dashboard */
.dash-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.stat-label {
  color: var(--text-muted);
  margin: 0 0 6px;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.stat-value {
  margin: 0;
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}
.dash-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.dash-card.span-2 { grid-column: span 2; }
.dash-card h2 { margin: 0 0 12px; font-size: 1.05rem; }
.dash-card p { margin: 0 0 16px; color: var(--text-muted); }
.dash-card p:last-child { margin-bottom: 0; }
.join-url {
  display: inline-block;
  background: rgba(110, 139, 255, 0.12);
  color: var(--text);
  padding: 4px 8px;
  border-radius: 6px;
  font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace;
  font-size: 0.85rem;
  word-break: break-all;
}

/* Member card */
.member-qr-wrap {
  background: #fff;
  padding: 24px;
  border-radius: var(--radius);
  display: grid;
  gap: 16px;
  justify-items: center;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.member-qr-large { width: 260px; height: 260px; max-width: 100%; }
.member-qr-wrap .muted { color: #5d6680 !important; }

.merchant-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.merchant-list li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}
.merchant-name { margin: 0 0 4px; font-weight: 600; }

.recovery-prompt {
  margin-top: 28px;
  padding: 18px 20px;
  background: rgba(245, 183, 101, 0.10);
  border: 1px solid rgba(245, 183, 101, 0.4);
  border-radius: var(--radius);
}
.recovery-headline { margin: 0 0 6px; font-weight: 600; color: var(--accent); }

/* Scanner */
.scanner {
  min-height: 100vh;
  background: #000;
  color: #fff;
  display: grid;
  grid-template-rows: auto 1fr auto;
}
.scanner-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  background: rgba(0, 0, 0, 0.5);
  position: sticky;
  top: 0;
  z-index: 2;
}
.scanner-back { color: #fff; text-decoration: none; font-weight: 500; }
.scanner-shop { font-weight: 600; }
.scanner-stage {
  position: relative;
  overflow: hidden;
  background: #111;
}
.scanner-stage video {
  width: 100%;
  height: auto;
  display: block;
  max-height: 60vh;
  object-fit: cover;
}
.scanner-overlay {
  position: absolute;
  inset: 12% 14%;
  border: 3px solid rgba(245, 183, 101, 0.9);
  border-radius: 16px;
  pointer-events: none;
}
.scanner-controls {
  padding: 16px 20px 22px;
  background: #0b1220;
  display: grid;
  gap: 14px;
}
.scanner-controls .muted { color: #97a2bd; margin: 0; }
.scanner-manual {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}
.scanner-manual input {
  padding: 10px 12px;
  background: #182238;
  border: 1px solid var(--border);
  color: #fff;
  border-radius: 8px;
  font: inherit;
}
.scanner-result {
  padding: 18px 20px;
  background: #fff;
  color: #0b1220;
  border-top-left-radius: 18px;
  border-top-right-radius: 18px;
  margin-top: -18px;
  position: relative;
  z-index: 1;
}
.scanner-good { color: #0f7a3a; font-weight: 700; margin: 0 0 6px; font-size: 1.1rem; }
.scanner-bad  { color: #9a1a1a; font-weight: 700; margin: 0; font-size: 1.05rem; }
.scanner-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.scanner-actions .btn { padding: 10px 16px; }

/* Admin progress feed */
.progress-feed {
  margin: 0;
  background: #0b1220;
  color: #c2cce6;
  font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace;
  font-size: 0.82rem;
  line-height: 1.55;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  max-height: 460px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Legal docs */
.legal-doc { max-width: 760px; margin: 0 auto; }
.legal-doc h1 { margin: 0 0 10px; }
.legal-doc h2 { margin: 32px 0 10px; font-size: 1.15rem; }
.legal-doc p, .legal-doc li { color: var(--text-muted); }
.legal-doc strong { color: var(--text); }
.legal-doc ul { padding-left: 20px; }

/* Small responsive tweaks */
@media (max-width: 760px) {
  .dash-card.span-2 { grid-column: auto; }
  .dash-head { flex-direction: column; }
}
