/* หน้าแรก (Landing) — โทนน้ำเงิน/ฟ้าตามโลโก้ WE SOFTTECH พื้นเย็นสว่าง จุดเด่นเดียวคือใบ ปร.6 ตัวอย่าง */

:root {
  --ink: #0e1a3a;
  --ink-2: #44506e;
  --ink-3: #6a7592;
  --paper: #f5f8fd;
  --white: #ffffff;
  --navy: #1f3a93;
  --navy-deep: #172c73;
  --royal: #2b59c3;
  --cyan: #23a9e1;          /* ใช้เป็นเส้น/พื้นหลังเท่านั้น (ตัวอักษรบนพื้นขาวคอนทราสต์ไม่พอ) */
  --cyan-wash: #e6f4fc;
  --line: rgba(14, 26, 58, 0.14);
  --line-soft: rgba(14, 26, 58, 0.08);
  --grid: rgba(35, 169, 225, 0.12);

  --head: "Prompt", "IBM Plex Sans Thai", system-ui, sans-serif;
  --body: "IBM Plex Sans Thai", "Sarabun", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;

  --measure: 34rem;
  --gutter: clamp(16px, 4vw, 40px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; }
body.lp {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--body); font-size: 17px; line-height: 1.8; font-weight: 400;
}
.lp h1, .lp h2, .lp h3, .lp p, .lp ul, .lp ol, .lp dl, .lp dd, .lp figure { margin: 0; }
.lp a { color: inherit; }
.lp img { display: block; max-width: 100%; height: auto; }
.wrap { width: min(1160px, 100% - 2 * var(--gutter)); margin-inline: auto; }

.skip {
  position: absolute; left: 8px; top: -48px; z-index: 20; padding: 8px 14px; background: var(--navy); color: #fff;
  border-radius: 6px; text-decoration: none;
}
.skip:focus { top: 8px; }
:focus-visible { outline: 3px solid var(--royal); outline-offset: 3px; border-radius: 4px; }

/* ---------- ปุ่ม ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px; border-radius: 8px; border: 1px solid transparent;
  font-family: var(--head); font-weight: 500; font-size: 16px; line-height: 1; text-decoration: none; cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn-lg { min-height: 52px; padding: 0 28px; font-size: 17px; }
.btn-solid { background: var(--navy); color: #fff; }
.btn-solid:hover { background: var(--navy-deep); }
.btn-line { background: transparent; color: var(--navy); border-color: var(--navy); }
.btn-line:hover { background: var(--cyan-wash); }
.btn-quiet { background: transparent; color: var(--ink); }
.btn-quiet:hover { background: rgba(14, 26, 58, 0.06); }

/* ---------- แถบบน ---------- */
.top { position: sticky; top: 0; z-index: 10; background: rgba(255, 255, 255, 0.94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line-soft); }
.top-in { display: flex; align-items: center; gap: 24px; min-height: 68px; }
.logo { display: block; flex: none; }
.logo img { height: 42px; width: auto; }
.top-nav { display: flex; gap: 4px; margin-inline: auto; }
.top-nav a { padding: 8px 14px; border-radius: 8px; text-decoration: none; color: var(--ink-2); font-size: 15px; }
.top-nav a:hover { color: var(--navy); background: var(--cyan-wash); }
.top-cta { display: flex; gap: 8px; margin-left: auto; }
.top-nav + .top-cta { margin-left: 0; }

/* ---------- Hero ---------- */
.hero {
  position: relative; padding: clamp(40px, 7vw, 88px) 0 clamp(48px, 7vw, 96px);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 28px 28px;
  -webkit-mask-image: none; mask-image: none;
}
.hero::after { /* เส้นกริดจางลงด้านล่าง */
  content: ""; position: absolute; inset: auto 0 0 0; height: 140px; pointer-events: none;
  background: linear-gradient(to bottom, transparent, var(--paper));
}
.hero-in { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.hero-copy h1 {
  font-family: var(--head); font-weight: 600; color: var(--navy);
  font-size: clamp(32px, 4.6vw, 52px); line-height: 1.32; letter-spacing: -0.01em; text-wrap: balance;
}
.lede { margin-top: 20px; max-width: var(--measure); color: var(--ink-2); font-size: 18px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero-note { margin-top: 16px; color: var(--ink-3); font-size: 15px; }

/* ---------- ใบ ปร.6 ตัวอย่าง ---------- */
.sheet-wrap { display: grid; gap: 16px; }
.sheet {
  position: relative; background: var(--white); border: 1px solid var(--line); border-radius: 4px;
  padding: clamp(18px, 3vw, 30px); box-shadow: 0 1px 0 var(--line-soft), 0 18px 40px -22px rgba(23, 44, 115, 0.45);
  border-top: 4px solid var(--cyan);
}
.sheet-head { padding-bottom: 14px; margin-bottom: 4px; border-bottom: 1px solid var(--ink); }
.sheet-title { font-family: var(--head); font-weight: 600; font-size: 20px; line-height: 1.4; }
.sheet-meta { margin-top: 4px; color: var(--ink-3); font-size: 13px; line-height: 1.6; }
.sheet-table { width: 100%; border-collapse: collapse; font-size: 16px; }
.sheet-table th { text-align: left; font-weight: 500; font-size: 13px; color: var(--ink-3); padding: 10px 0 6px; }
.sheet-table td { padding: 9px 0; border-bottom: 1px solid var(--line-soft); line-height: 1.5; }
.sheet-table .r { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 15px; padding-left: 16px; white-space: nowrap; }
.sheet-table th.r { font-family: var(--body); }
.sheet-table tr.sum td { border-top: 1px solid var(--ink); font-weight: 500; padding-top: 12px; }
.sheet-table tr.factor td { color: var(--navy); font-weight: 500; }
.sheet-table tr.total td { border-bottom: 2px solid var(--ink); font-family: var(--head); font-weight: 600; font-size: 18px; padding: 14px 0 12px; }
.sheet-table tr.total td.r { font-family: var(--mono); font-size: 20px; color: var(--navy); }
.sheet-baht { margin-top: 12px; text-align: right; color: var(--ink-2); font-size: 15px; }
.sheet-notes { display: grid; gap: 10px; max-width: 36rem; padding-left: 14px; border-left: 3px solid var(--cyan); color: var(--ink-2); font-size: 15px; line-height: 1.75; }

/* ---------- ส่วนทั่วไป ---------- */
.section { padding: clamp(56px, 8vw, 104px) 0; }
.band { background: var(--white); border-block: 1px solid var(--line-soft); padding: clamp(48px, 7vw, 88px) 0; }
.lp h2 { font-family: var(--head); font-weight: 600; color: var(--navy); font-size: clamp(26px, 3.2vw, 36px); line-height: 1.4; text-wrap: balance; }
.lp h3 { font-family: var(--head); font-weight: 500; font-size: 19px; line-height: 1.5; }
.section-lead { margin-top: 8px; color: var(--ink-2); }

/* วิธีใช้ — เป็นลำดับขั้นจริง จึงมีเลขกำกับ */
.steps { list-style: none; padding: 0; margin-top: 36px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; counter-reset: step; }
.steps li { position: relative; padding: 0 24px 0 0; counter-increment: step; }
.steps li::before {
  content: counter(step); display: grid; place-items: center; width: 36px; height: 36px; margin-bottom: 14px;
  border-radius: 50%; background: var(--navy); color: #fff; font-family: var(--mono); font-size: 15px; line-height: 1;
}
.steps li:not(:last-child)::after { /* เส้นเชื่อมระหว่างขั้น */
  content: ""; position: absolute; top: 18px; left: 48px; right: 12px; height: 2px; background: var(--cyan);
}
.steps p { margin-top: 6px; color: var(--ink-2); font-size: 16px; line-height: 1.75; }

/* ความสามารถ — รายการสองคอลัมน์คั่นด้วยเส้น ไม่ใช้การ์ดซ้ำ */
.features { margin-top: 32px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(24px, 5vw, 72px); }
.features > div { padding: 22px 0; border-top: 1px solid var(--line); }
.features dt { font-family: var(--head); font-weight: 500; font-size: 19px; line-height: 1.5; color: var(--ink); }
.features dd { margin-top: 6px; color: var(--ink-2); font-size: 16px; line-height: 1.8; max-width: 36rem; }

/* แหล่งที่มา */
.band-sources { background: var(--navy); color: #fff; border: 0; }
.band-sources h2 { color: #fff; }
.sources { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr); gap: clamp(24px, 5vw, 72px); align-items: start; }
.sources-lead { margin-top: 10px; color: #c9d6f5; }
.source-list { list-style: none; padding: 0; display: grid; gap: 0; }
.source-list li { display: grid; grid-template-columns: 7.5em minmax(0, 1fr); column-gap: 16px; padding: 16px 0; border-top: 1px solid rgba(255, 255, 255, 0.22); color: #e8eefc; font-size: 16px; line-height: 1.75; }
.source-list li:last-child { border-bottom: 1px solid rgba(255, 255, 255, 0.22); }
.source-list strong { font-family: var(--head); font-weight: 500; color: #fff; }
.sources-caveat { grid-column: 2; margin-top: -8px; color: #c9d6f5; font-size: 15px; }

/* แพ็กเกจ */
.plans { margin-top: 32px; display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; align-items: stretch; }
.plan { display: flex; flex-direction: column; gap: 12px; padding: 26px; background: var(--white); border: 1px solid var(--line); border-radius: 10px; }
.plan-paid { border-color: var(--navy); box-shadow: inset 0 3px 0 var(--navy); }
.plan-price .n { font-family: var(--mono); font-weight: 500; font-size: 34px; line-height: 1.2; color: var(--navy); }
.plan-price .u { color: var(--ink-3); font-size: 15px; }
.plan-desc { color: var(--ink-2); font-size: 15px; }
.plan ul { margin: 0; padding-left: 20px; color: var(--ink-2); font-size: 16px; line-height: 1.8; }
.plan .btn { margin-top: auto; }
.plans-note { margin-top: 20px; color: var(--ink-3); font-size: 15px; }

/* คำถามที่พบบ่อย */
.faq { display: grid; grid-template-columns: minmax(0, 0.6fr) minmax(0, 1.4fr); gap: clamp(24px, 5vw, 72px); align-items: start; }
.faq-list details { border-top: 1px solid var(--line); }
.faq-list details:last-child { border-bottom: 1px solid var(--line); }
.faq-list summary {
  list-style: none; cursor: pointer; padding: 18px 40px 18px 0; position: relative;
  font-family: var(--head); font-weight: 500; font-size: 18px; line-height: 1.6;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: ""; position: absolute; right: 6px; top: 50%; width: 10px; height: 10px; margin-top: -8px;
  border-right: 2px solid var(--navy); border-bottom: 2px solid var(--navy); transform: rotate(45deg); transition: transform .2s;
}
.faq-list details[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
.faq-list details p { padding: 0 40px 20px 0; color: var(--ink-2); font-size: 16px; line-height: 1.85; max-width: 44rem; }
.faq-list details a { color: var(--navy); }

/* ปิดท้าย */
.cta-band { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding: clamp(48px, 7vw, 88px) 0; }
.cta-band p { margin-top: 6px; color: var(--ink-2); }

/* ส่วนท้าย */
.foot { background: var(--white); border-top: 1px solid var(--line); padding-top: 40px; }
.foot-in { display: grid; grid-template-columns: 200px minmax(0, 1.3fr) minmax(0, 0.8fr); gap: 32px; align-items: start; }
.foot-brand img { width: 180px; height: auto; }
.foot-info p { color: var(--ink-2); font-size: 15px; line-height: 1.8; }
.foot-info a { color: var(--navy); }
.foot-name { font-family: var(--head); font-weight: 500; color: var(--ink) !important; font-size: 16px !important; }
.foot-links { display: grid; gap: 6px; font-size: 15px; }
.foot-links a { text-decoration: none; color: var(--ink-2); }
.foot-links a:hover { color: var(--navy); text-decoration: underline; }
.foot-copy { padding: 28px 0 36px; color: var(--ink-3); font-size: 14px; }

/* ---------- การเคลื่อนไหว: ใบ ปร.6 วางลงครั้งเดียวตอนโหลด ---------- */
@media (prefers-reduced-motion: no-preference) {
  .sheet { animation: sheet-in .55s cubic-bezier(.2, 0, 0, 1) both; }
  @keyframes sheet-in { from { opacity: 0; transform: translateY(14px) rotate(-.4deg); } to { opacity: 1; transform: none; } }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ---------- จอเล็ก ---------- */
@media (max-width: 960px) {
  .top-nav { display: none; }
  .top-cta { margin-left: auto; }
  .hero-in, .sources, .faq { grid-template-columns: 1fr; }
  .sources-caveat { grid-column: 1; margin-top: 0; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 32px; }
  .steps li:nth-child(2)::after { display: none; }
  .features { grid-template-columns: 1fr; }
  .foot-in { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  body.lp { font-size: 16px; }
  .logo img { height: 34px; }
  .top-cta .btn-quiet { display: none; }
  .steps { grid-template-columns: 1fr; }
  .steps li::after { display: none; }
  .hero-actions .btn { flex: 1 1 100%; }
  .sheet-table .r { font-size: 14px; }
}

/* ---------- ข่าวสารและประกาศ (รายการเรียงตามเวลา มีเส้นนำด้านซ้าย ไม่ใช้การ์ด) ---------- */
.news-list { margin-top: 28px; display: grid; gap: 0; max-width: 52rem; }
.news-item { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr); gap: 20px; padding: 22px 0; border-top: 1px solid var(--line); }
.news-item:last-child { border-bottom: 1px solid var(--line); }
.news-item.is-pinned { border-top-color: var(--navy); box-shadow: inset 0 2px 0 var(--navy); }
.news-date { color: var(--ink-3); font-family: var(--mono); font-size: 14px; line-height: 1.9; }
.news-main h3 { font-size: 20px; }
.news-pin { margin-left: 10px; padding: 1px 10px; border: 1px solid var(--navy); border-radius: 999px; color: var(--navy); font-family: var(--body); font-size: 13px; font-weight: 400; vertical-align: 2px; }
.news-body { margin-top: 8px; color: var(--ink-2); white-space: pre-line; overflow-wrap: anywhere; }
.news-link { display: inline-block; margin-top: 10px; color: var(--navy); font-family: var(--head); font-weight: 500; text-underline-offset: 4px; }
@media (max-width: 560px) { .news-item { grid-template-columns: 1fr; gap: 4px; } }
