:root {
  --bg: #0b0d12;
  --surface: #12161f;
  --surface-2: #181d29;
  --border: rgba(255, 255, 255, 0.09);
  --border-hi: rgba(99, 179, 237, 0.45);
  --text: #f1f5f9;
  --muted: #94a3b8;
  --cyan: #38bdf8;
  --violet: #a78bfa;
  --emerald: #34d399;
  --amber: #fbbf24;
  --rose: #fb7185;
  --font-sans: 'IBM Plex Sans Thai', 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', Consolas, monospace;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: radial-gradient(circle at 20% 0%, rgba(56, 189, 248, 0.11), transparent 42%),
              radial-gradient(circle at 80% 10%, rgba(167, 139, 250, 0.11), transparent 42%),
              var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.65;
  min-height: 100vh;
}

.mono { font-family: var(--font-mono); }
.hidden { display: none !important; }

.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 22px;
}

/* NAVBAR */
.navbar {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(14px);
  background: rgba(11, 13, 18, 0.82);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 19px;
  text-decoration: none;
  color: var(--text);
}
.brand-orb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan), var(--violet));
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.65);
}
.brand-sub {
  font-size: 12px;
  font-weight: 500;
  color: var(--cyan);
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.25);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 16px;
}
.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14.5px;
}
.nav-links a:hover { color: var(--text); }

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 15px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.14s ease, filter 0.14s ease, border-color 0.14s ease;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(0.98); }
.btn-primary {
  background: linear-gradient(135deg, #0ea5e9, #7c3aed);
  color: #fff;
  box-shadow: 0 6px 24px rgba(14, 165, 233, 0.28);
}
.btn-emerald {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
}
.btn-ghost {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border);
  color: var(--text);
}
.btn-sm {
  padding: 7px 14px;
  font-size: 13.5px;
}

/* HERO */
.hero {
  padding: 72px 0 54px;
  text-align: center;
}
.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: #7dd3fc;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.28);
  margin-bottom: 18px;
}
.hero h1 {
  font-size: clamp(30px, 4.6vw, 50px);
  line-height: 1.22;
  font-weight: 800;
  max-width: 880px;
  margin: 0 auto 18px;
}
.grad-text {
  background: linear-gradient(135deg, #38bdf8, #c084fc, #34d399);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero p {
  font-size: 18px;
  color: var(--muted);
  max-width: 740px;
  margin: 0 auto 28px;
}
.hero-cta-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-bottom: 36px;
}
.hero-proof-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
  color: var(--muted);
  font-size: 14px;
}
.hero-proof-strip strong { color: var(--emerald); }

/* FEATURE GRID */
.section {
  padding: 54px 0;
}
.section-title {
  text-align: center;
  margin-bottom: 36px;
}
.section-title h2 {
  font-size: 29px;
  margin-bottom: 8px;
}
.section-title p {
  color: var(--muted);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}
.f-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
}
.f-icon {
  font-size: 26px;
  margin-bottom: 10px;
}
.f-card h3 {
  font-size: 18px;
  margin-bottom: 8px;
}
.f-card p {
  color: var(--muted);
  font-size: 14.5px;
}

/* COMPARISON TABLE */
.comp-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
}
.comp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
}
.comp-table th, .comp-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.comp-table th {
  background: var(--surface-2);
  font-weight: 700;
}
.comp-hi {
  background: rgba(56, 189, 248, 0.06);
  color: #e0f2fe;
  font-weight: 600;
}

/* PRICING */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 22px;
  align-items: stretch;
}
.p-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  position: relative;
}
.p-card.featured {
  border-color: rgba(167, 139, 250, 0.65);
  box-shadow: 0 0 36px rgba(124, 58, 237, 0.18);
  background: linear-gradient(180deg, rgba(124, 58, 237, 0.09), var(--surface) 40%);
}
.pop-ribbon {
  position: absolute;
  top: -12px;
  right: 22px;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: linear-gradient(135deg, #38bdf8, #8b5cf6);
  color: #fff;
}
.p-name {
  font-size: 20px;
  font-weight: 700;
}
.p-desc {
  font-size: 13.5px;
  color: var(--muted);
  margin-top: 4px;
}
.p-price {
  margin: 18px 0;
  font-size: 38px;
  font-weight: 800;
}
.p-price small {
  font-size: 15px;
  font-weight: 400;
  color: var(--muted);
}
.p-list {
  list-style: none;
  margin-bottom: 24px;
  flex: 1;
}
.p-list li {
  padding: 6px 0;
  font-size: 14.5px;
  display: flex;
  gap: 8px;
}

/* KEY LOOKUP BOX */
.lookup-box {
  max-width: 680px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
}
.input-row {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}
.inp {
  width: 100%;
  padding: 11px 14px;
  border-radius: 10px;
  background: #0d1017;
  border: 1px solid var(--border);
  color: var(--text);
  font-family: inherit;
  font-size: 14.5px;
}
.inp:focus {
  outline: none;
  border-color: var(--cyan);
}

/* MODAL */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(0, 0, 0, 0.74);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-card {
  width: 100%;
  max-width: 540px;
  max-height: 92vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border-hi);
  border-radius: 18px;
  padding: 26px;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.qr-frame {
  background: #fff;
  padding: 14px;
  border-radius: 14px;
  width: fit-content;
  margin: 12px auto;
}
.key-result-box {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.45);
  border-radius: 12px;
  padding: 18px;
  text-align: center;
  margin-top: 14px;
}
.key-code {
  font-size: 20px;
  font-weight: 700;
  color: #6ee7b7;
  letter-spacing: 0.5px;
  margin: 8px 0;
  user-select: all;
}

/* ADMIN LAYOUT */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin: 22px 0;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
}
.stat-card span { font-size: 13px; color: var(--muted); }
.stat-card strong { display: block; font-size: 28px; margin-top: 4px; }
.admin-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  padding-bottom: 60px;
}
.slip-thumb {
  max-width: 180px;
  max-height: 220px;
  border-radius: 8px;
  border: 1px solid var(--border);
  cursor: pointer;
}
.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.badge.ok { background: rgba(52, 211, 153, 0.16); color: #6ee7b7; }
.badge.warn { background: rgba(251, 191, 36, 0.18); color: #fde68a; }
.badge.err { background: rgba(251, 113, 133, 0.18); color: #fda4af; }
