/* ─── TOKENS ─────────────────────────────────────────────── */
:root {
  --brand-blue: #2563EB;
  --brand-blue-dark: #1d4ed8;
  --brand-navy: #0F172A;
  --text-primary: #0F172A;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --bg-page: #ffffff;
  --bg-light: #F8FAFC;
  --bg-card: #ffffff;
  --border: #e2e8f0;
  --border-dark: #cbd5e1;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.07);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.10);
  --shadow-lg: 0 8px 32px rgba(15, 23, 42, 0.14);
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 24px;
}

/* ─── RESET ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif;
  background: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ─── VIEWS ──────────────────────────────────────────────── */
.view { display: none; }
.view.active { display: block; }

/* ─── LAYOUT HELPERS ─────────────────────────────────────── */
.section-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ─── LOGO ───────────────────────────────────────────────── */
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
.logo-text {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

/* ─── ANNOUNCE BAR ───────────────────────────────────────── */
.announce-bar {
  background: var(--brand-navy);
  color: rgba(255,255,255,0.85);
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  padding: 9px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  letter-spacing: 0.2px;
}
.announce-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  flex-shrink: 0;
  position: relative;
}
.announce-dot::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: rgba(34,197,94,0.35);
  animation: pulse-ring 1.8s ease-out infinite;
}
@keyframes pulse-ring {
  0%   { transform: scale(0.8); opacity: 1; }
  100% { transform: scale(2);   opacity: 0; }
}

/* ─── NAV ────────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.btn-nav {
  background: var(--brand-blue);
  color: #fff;
  border: none;
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 600;
  padding: 8px 18px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.btn-nav:hover { background: var(--brand-blue-dark); }
.btn-nav-ghost {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 500;
  padding: 7px 16px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.btn-nav-ghost:hover { border-color: var(--text-primary); color: var(--text-primary); }

/* ─── HERO ───────────────────────────────────────────────── */
.hero {
  padding: 80px 0 72px;
  text-align: center;
  background: #fff;
}
.hero-inner {
  max-width: 700px;
  margin: 0 auto;
  padding: 0 24px;
}

.hero-headline {
  font-size: clamp(36px, 6vw, 60px);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -1.5px;
  color: var(--text-primary);
  margin-bottom: 24px;
}
.hero-sub {
  font-size: 18px;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 560px;
  margin: 0 auto 36px;
}
.hero-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-bottom: 40px;
}
.btn-primary {
  background: var(--brand-blue);
  color: #fff;
  border: none;
  border-radius: var(--r-md);
  font-size: 16px;
  font-weight: 600;
  padding: 14px 28px;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}
.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,0.18) 50%, transparent 60%);
  transform: translateX(-100%);
  transition: transform 0s;
}
.btn-primary:hover::after {
  transform: translateX(100%);
  transition: transform 0.45s ease;
}
.btn-primary:hover {
  background: var(--brand-blue-dark);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
  transform: translateY(-2px);
}
.btn-primary:active { transform: translateY(0); box-shadow: none; }
.btn-large {
  font-size: 17px;
  padding: 16px 36px;
  border-radius: var(--r-lg);
  animation: cta-breathe 3s ease-in-out infinite;
}
.btn-large:hover { animation: none; }
@keyframes cta-breathe {
  0%, 100% { box-shadow: 0 0 0 0 rgba(37,99,235,0); }
  50%       { box-shadow: 0 0 0 8px rgba(37,99,235,0.15); }
}

.hero-counter {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 14px;
}
.hero-counter-num {
  font-size: 22px;
  font-weight: 800;
  color: var(--brand-blue);
}

/* Avatar stack */
.avatar-stack { display: flex; justify-content: center; }
.avatar-row {
  display: flex;
  align-items: center;
  gap: -8px;
}
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid #fff;
  margin-left: -10px;
  background: var(--bg-light);
  box-shadow: var(--shadow-sm);
  object-fit: cover;
}
.avatar:first-child { margin-left: 0; }
.avatar-more {
  margin-left: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* ─── BENTO SECTION ──────────────────────────────────────── */
.bento-section {
  background: var(--bg-light);
  padding: 80px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.section-title {
  font-size: clamp(24px, 4vw, 36px);
  font-weight: 800;
  letter-spacing: -0.8px;
  color: var(--text-primary);
  margin-bottom: 12px;
}
.section-sub {
  font-size: 17px;
  color: var(--text-secondary);
  margin-bottom: 48px;
  max-width: 500px;
}
.bento-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: auto auto;
  gap: 16px;
}
.bento-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, transform 0.2s;
}
.bento-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
  border-color: #BFDBFE;
}
.bento-large {
  grid-column: span 2;
}
.bento-wide {
  grid-column: span 2;
}
.bento-icon {
  width: 44px;
  height: 44px;
  background: #EFF6FF;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  color: var(--brand-blue);
  flex-shrink: 0;
}
.bento-icon svg {
  width: 22px;
  height: 22px;
  stroke: var(--brand-blue);
}
.bento-card h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
  letter-spacing: -0.3px;
}
.bento-card p {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.65;
}

/* ─── MID CTA ────────────────────────────────────────────── */
.mid-cta {
  padding: 80px 0;
  background: var(--brand-navy);
  text-align: center;
}
.mid-cta-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.mid-cta h2 {
  font-size: clamp(24px, 4vw, 36px);
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.8px;
}
.mid-cta p {
  font-size: 17px;
  color: rgba(255,255,255,0.65);
  max-width: 440px;
}
.mid-cta .btn-primary {
  background: #fff;
  color: var(--brand-navy);
}
.mid-cta .btn-primary:hover {
  background: #f1f5f9;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
}
.mid-cta-note {
  font-size: 13px;
  color: rgba(255,255,255,0.4);
}

/* ─── FAQ ────────────────────────────────────────────────── */
.faq-section {
  padding: 80px 0;
  background: #fff;
}
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 40px;
}
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  margin-bottom: 8px;
  transition: box-shadow 0.15s;
}
.faq-item[open] { box-shadow: var(--shadow-sm); }
.faq-item summary {
  padding: 18px 22px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-primary);
  background: #fff;
  transition: background 0.1s;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  font-size: 20px;
  font-weight: 400;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform 0.2s;
}
.faq-item[open] summary::after {
  content: "−";
}
.faq-item summary:hover { background: var(--bg-light); }
.faq-item > p {
  padding: 0 22px 18px;
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.7;
  border-top: 1px solid var(--border);
  padding-top: 16px;
  background: #fff;
}

/* ─── FOOTER ─────────────────────────────────────────────── */
.footer {
  padding: 40px 0;
  background: var(--bg-light);
  border-top: 1px solid var(--border);
}
.footer-inner { display: flex; flex-direction: column; gap: 24px; }
.footer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.footer-tagline {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
}
.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  padding-top: 20px;
}
.footer-note {
  font-size: 13px;
  color: var(--text-muted);
}
.footer-links {
  display: flex;
  gap: 20px;
}
.footer-links a {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}
.footer-links a:hover { color: var(--text-primary); }

/* ─── AUTH MODAL ─────────────────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal.hidden { display: none; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
}
.modal-content {
  position: relative;
  background: #fff;
  border-radius: var(--r-xl);
  padding: 36px;
  max-width: 420px;
  width: calc(100% - 32px);
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.2s ease;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.modal-close {
  position: absolute;
  top: 16px; right: 16px;
  background: var(--bg-light);
  border: none;
  width: 32px; height: 32px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: background 0.1s;
}
.modal-close:hover { background: var(--border); }
.auth-form h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-primary);
}
.auth-form > p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}
.btn-auth {
  width: 100%;
  padding: 13px 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--bg-light);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--text-primary);
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  margin-bottom: 12px;
  font-family: inherit;
}
.btn-auth:hover {
  border-color: var(--border-dark);
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.auth-icon { width: 18px; height: 18px; flex-shrink: 0; }
.auth-note {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 16px;
}

/* ─── TICKET PAGE ────────────────────────────────────────── */
.ticket-page {
  min-height: calc(100vh - 60px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
  background: var(--bg-light);
}
.ticket-card {
  background: #fff;
  border: 2px solid var(--brand-blue);
  border-radius: var(--r-xl);
  padding: 32px;
  max-width: 480px;
  width: 100%;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}
.ticket-card::before,
.ticket-card::after {
  content: '';
  position: absolute;
  width: 28px;
  height: 28px;
  background: var(--bg-light);
  border-radius: 50%;
  border: 2px solid var(--brand-blue);
  top: 50%;
  transform: translateY(-50%);
}
.ticket-card::before { left: -15px; }
.ticket-card::after  { right: -15px; }

.ticket-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1.5px dashed rgba(37, 99, 235, 0.25);
}
.ticket-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
}
.ticket-number-box {
  border: 2px solid var(--brand-blue);
  padding: 6px 12px;
  border-radius: var(--r-sm);
  font-family: 'Space Mono', 'Courier New', monospace;
  font-size: 13px;
  font-weight: 700;
  color: var(--brand-blue);
}
.ticket-welcome {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-primary);
}
.ticket-welcome span { color: var(--brand-blue); }
.ticket-counter-mini {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 24px;
}
.ticket-viral-copy {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 20px;
  padding: 14px;
  background: #EFF6FF;
  border-radius: var(--r-md);
}
.btn-share {
  width: 100%;
  padding: 13px 20px;
  background: var(--text-primary);
  color: #fff;
  border: none;
  border-radius: var(--r-md);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
  transition: background 0.15s, transform 0.1s;
  font-family: inherit;
}
.btn-share:hover { background: #1e293b; transform: translateY(-1px); }
.share-icon { width: 16px; height: 16px; }
.ticket-referral-box {
  border: 2px solid var(--brand-blue);
  border-radius: var(--r-md);
  padding: 12px 16px;
  margin-bottom: 12px;
  text-align: center;
  background: #EFF6FF;
  cursor: pointer;
}
.referral-url {
  font-family: 'Space Mono', 'Courier New', monospace;
  font-size: 13px;
  font-weight: 600;
  color: var(--brand-blue);
  word-break: break-all;
}
.referral-url:hover { color: var(--brand-blue-dark); }
.ticket-referral-status {
  font-size: 13px;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 16px;
}
#referral-count { font-weight: 700; color: var(--brand-blue); }
.ticket-footer {
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: center;
  color: var(--text-muted);
  background: var(--bg-light);
}
#user-email { color: var(--text-primary); font-weight: 700; }
#vip-badge { font-size: 13px; font-weight: 600; color: var(--brand-blue); }

/* ─── ERROR TOAST ────────────────────────────────────────── */
.error-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: #0F172A;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  padding: 12px 20px;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  max-width: 90vw;
  text-align: center;
  pointer-events: none;
}
.error-toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ─── AUTH FAILURE ───────────────────────────────────────── */
.auth-failure-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
  background: var(--bg-light);
}
.auth-failure-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 48px 40px;
  max-width: 480px;
  width: 100%;
  box-shadow: var(--shadow-md);
  text-align: center;
}
.auth-failure-icon {
  width: 64px;
  height: 64px;
  background: #FFF7ED;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #F59E0B;
  margin: 0 auto 24px;
}
.auth-failure-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
  letter-spacing: -0.3px;
}
.auth-failure-body {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 20px;
}
.auth-failure-tip {
  font-size: 14px;
  color: var(--text-secondary);
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px 16px;
  line-height: 1.6;
  margin-bottom: 28px;
  text-align: left;
}
.auth-failure-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}
.btn-retry {
  width: 100%;
  padding: 12px 20px;
  border: 1.5px solid var(--border-dark);
  border-radius: var(--r-md);
  background: #fff;
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background 0.15s, border-color 0.15s;
}
.btn-retry:hover { background: var(--bg-light); border-color: var(--brand-blue); }
.btn-retry-dark {
  background: #0F172A;
  color: #fff;
  border-color: #0F172A;
}
.btn-retry-dark:hover { background: #1e293b; border-color: #1e293b; }
.auth-failure-back {
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}
.auth-failure-back:hover { color: var(--brand-blue); }

/* ─── UTILS ──────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ─── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 700px) {
  .hero { padding: 56px 0 48px; }
  .hero-headline { font-size: 36px; letter-spacing: -1px; }
  .hero-sub { font-size: 16px; }
  .bento-grid {
    grid-template-columns: 1fr;
  }
  .bento-large, .bento-wide { grid-column: span 1; }
  .bento-section, .faq-section, .mid-cta { padding: 56px 0; }
  .ticket-card { padding: 24px; }
  .ticket-card::before, .ticket-card::after { display: none; }
}
