/* Mac / member side — dark, desktop-optimized */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

:root {
  --bg: #0a0a0a;
  --surface: #141414;
  --surface2: #1e1e1e;
  --border: #2a2a2a;
  --text: #e0e0e0;
  --text-muted: #888;
  --accent: #6ee7b7;
  --accent2: #818cf8;
  --danger: #f87171;
  --success: #4ade80;
  --radius: 12px;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Layout */
.page { max-width: 900px; margin: 0 auto; padding: 48px 24px; }

/* Nav */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: relative;
  z-index: 200;
}
.nav-brand {
  font-size: 0.99rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.5px;
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  margin-bottom: 24px;
}
.card-sm { padding: 20px; }

/* Hero section on referral page */
.hero {
  text-align: center;
  padding: 34px 17px 34px;
  container-type: inline-size;
}
.hero h1 {
  font-size: clamp(1.08rem, 5.85cqi, 2.52rem);
  white-space: nowrap;
  font-weight: 700;
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero .business-name {
  font-size: 0.99rem;
  color: var(--text-muted);
  margin-bottom: 22px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.deal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  max-width: 580px;
  margin: 0 auto 22px;
}
.deal-offer {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 6px;
}
.deal-referrer {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 17px;
}
.deal-tiers { display: flex; gap: 11px; justify-content: center; flex-wrap: wrap; }
.tier {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 11px 17px;
  text-align: center;
  min-width: 160px;
}
.tier-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.tier-value {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
}
.tier.promo { border-color: var(--accent); }
.tier.promo .tier-value { color: var(--accent); }
.tier-expiry {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 3px;
}

/* Shared deal card (matches business scan result card) */
.deal-card {
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.deal-card .offer-text {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.35;
}
.deal-card .meta { font-size: 0.85rem; color: var(--text-muted); line-height: 1.5; }
.deal-card .meta span { color: var(--text); font-weight: 600; }

/* CTA button */
.btn {
  display: inline-block;
  padding: 10px 22px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}
.btn:hover { opacity: 0.88; transform: translateY(-1px); text-decoration: none; }
.btn:active { transform: translateY(0); }
.btn:disabled, .btn[disabled] { opacity: 0.35; cursor: not-allowed; pointer-events: none; }
.btn-primary { background: var(--accent); color: #0a0a0a; }
.btn-secondary { background: var(--surface2); color: var(--text); border: 1px solid var(--border); }
.btn-lg { padding: 13px 34px; font-size: 1.035rem; }
.btn-full { width: 100%; text-align: center; display: block; }

/* Required field pulse — white glow when share is tapped with empty fields */
@keyframes field-pulse {
  0%   { border-color: rgba(255,255,255,0.55); box-shadow: 0 0 0 3px rgba(255,255,255,0.1); }
  60%  { border-color: rgba(255,255,255,0.55); box-shadow: 0 0 0 3px rgba(255,255,255,0.1); }
  100% { border-color: var(--border); box-shadow: none; }
}
.field-pulse { animation: field-pulse 1.2s ease forwards; }

/* QR overlay */
.qr-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 100;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 17px;
}
.qr-overlay.active { display: flex; }
.qr-card {
  text-align: center;
  max-width: 320px;
  width: 88vw;
  padding: 20px 17px 17px;
  position: relative;
}
.qr-card img.qr-img {
  display: block;
  width: min(55vw, 200px);
  height: min(55vw, 200px);
  border-radius: 12px;
  margin: 0 auto 7px;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.qr-code-text {
  font-family: monospace;
  font-size: 0.65rem;
  letter-spacing: 1.5px;
  color: #3a3a3a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.qr-overlay .qr-close {
  position: absolute;
  top: -10px;
  right: -10px;
  font-size: 0.99rem;
  cursor: pointer;
  color: #888;
  background: #1e1e1e;
  border: 1px solid #333;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  z-index: 1;
}
/* Redemption success popup */
.redeem-popup {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.redeem-popup.visible {
  opacity: 1;
  pointer-events: auto;
}
.redeem-popup-card {
  background: #0d1f0d;
  border: 2px solid #16a34a;
  border-radius: 20px;
  padding: 25px 20px;
  text-align: center;
  max-width: 300px;
  width: 90%;
  transform: scale(0.92);
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
.redeem-popup.visible .redeem-popup-card {
  transform: scale(1);
}
.redeem-check {
  font-size: 2.7rem;
  margin-bottom: 7px;
}
.redeem-popup-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: #4ade80;
  margin-bottom: 6px;
}
.redeem-popup-sub {
  font-size: 0.774rem;
  color: #666;
  line-height: 1.55;
}

/* Index page */
.index-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
}
@media (max-width: 640px) {
  .index-grid { grid-template-columns: 1fr; }
}
.index-qr { text-align: center; }
.index-qr img { width: 220px; height: 220px; border-radius: 12px; margin-bottom: 12px; }
.index-qr .qr-url {
  font-size: 0.8rem;
  color: var(--text-muted);
  word-break: break-all;
  margin-top: 8px;
}
.recent-list { list-style: none; }
.recent-list li {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.recent-list li:last-child { border-bottom: none; }
.recent-code { font-family: monospace; font-size: 0.9rem; color: var(--text-muted); }

/* Section heading */
h2 { font-size: 1.4rem; font-weight: 600; margin-bottom: 16px; }
h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 12px; }
.muted { color: var(--text-muted); font-size: 0.9rem; }

/* Separator */
hr { border: none; border-top: 1px solid var(--border); margin: 32px 0; }
