/* =======================================================================
   หน้าแรกสาธารณะ "เงินกรู Affiliate" (public/landing.html) — ไฟล์เดียวจบ ไม่พึ่ง style.css ของ Dashboard
   สีจากไฟล์แบรนด์เงินกรู (brand/ngerngru-*.svg): หมึก #111418 · เขียวมะนาว #C8FF3D · เขียว #75B900 · พื้น #F5F7F2 · เทา #525A54
   ธีมสว่าง + ธีมมืดตาม prefers-color-scheme · ออกแบบที่ 375px ก่อน (ไม่มีความกว้างตายตัว · ไม่เลื่อนข้าง)
   ฟอนต์ = ฟอนต์ไทยในเครื่อง (ไม่โหลดจากโดเมนอื่น · CSP default-src 'none')
   ตัวอักษรทุกคู่สีผ่าน WCAG AA (≥ 4.5:1) · ปุ่ม / ช่องกรอกสูง ≥ 44px · ช่องกรอกตัวอักษร 16px (iOS ไม่ซูม)
   ======================================================================= */

:root {
  color-scheme: light;
  --ink: #111418;
  --ink-soft: #2b3136;
  --muted: #525a54;
  --bg: #f5f7f2;
  --surface: #ffffff;
  --surface-alt: #eef2e8;
  --line: #d6ddcf;
  --lime: #c8ff3d;
  --lime-ink: #111418;
  --green: #3f6b00; /* ตัวอักษรเขียวบนพื้นสว่าง (6.3:1) · #75B900 ใช้เป็นสีตกแต่งเท่านั้น */
  --green-deco: #75b900;
  --focus: #3f6b00;
  --hero-bg: #111418;
  --hero-ink: #f5f7f2;
  --hero-muted: #b4bcb6;
  --hero-card: #1a1f24;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(17, 20, 24, 0.06), 0 8px 24px rgba(17, 20, 24, 0.06);
  --font: system-ui, -apple-system, "Segoe UI", "Noto Sans Thai", "Leelawadee UI", "Thonburi", "Sarabun", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --ink: #f5f7f2;
    --ink-soft: #d9ded8;
    --muted: #a9b2ab;
    --bg: #0c0f12;
    --surface: #161a1f;
    --surface-alt: #11151a;
    --line: #2a3037;
    --green: #c8ff3d;
    --focus: #c8ff3d;
    --hero-bg: #08090b;
    --hero-card: #161a1f;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  }
}

/* ---------- พื้นฐาน ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body.lp {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  overflow-wrap: break-word;
}

/* hidden ต้องซ่อนจริงแม้ class ตั้ง display ไว้ (ฟอร์มหลังส่งสำเร็จ · ป้าย / ปุ่มที่ซ่อน) */
.lp [hidden] { display: none !important; }
.lp img { max-width: 100%; height: auto; }
/* คำทับศัพท์ที่ตัวตัดคำภาษาไทยของเบราว์เซอร์ตัดกลางคำ (เช่น "แชท") → ห่อไว้ไม่ให้ขึ้นบรรทัดกลางคำ */
.lp-nowrap { white-space: nowrap; }
.lp a { color: var(--green); text-underline-offset: 2px; }
.lp a:hover { text-decoration-thickness: 2px; }
.lp :focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.lp [id] { scroll-margin-top: 76px; }
.lp p { margin: 0 0 12px; }
.lp p:last-child { margin-bottom: 0; }

.lp-wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.lp-narrow { max-width: 760px; }
@media (min-width: 48em) {
  .lp-wrap { padding: 0 24px; }
}

.lp-skip {
  position: absolute;
  left: 8px;
  top: -64px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--lime);
  color: var(--lime-ink);
  font-weight: 700;
  border-radius: var(--radius-sm);
}
.lp-skip:focus { top: 8px; }

/* ---------- แถบบน ---------- */
.lp-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.2) blur(10px);
  -webkit-backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 1px solid var(--line);
}
.lp-header-inner { display: flex; align-items: center; gap: 8px; min-height: 60px; }
.lp-logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--ink) !important;
  text-decoration: none;
  font-weight: 800;
  font-size: 1.0625rem;
  line-height: 1.2;
}
.lp-logo img { flex: none; width: 36px; height: 36px; }
.lp-logo-text { white-space: nowrap; }
/* wordmark แบบโลโก้เงินกรู: "เงิน" สีหมึก + "กรู" สีเขียว + "Affiliate" สีรอง (หน้าเอกสาร / หน้าล็อกอินใช้แบบเดียวกัน) */
.lp-logo-gru { color: var(--green); }
.lp-logo-sub { color: var(--muted); font-weight: 700; }
.lp-header-nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.lp-header-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 10px;
  color: var(--ink) !important;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9375rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}
.lp-header-link:hover { background: var(--surface-alt); }
@media (max-width: 39.99em) {
  .lp-hide-sm { display: none !important; }
}
@media (max-width: 24.99em) {
  .lp-hide-xs { display: none !important; }
}

/* ---------- ปุ่ม ---------- */
.lp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 20px;
  border: 2px solid transparent;
  border-radius: 12px;
  font: inherit;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  text-decoration: none !important;
  cursor: pointer;
}
.lp-btn-sm { min-height: 40px; padding: 6px 14px; font-size: 0.9375rem; }
.lp-btn-block { display: flex; width: 100%; }
.lp-btn-primary { background: var(--lime); color: var(--lime-ink) !important; border-color: var(--lime); }
.lp-btn-primary:hover { filter: brightness(0.94); }
/* ปุ่มรองบนพื้นเข้มของ hero (ไปดูขั้นตอนเริ่มใช้ในหน้าเดียวกัน) */
.lp-btn-ghost { background: transparent; color: var(--hero-ink) !important; border-color: var(--hero-muted); }
.lp-btn-ghost:hover { border-color: var(--hero-ink); }
/* เส้นทางเริ่มใช้งาน: สมัคร → ชำระเดือนแรก → ตัวช่วยตั้งค่า */
.lp-path { margin: 0 0 16px; font-weight: 700; overflow-wrap: anywhere; }
.lp-hero .lp-path { color: var(--hero-ink); }

/* ---------- Hero ---------- */
.lp-hero {
  color: var(--hero-ink);
  background:
    radial-gradient(60rem 28rem at 85% -10%, rgba(200, 255, 61, 0.16), transparent 60%),
    radial-gradient(40rem 24rem at -10% 110%, rgba(117, 185, 0, 0.14), transparent 60%),
    var(--hero-bg);
  padding: 40px 0 48px;
}
.lp-hero a:not(.lp-btn) { color: var(--lime); }
.lp-hero-grid { display: grid; gap: 32px; align-items: center; }
@media (min-width: 56em) {
  .lp-hero { padding: 72px 0 80px; }
  .lp-hero-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: 48px; }
}
.lp-eyebrow {
  display: inline-block;
  margin: 0 0 16px;
  padding: 6px 12px;
  border: 1px solid rgba(200, 255, 61, 0.45);
  border-radius: 999px;
  color: var(--lime);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.4;
}
.lp-hero-title {
  margin: 0 0 8px;
  font-size: clamp(2.25rem, 9vw, 3.75rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.lp-accent { color: var(--lime); }
.lp-hero-lead { margin: 0 0 12px; font-size: clamp(1.125rem, 4.4vw, 1.5rem); font-weight: 700; line-height: 1.45; }
.lp-hero-text { color: var(--hero-muted); max-width: 40rem; }
.lp-cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 24px 0 20px; }
.lp-cta-row .lp-btn { flex: 1 1 14rem; }
@media (min-width: 40em) {
  .lp-cta-row .lp-btn { flex: 0 1 auto; }
}
.lp-hero-facts { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 0; padding: 0; list-style: none; color: var(--hero-muted); font-size: 0.9375rem; }
.lp-hero-facts li { display: inline-flex; align-items: center; gap: 8px; }
.lp-hero-facts li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--lime); flex: none; }

/* ภาพตัวอย่างแชท (ตกแต่ง · aria-hidden) */
.lp-demo { margin: 0; }
.lp-demo-phone {
  display: grid;
  gap: 10px;
  max-width: 24rem;
  margin: 0 auto;
  padding: 16px;
  background: var(--hero-card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}
.lp-demo-head { margin: 0 0 4px; color: var(--hero-muted); font-size: 0.8125rem; font-weight: 600; text-align: center; }
.lp-bubble { max-width: 85%; padding: 10px 14px; border-radius: 18px; font-size: 0.9375rem; line-height: 1.45; }
.lp-bubble-me { justify-self: end; display: grid; gap: 2px; background: #2b3a12; color: #eef7dc; border-bottom-right-radius: 6px; }
.lp-bubble-bot { justify-self: start; background: #f5f7f2; color: #111418; border-bottom-left-radius: 6px; }
.lp-bubble-code { font-family: var(--mono); font-size: 0.8125rem; word-break: break-all; }
.lp-bubble-link { font-size: 0.8125rem; color: #c8ff3d; }
.lp-demo-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 10px;
  padding: 10px 12px;
  border: 1px dashed rgba(200, 255, 61, 0.45);
  border-radius: 12px;
  font-size: 0.8125rem;
}
.lp-demo-chip { font-weight: 700; color: #f5f7f2; }
.lp-demo-status { padding: 2px 10px; border-radius: 999px; background: var(--lime); color: #111418; font-weight: 700; }
.lp-demo-caption { margin-top: 12px; color: var(--hero-muted); font-size: 0.875rem; text-align: center; }

/* ---------- ส่วนเนื้อหา ---------- */
.lp-section { padding: 48px 0; }
.lp-section-alt { background: var(--surface-alt); }
@media (min-width: 48em) {
  .lp-section { padding: 72px 0; }
}
.lp-h2 { margin: 0 0 24px; font-size: clamp(1.5rem, 5.5vw, 2.125rem); font-weight: 800; line-height: 1.25; }
.lp-h3 { margin: 0 0 6px; font-size: 1.0625rem; font-weight: 700; line-height: 1.4; }
.lp-grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 35em) {
  .lp-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 45em) {
  .lp-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 64em) {
  .lp-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.lp-card,
.lp-feature {
  min-width: 0;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: var(--ink-soft);
}
.lp-card .lp-h3,
.lp-feature .lp-h3 { color: var(--ink); }
.lp-feature { border-top: 4px solid var(--green-deco); }

/* ขั้นตอน (ตัวเลขในวงกลม) */
.lp-steps { display: grid; gap: 16px; margin: 0; padding: 0; list-style: none; counter-reset: lp-step; }
@media (min-width: 48em) {
  .lp-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.lp-step {
  position: relative;
  min-width: 0;
  padding: 20px 20px 20px 68px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink-soft);
  counter-increment: lp-step;
}
.lp-step .lp-h3 { color: var(--ink); }
/* ภาพตัวอย่างแจ้งเตือนในไลน์ (ใต้ขั้นตอน "ทำงานยังไง") */
.lp-shot { margin: 28px auto 0; max-width: 320px; }
.lp-shot img { display: block; width: 100%; height: auto; border-radius: 18px; box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28); }
.lp-shot-caption { margin-top: 12px; color: var(--muted); font-size: 0.875rem; text-align: center; }
.lp-step::before {
  content: counter(lp-step);
  position: absolute;
  left: 18px;
  top: 18px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--lime);
  color: var(--lime-ink);
  font-weight: 800;
}

/* เริ่มใช้งานเอง 3 ขั้น (สมัคร → จ่ายเดือนแรก → ตัวช่วยตั้งค่า) */
.lp-start { display: grid; gap: 16px; margin: 0 0 24px; padding: 0; list-style: none; counter-reset: lp-start; }
@media (min-width: 48em) {
  .lp-start { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.lp-start-item {
  position: relative;
  min-width: 0;
  padding: 64px 20px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink-soft);
  counter-increment: lp-start;
}
.lp-start-item .lp-h3 { color: var(--ink); }
.lp-start-item::before {
  content: counter(lp-start);
  position: absolute;
  left: 20px;
  top: 18px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--lime);
  color: var(--lime-ink);
  font-weight: 800;
}
.lp-start-cta { text-align: center; }

/* ราคา */
.lp-price-card {
  max-width: 30rem;
  margin: 0 auto;
  padding: 28px 20px;
  background: var(--surface);
  border: 2px solid var(--green-deco);
  border-radius: 20px;
  box-shadow: var(--shadow);
  text-align: center;
}
.lp-price-name { margin: 0 0 4px; font-weight: 700; color: var(--muted); }
.lp-price { margin: 0; line-height: 1.1; }
.lp-price-num { font-size: clamp(3rem, 14vw, 4rem); font-weight: 800; color: var(--ink); }
.lp-price-unit { font-weight: 700; color: var(--ink-soft); }
.lp-price-vat { margin: 6px 0 20px; color: var(--green); font-weight: 700; }
.lp-checks { display: grid; gap: 10px; margin: 0 0 24px; padding: 0; list-style: none; text-align: left; }
.lp-checks li { position: relative; padding-left: 30px; color: var(--ink-soft); }
.lp-checks li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0.45em;
  width: 14px;
  height: 8px;
  border-left: 3px solid var(--green);
  border-bottom: 3px solid var(--green);
  transform: rotate(-45deg);
}
.lp-note { margin-top: 12px; color: var(--muted); font-size: 0.875rem; }

/* FAQ */
.lp-faq { display: grid; gap: 10px; }
.lp-faq-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.lp-faq-item summary {
  position: relative;
  min-height: 48px;
  padding: 12px 48px 12px 16px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}
.lp-faq-item summary::-webkit-details-marker { display: none; }
.lp-faq-item summary::after {
  content: "+";
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--green);
}
.lp-faq-item[open] summary::after { content: "−"; }
.lp-faq-item p { padding: 0 16px 16px; color: var(--ink-soft); }

/* ปิดท้าย: เริ่มใช้งาน (ไม่มีฟอร์มผู้สนใจแล้ว · 12 ต.ค. 2569) */
.lp-final-inner { text-align: center; }
.lp-final-inner .lp-note { margin-top: 16px; }

/* ---------- ท้ายหน้า ---------- */
.lp-footer { padding: 40px 0 48px; background: var(--hero-bg); color: var(--hero-muted); font-size: 0.875rem; }
.lp-footer a { color: var(--hero-ink); }
.lp-footer .lp-logo { color: var(--hero-ink) !important; }
.lp-footer .lp-logo-gru { color: var(--lime); }
.lp-footer .lp-logo-sub { color: var(--hero-muted); }
.lp-footer-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-bottom: 16px; }
.lp-footer-family { margin: 0; }
.lp-footer-nav { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-bottom: 16px; }
.lp-footer-nav a { display: inline-flex; align-items: center; min-height: 44px; }
.lp-support { margin: 0 0 12px; line-height: 1.7; }
.lp-disclaimer,
.lp-copy { margin: 0 0 8px; }
