/* kruauto.com — one stylesheet for every page. Light by default, dark follows the system. */
:root {
  --bg: #f6f7f4;
  --surface: #ffffff;
  --surface-2: #eef1ea;
  --ink: #17201a;
  --ink-2: #4a5650;
  --mute: #6d7872;
  --line: #dde3da;
  --brand: #3b7d12;          /* text/buttons on light: lime, darkened to pass contrast */
  --brand-ink: #ffffff;
  --brand-soft: #e6f4d6;
  --accent: #a3e635;         /* the AutoSGS lime, used for marks only */
  --ok: #16803c;
  --bad: #b42318;
  --warn: #a15c07;
  --shadow: 0 1px 2px rgba(20, 30, 20, .06), 0 8px 24px rgba(20, 30, 20, .06);
  --radius: 16px;
  --max: 1120px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1411;
    --surface: #161d18;
    --surface-2: #1d2620;
    --ink: #e8eee9;
    --ink-2: #b8c4bc;
    --mute: #8e9b93;
    --line: #2a352e;
    --brand: #a3e635;
    --brand-ink: #11180b;
    --brand-soft: #22301a;
    --ok: #4ade80;
    --bad: #f87171;
    --warn: #fbbf24;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.65 "IBM Plex Sans Thai", "Noto Sans Thai", system-ui, sans-serif;
}
h1, h2, h3 { font-family: "Anuphan", "IBM Plex Sans Thai", sans-serif; line-height: 1.25; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(30px, 5vw, 50px); font-weight: 700; }
h2 { font-size: clamp(24px, 3.2vw, 34px); font-weight: 700; }
h3 { font-size: 20px; font-weight: 600; }
p { margin: 0 0 1em; }
a { color: var(--brand); text-underline-offset: 3px; }
img { max-width: 100%; height: auto; display: block; }
small, .mute { color: var(--mute); }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 760px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ── header / footer ─────────────────────────────────────────────── */
.top { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 20px; height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; font: 700 20px "Anuphan", sans-serif; color: var(--ink); text-decoration: none; }
.logo-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--ink); display: grid; place-items: center; }
.logo-mark::after { content: ""; width: 12px; height: 12px; border-radius: 3px; background: var(--accent); transform: rotate(45deg); }
.logo b { color: var(--brand); font-weight: 700; }
.nav { display: flex; gap: 22px; margin-left: auto; }
.nav a { color: var(--ink-2); text-decoration: none; font-size: 16px; }
.nav a:hover, .nav a[aria-current] { color: var(--ink); }
@media (max-width: 640px) { .nav .hide-sm { display: none; } .nav { gap: 14px; } }

footer { border-top: 1px solid var(--line); margin-top: 80px; padding: 36px 0 48px; font-size: 15px; color: var(--mute); }
footer .wrap { display: grid; gap: 14px; }
footer nav { display: flex; flex-wrap: wrap; gap: 18px; }
footer a { color: var(--ink-2); }

/* ── buttons ─────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 22px; border-radius: 12px; border: 1px solid transparent; font: 600 17px "IBM Plex Sans Thai", sans-serif; text-decoration: none; cursor: pointer; transition: transform .08s ease, background .15s ease; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--mute); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.btn small { font-weight: 400; color: inherit; opacity: .8; font-size: 14px; }
.btns { display: flex; flex-wrap: wrap; gap: 12px; }

/* ── sections ────────────────────────────────────────────────────── */
section { padding: 72px 0 0; }
.eyebrow { display: inline-block; font-size: 14px; font-weight: 600; color: var(--brand); background: var(--brand-soft); padding: 4px 12px; border-radius: 999px; margin-bottom: 16px; }
.lead { font-size: clamp(18px, 2vw, 21px); color: var(--ink-2); max-width: 680px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

/* ── storefront ──────────────────────────────────────────────────── */
.hero { padding-top: 80px; padding-bottom: 24px; }
.hero h1 span { color: var(--brand); }
.apps { grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); }
.app-card { display: grid; grid-template-columns: 120px 1fr; gap: 24px; align-items: center; text-decoration: none; color: inherit; transition: border-color .15s, transform .15s; }
.app-card:hover { border-color: var(--brand); transform: translateY(-2px); }
.app-card img { width: 120px; height: 120px; border-radius: 26px; }
.app-card h3 { font-size: 26px; margin-bottom: 4px; }
.app-card .go { color: var(--brand); font-weight: 600; }
.app-soon { display: grid; place-items: center; text-align: center; min-height: 180px; border-style: dashed; box-shadow: none; color: var(--mute); }
@media (max-width: 560px) { .app-card { grid-template-columns: 1fr; } .app-card img { width: 88px; height: 88px; border-radius: 20px; } }

/* ── product page ────────────────────────────────────────────────── */
.p-hero { display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center; padding-top: 64px; padding-bottom: 16px; }
.p-hero .icon { width: 72px; height: 72px; border-radius: 18px; margin-bottom: 18px; }
.shot { border-radius: 14px; border: 1px solid var(--line); box-shadow: var(--shadow); background: #0f1411; }
@media (max-width: 900px) { .p-hero { grid-template-columns: 1fr; gap: 32px; } }
.dl-meta { font-size: 14px; color: var(--mute); margin-top: 10px; min-height: 1.4em; }
.notice { margin-top: 18px; padding: 12px 16px; border-radius: 12px; background: var(--brand-soft); color: var(--ink); font-size: 15px; }

.feat { display: grid; grid-template-columns: 1fr 1.15fr; gap: 40px; align-items: center; padding: 40px 0; border-top: 1px solid var(--line); }
.feat:nth-of-type(even) .feat-text { order: 2; }
.feat ul { padding-left: 1.2em; margin: 0; color: var(--ink-2); }
.feat li { margin-bottom: .35em; }
@media (max-width: 900px) { .feat { grid-template-columns: 1fr; gap: 20px; } .feat:nth-of-type(even) .feat-text { order: 0; } }

.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; }
.steps li { counter-increment: s; position: relative; padding-left: 52px; min-height: 40px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-weight: 700; }

.price { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.price .card { display: flex; flex-direction: column; gap: 6px; }
.price .amount { font: 700 46px/1.1 "Anuphan", sans-serif; }
.price .amount small { font-size: 18px; font-weight: 500; }
.price ul { padding-left: 1.2em; color: var(--ink-2); margin: 8px 0 18px; flex: 1; }
.price .best { border: 2px solid var(--brand); }

details.faq { border-bottom: 1px solid var(--line); padding: 16px 0; }
details.faq summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
details.faq summary::after { content: "+"; color: var(--brand); font-size: 22px; line-height: 1; }
details.faq[open] summary::after { content: "–"; }
details.faq p { margin: 12px 0 0; color: var(--ink-2); }

.disclaimer { font-size: 14px; color: var(--mute); border-left: 3px solid var(--line); padding-left: 14px; }

/* ── buy page ────────────────────────────────────────────────────── */
.buy { display: grid; grid-template-columns: 1fr 340px; gap: 28px; align-items: start; padding-top: 48px; }
@media (max-width: 880px) { .buy { grid-template-columns: 1fr; } }
.field { display: grid; gap: 6px; margin-bottom: 18px; }
.field label { font-weight: 600; }
.input { width: 100%; min-height: 52px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 500 22px/1 "IBM Plex Sans Thai", monospace; letter-spacing: .06em; }
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.input.bad { border-color: var(--bad); }
.check { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; color: var(--ink-2); font-size: 16px; }
.check input { width: 20px; height: 20px; margin-top: 4px; accent-color: var(--brand); flex: none; }
.msg { min-height: 1.5em; margin: 8px 0 0; font-size: 15px; }
.msg.bad { color: var(--bad); } .msg.ok { color: var(--ok); } .msg.warn { color: var(--warn); }
.qr-box { display: grid; justify-items: center; gap: 8px; text-align: center; }
.qr-box .qr { width: 260px; height: 260px; padding: 10px; background: #fff; border-radius: 14px; }
.qr-box .qr svg, .qr-box .qr img { width: 100%; height: 100%; }
.due { font: 700 40px/1.1 "Anuphan", sans-serif; }
.status { display: flex; gap: 10px; align-items: center; justify-content: center; font-size: 15px; color: var(--mute); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--warn); animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .dot { animation: none; } }
.done-mark { width: 72px; height: 72px; border-radius: 50%; background: var(--ok); color: #fff; display: grid; place-items: center; font-size: 40px; margin: 0 auto 12px; }
.side h3 { font-size: 17px; }
.side ol { padding-left: 1.2em; color: var(--ink-2); font-size: 15px; margin: 0; }
.side li { margin-bottom: .5em; }
[hidden] { display: none !important; }

/* ── prose (privacy/terms) ───────────────────────────────────────── */
.prose { padding-top: 48px; }
.prose h2 { font-size: 22px; margin-top: 36px; }
.prose li { margin-bottom: .4em; }
.prose table { border-collapse: collapse; width: 100%; font-size: 15px; margin: 8px 0 16px; }
.prose th, .prose td { text-align: left; border-bottom: 1px solid var(--line); padding: 10px 8px; vertical-align: top; }
.draft { background: #fff4d6; color: #5c3b00; border: 1px solid #f0c060; border-radius: 12px; padding: 12px 16px; font-size: 15px; }
