/* ================= RVL Connect — Day / Night ================= */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Thai:wght@400;500;600;700;800&family=Outfit:wght@400;500;600;700;800&display=swap');

:root, html[data-theme="dark"] {
  --bg: #0b0d12;
  --bg2: #121722;
  --card: #151a26;
  --line: #2a3142;
  --text: #eef2f8;
  --muted: #9aa3b2;
  --red: #e11d48;
  --red-soft: #fb7185;
  --red-dim: rgba(225, 29, 72, 0.14);
  --ok: #34d399;
  --header: rgba(11, 13, 18, 0.92);
  --input: #0c1018;
  --shadow: 0 14px 36px rgba(0,0,0,.35);
  --hero-bg: radial-gradient(700px 280px at 50% 0%, rgba(225,29,72,.14), transparent 70%), linear-gradient(180deg, #10131a, #0b0d12);
  --map-head: #0c1018;
  --code: #ffd0d8;
}

html[data-theme="light"] {
  --bg: #f4f6fb;
  --bg2: #ffffff;
  --card: #ffffff;
  --line: #e5e7ef;
  --text: #111827;
  --muted: #6b7280;
  --red: #e11d48;
  --red-soft: #e11d48;
  --red-dim: rgba(225, 29, 72, 0.08);
  --ok: #059669;
  --header: rgba(255,255,255,.92);
  --input: #f9fafb;
  --shadow: 0 10px 28px rgba(15, 23, 42, .08);
  --hero-bg: radial-gradient(700px 280px at 50% 0%, rgba(225,29,72,.08), transparent 70%), linear-gradient(180deg, #fff, #f4f6fb);
  --map-head: #f8fafc;
  --code: #9f1239;
}

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

html, body { min-height: 100%; }

body {
  font-family: 'Noto Sans Thai', 'Outfit', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-text-size-adjust: 100%;
}

a { color: inherit; }

/* ================= Header ================= */
.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--header);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.nav-container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0.85rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: var(--text);
  font-family: 'Outfit', 'Noto Sans Thai', sans-serif;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.logo-mark { color: var(--red-soft); }
.logo-sub {
  display: block;
  font-size: 0.66rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 1px;
}
.logo-icon { display: none !important; }

.nav-links {
  display: flex;
  gap: 0.85rem;
  list-style: none;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}
.nav-links a:hover { color: var(--text); }
.nav-links a.nav-discord {
  color: #fff !important;
  background: linear-gradient(135deg, #e11d48, #be123c);
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
}

/* theme toggle */
.theme-toggle {
  position: fixed;
  right: 12px;
  bottom: 12px;
  z-index: 2000;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  border-radius: 999px;
  padding: 0.55rem 0.85rem;
  box-shadow: var(--shadow);
  cursor: pointer;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.theme-toggle:active { transform: scale(0.98); }
.theme-toggle .ico { font-size: 1rem; line-height: 1; }

/* ================= Hero ================= */
.hero {
  padding: 3.4rem 1rem 2.8rem;
  text-align: center;
  border-bottom: 1px solid var(--line);
  background: var(--hero-bg);
}
.hero-content { max-width: 760px; margin: 0 auto; }
.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--red) 30%, transparent);
  background: var(--red-dim);
  color: var(--red-soft);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.9rem;
}
.hero h1 {
  font-family: 'Outfit', 'Noto Sans Thai', sans-serif;
  font-size: clamp(1.7rem, 5vw, 2.6rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 0.8rem;
}
.hero h1 span { color: var(--red-soft); }
.hero-subtitle { color: var(--muted); font-size: 1rem; margin-bottom: 1.4rem; }
.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.85rem 1.35rem;
  border-radius: 12px;
  text-decoration: none;
  color: #fff;
  font-weight: 800;
  background: linear-gradient(135deg, #e11d48, #be123c);
}
.brand-showcase { display: none !important; }

/* ================= Trust ================= */
.trust-badges {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--line);
  background: var(--bg2);
}
.badges-container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.8rem;
  text-align: center;
}
.badge-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 0.7rem 0.3rem;
}
.badge-icon {
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--red-dim);
  border: 1px solid color-mix(in srgb, var(--red) 28%, transparent);
  font-size: 1.15rem;
}
.badge-item strong { font-size: 0.9rem; }
.badge-item span { color: var(--muted); font-size: 0.8rem; }

/* ================= Layout ================= */
.container { max-width: 1120px; margin: 0 auto; padding: 2.6rem 1rem; }
.section-header { text-align: center; margin-bottom: 1.8rem; }
.section-header h2 {
  font-family: 'Outfit', 'Noto Sans Thai', sans-serif;
  font-size: clamp(1.35rem, 4vw, 1.9rem);
  font-weight: 800;
  margin-bottom: 0.35rem;
}
.section-header p { color: var(--muted); }

/* ================= Products ================= */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  margin-bottom: 1.8rem;
}
.loading { grid-column: 1 / -1; text-align: center; padding: 2.5rem; color: var(--muted); }
.product-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
}
.product-image {
  height: 120px;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.3rem;
  position: relative;
  background:
    radial-gradient(circle at 30% 30%, rgba(225,29,72,.22), transparent 55%),
    linear-gradient(135deg, #1a0b12, #121722);
}
html[data-theme="light"] .product-image {
  background:
    radial-gradient(circle at 30% 30%, rgba(225,29,72,.12), transparent 55%),
    linear-gradient(135deg, #ffe4e6, #fff1f2);
}
.stock-badge {
  position: absolute; top: 0.7rem; right: 0.7rem;
  padding: 0.25rem 0.55rem; border-radius: 999px;
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase;
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  border: 1px solid var(--line);
}
.stock-badge.in-stock { color: var(--ok); }
.stock-badge.sold-out { color: var(--red-soft); }
.product-body { padding: 1.05rem 1.1rem 1.15rem; display: flex; flex-direction: column; flex: 1; }
.pkg-code { font-family: 'Outfit', sans-serif; font-weight: 800; color: var(--red-soft); margin-bottom: 0.3rem; }
.pkg-name { color: var(--muted); font-size: 0.88rem; flex: 1; margin-bottom: 0.8rem; }
.product-footer {
  display: flex; justify-content: space-between; align-items: center; gap: 0.7rem;
  padding-top: 0.8rem; border-top: 1px solid var(--line);
}
.pkg-price { font-size: 1.4rem; font-weight: 800; font-family: 'Outfit', sans-serif; }
.price-currency { font-size: 0.9rem; color: var(--muted); margin-left: 0.12rem; }
.buy-btn {
  border: 0; border-radius: 10px; padding: 0.6rem 0.95rem;
  color: #fff; font-weight: 700; cursor: pointer;
  background: linear-gradient(135deg, #e11d48, #be123c);
}
.buy-btn:disabled { background: #94a3b8; cursor: not-allowed; }

/* ================= How ================= */
.how-it-works {
  padding: 2.6rem 1rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--bg2);
}
.steps-grid {
  max-width: 1120px; margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.9rem;
}
.step-item {
  text-align: center; padding: 1.15rem 0.85rem;
  border-radius: 14px; background: var(--card); border: 1px solid var(--line);
}
.step-number {
  width: 44px; height: 44px; margin: 0 auto 0.7rem; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: #fff;
  background: linear-gradient(145deg, #e11d48, #7f1d1d);
  font-family: 'Outfit', sans-serif;
}
.step-item h3 { margin-bottom: 0.3rem; font-size: 1rem; }
.step-item p { color: var(--muted); font-size: 0.88rem; }

/* ================= FAQ ================= */
.faq-section {
  margin-top: 1.6rem; padding: 1.15rem 1.1rem; border-radius: 14px;
  background: var(--red-dim); border: 1px solid color-mix(in srgb, var(--red) 28%, transparent);
}
.faq-section h3 { color: var(--red-soft); margin-bottom: 0.65rem; font-size: 1rem; }
.faq-section ul { list-style: none; }
.faq-section li {
  position: relative; padding: 0.45rem 0 0.45rem 1.15rem;
  border-bottom: 1px dashed color-mix(in srgb, var(--line) 80%, transparent);
}
.faq-section li:last-child { border-bottom: 0; }
.faq-section li::before { content: '•'; position: absolute; left: 0; color: var(--red-soft); font-weight: 800; }

/* ================= Modal ================= */
.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.72);
  display: flex; align-items: center; justify-content: center;
  z-index: 2500; padding: 0.85rem;
}
.modal.hidden { display: none; }
.modal-content {
  width: 100%; max-width: 700px; max-height: 92vh; overflow: auto;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; padding: 1.2rem; box-shadow: var(--shadow); position: relative;
}
.modal-close {
  position: absolute; top: 0.75rem; right: 0.75rem;
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--input); color: var(--muted); cursor: pointer;
}
.modal-content h2 { font-size: 1.25rem; margin-bottom: 0.9rem; font-family: 'Outfit', 'Noto Sans Thai', sans-serif; }
.payment-info {
  background: var(--red-dim); border: 1px solid color-mix(in srgb, var(--red) 25%, transparent);
  border-radius: 12px; padding: 0.9rem 1rem; margin-bottom: 1rem;
}
.price-label span { color: var(--red-soft); font-size: 1.2rem; font-weight: 800; }
.payment-body { display: grid; grid-template-columns: 1fr 1.1fr; gap: 1rem; }
@media (max-width: 768px) { .payment-body { grid-template-columns: 1fr; } }
.qr-section { text-align: center; }
.qr-code { width: 100%; max-width: 220px; border-radius: 12px; background: #fff; padding: 8px; border: 1px solid var(--line); }
.receiver-info { margin-top: 0.6rem; color: var(--muted); font-size: 0.86rem; }
.upload-section h3 { margin-bottom: 0.6rem; }
.drop-zone {
  border: 1.5px dashed var(--line); border-radius: 12px; padding: 1.1rem;
  text-align: center; cursor: pointer; background: var(--input);
}
.drop-zone p { color: var(--muted); }
.browse-link { color: var(--red-soft); text-decoration: underline; }
.slip-preview { max-width: 100%; max-height: 140px; border-radius: 8px; }
.slip-preview.hidden, .status-message.hidden, #slip-input, .toast.hidden, .modal.hidden { display: none; }
.buyer-input, .check-card textarea, .check-card select {
  width: 100%; box-sizing: border-box; padding: 0.75rem 0.85rem;
  border-radius: 10px; border: 1px solid var(--line);
  background: var(--input); color: var(--text); font: inherit;
}
.buyer-input { margin: 0.8rem 0; }
.buyer-input:focus, .check-card textarea:focus, .check-card select:focus {
  outline: none; border-color: color-mix(in srgb, var(--red) 50%, transparent);
  box-shadow: 0 0 0 3px var(--red-dim);
}
.submit-btn, .docs-btn, .copy-btn, .buy-another-btn, .btn-check {
  font: inherit; font-weight: 700; border-radius: 10px; cursor: pointer;
}
.submit-btn, .btn-check, .docs-btn {
  border: 0; color: #fff; background: linear-gradient(135deg, #e11d48, #be123c);
}
.submit-btn, .btn-check { width: 100%; padding: 0.9rem; }
.submit-btn:disabled, .btn-check:disabled { opacity: .55; cursor: not-allowed; }
.status-message { margin-top: 0.8rem; padding: 0.8rem; border-radius: 10px; }
.status-message.error { background: var(--red-dim); border: 1px solid color-mix(in srgb, var(--red) 30%, transparent); color: var(--red-soft); }
.status-message.success { background: rgba(52,211,153,.12); border: 1px solid rgba(52,211,153,.3); color: var(--ok); }
.success-content { text-align: center; }
.success-icon { font-size: 2.6rem; margin-bottom: 0.4rem; }
.success-details { background: var(--input); border: 1px solid var(--line); border-radius: 12px; padding: 0.9rem; margin: 0.9rem 0; }
.key-display { background: rgba(52,211,153,.1); border: 1px solid rgba(52,211,153,.3); border-radius: 12px; padding: 1rem; margin: 1rem 0; }
.key-box { display: flex; gap: 0.45rem; flex-wrap: wrap; }
.key-box code {
  flex: 1 1 180px; background: var(--input); color: var(--ok);
  border: 1px solid rgba(52,211,153,.28); border-radius: 8px; padding: 0.75rem;
  word-break: break-all; font-family: ui-monospace, monospace;
}
.copy-btn { border: 0; color: #fff; background: #059669; padding: 0.75rem 0.95rem; white-space: nowrap; }
.warning-text { color: #d97706; font-size: 0.86rem; margin-top: 0.65rem; }
.docs-btn { display: inline-block; text-decoration: none; padding: 0.75rem 1.15rem; margin: 0.55rem 0; }
.buy-another-btn { width: 100%; border: 1px solid var(--line); background: transparent; color: var(--text); padding: 0.8rem; }

/* ================= Footer ================= */
.footer { border-top: 1px solid var(--line); background: var(--bg2); padding: 2rem 0 1rem; }
.footer-content {
  max-width: 1120px; margin: 0 auto 1rem; padding: 0 1rem;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem;
}
.footer-section h3 { font-size: 0.98rem; margin-bottom: 0.55rem; font-family: 'Outfit', 'Noto Sans Thai', sans-serif; }
.footer-section ul { list-style: none; }
.footer-section li { color: var(--muted); margin-bottom: 0.3rem; font-size: 0.9rem; }
.footer-section a { color: var(--text); text-decoration: none; opacity: 0.85; }
.footer-section a:hover { color: var(--red-soft); opacity: 1; }
.footer-bottom {
  max-width: 1120px; margin: 0 auto; padding: 0.9rem 1rem 0;
  border-top: 1px solid var(--line); text-align: center; color: var(--muted); font-size: 0.86rem;
}
.footer-cat { color: var(--red-soft); font-weight: 700; }

/* ================= Toast ================= */
.toast {
  position: fixed; right: 0.85rem; bottom: 4.2rem; z-index: 3000;
  background: var(--card); border: 1px solid var(--line); color: var(--text);
  border-radius: 10px; padding: 0.8rem 1rem; box-shadow: var(--shadow);
}
.toast.success { border-left: 4px solid var(--ok); }
.toast.error { border-left: 4px solid var(--red); }

/* ================= Check page ================= */
.check-wrap { max-width: 720px; margin: 0 auto; padding: 1.4rem 0.9rem 5rem; }
.check-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 1.15rem 1rem 1.25rem; box-shadow: var(--shadow);
}
.check-card h1 {
  font-family: 'Outfit', 'Noto Sans Thai', sans-serif;
  font-size: 1.3rem; margin: 0 0 0.3rem;
}
.check-card .sub { color: var(--muted); margin-bottom: 0.9rem; font-size: 0.92rem; }
.check-card label {
  display: block; margin: 0.8rem 0 0.3rem; font-weight: 700; font-size: 0.88rem; color: var(--red-soft);
}
.check-card textarea {
  min-height: 84px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9rem;
}
.btn-check { margin-top: 0.95rem; border-radius: 999px; }
.result {
  margin-top: 0.95rem; padding: 0.85rem 0.9rem; border-radius: 12px;
  display: none; line-height: 1.55; font-size: 0.9rem;
}
.result.show { display: block; }
.result.ok { background: rgba(52,211,153,.12); border: 1px solid rgba(52,211,153,.3); color: var(--ok); }
.result.bad { background: var(--red-dim); border: 1px solid color-mix(in srgb, var(--red) 30%, transparent); color: var(--red-soft); }
.result.warn { background: rgba(251,191,36,.12); border: 1px solid rgba(251,191,36,.3); color: #b45309; }
html[data-theme="dark"] .result.warn { color: #fde68a; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: .2rem .6rem; margin: .5rem 0; }
code {
  background: color-mix(in srgb, var(--text) 7%, transparent);
  padding: 1px 6px; border-radius: 6px; word-break: break-all; color: var(--code);
}
.map {
  width: 100%; border-collapse: collapse; font-size: 0.8rem; margin-top: 0.95rem; color: var(--text);
}
.map th, .map td { border: 1px solid var(--line); padding: .42rem .48rem; text-align: left; }
.map th { background: var(--map-head); color: var(--red-soft); }
.hint { margin-top: 0.9rem; font-size: 0.8rem; color: var(--muted); line-height: 1.45; }
.topnav {
  display: flex; gap: 0.9rem; justify-content: center; flex-wrap: wrap;
  margin: 1rem 0 0; font-size: 0.9rem;
}
.topnav a { color: var(--red-soft); text-decoration: none; font-weight: 600; }
.brand-note {
  display: inline-flex; align-items: center; gap: .3rem;
  color: var(--red-soft); font-weight: 700; font-size: 0.8rem; margin-bottom: 0.45rem;
}

/* mobile nav fix */
@media (max-width: 640px) {
  .nav-container { padding: 0.7rem 0.75rem; }
  .nav-links { gap: 0.45rem; }
  .nav-links a { font-size: 0.82rem; }
  .nav-links a.nav-discord { padding: 0.32rem 0.65rem; }
  .products-grid { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; }
  .theme-toggle { right: 10px; bottom: 10px; }
}
