/* WayRoute — modern SaaS-style stylesheet (light + auto dark mode) */

:root {
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-2: #f1f4f9;
  --text: #171c26;
  --text-soft: #46505f;
  --muted: #6b7688;
  --border: #e4e8f0;
  --accent: #f87217;
  --accent-ink: #b8480a;
  --accent-soft: #fff1e6;
  --accent-grad: linear-gradient(135deg, #ff8a3d, #f05a10);
  --link: #2563eb;
  --line: #06c755;
  --header-bg: rgba(255, 255, 255, 0.85);
  --footer-bg: #12151c;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);
  --shadow-md: 0 4px 14px -4px rgba(16, 24, 40, .12), 0 2px 6px -2px rgba(16, 24, 40, .06);
  --shadow-lg: 0 18px 40px -20px rgba(16, 24, 40, .35);
  --radius: 14px;
  --radius-sm: 9px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1117;
    --surface: #161b24;
    --surface-2: #1c222d;
    --text: #e9ecf3;
    --text-soft: #c2c9d6;
    --muted: #8d97a8;
    --border: #262d3a;
    --accent: #ff8a3d;
    --accent-ink: #ffb27a;
    --accent-soft: #2a1c12;
    --link: #79b0ff;
    --header-bg: rgba(14, 17, 23, 0.85);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-md: 0 4px 14px -4px rgba(0, 0, 0, .5);
    --shadow-lg: 0 18px 40px -20px rgba(0, 0, 0, .8);
  }
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
    "Leelawadee UI", "Noto Sans Thai", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover {
  opacity: .85;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

h1, h2, h3, h4 {
  line-height: 1.25;
  margin: 0 0 .6em;
  letter-spacing: -0.01em;
}

p {
  margin: 0 0 1em;
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 24px;
  padding-top: 12px;
  padding-bottom: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: inherit;
}

.brand img {
  display: block;
  height: 40px;
  width: auto;
  padding: 6px 10px;
  background: #fff;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

@media (prefers-color-scheme: dark) {
  .brand img {
    background: #fff;
  }
}

.brand .tagline {
  color: var(--muted);
  font-size: 13px;
  border-left: 1px solid var(--border);
  padding-left: 14px;
}

.site-nav {
  margin-left: auto;
}

.site-nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0;
  padding: 0;
}

.site-nav a {
  display: block;
  padding: 8px 15px;
  color: var(--text-soft);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  border-radius: 999px;
  transition: background .15s, color .15s;
}

.site-nav a:hover {
  background: var(--surface-2);
  opacity: 1;
  color: var(--text);
}

.site-nav a[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--accent);
}

/* language switch sits inline as the last menu item */
.nav-lang {
  display: flex;
  align-items: center;
  margin-left: 6px;
}

.nav-lang .lang-switch {
  margin: 0;
}

/* ---------- Hero ---------- */

.hero {
  background:
    radial-gradient(1000px 400px at 85% -10%, rgba(248, 114, 23, .35), transparent 60%),
    radial-gradient(700px 350px at 5% 110%, rgba(37, 99, 235, .28), transparent 60%),
    linear-gradient(160deg, #171c26 0%, #232b3a 100%);
  color: #fff;
  padding: 64px 0 56px;
}

.hero .container {
  max-width: 1080px;
}

.hero-kicker {
  display: inline-block;
  margin: 0 0 14px;
  padding: 5px 14px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #ffd9bd;
  background: rgba(248, 114, 23, .18);
  border: 1px solid rgba(248, 114, 23, .5);
  border-radius: 999px;
}

.hero h1 {
  font-size: clamp(28px, 4.5vw, 44px);
  max-width: 36ch;
  margin-bottom: .4em;
}

.hero-lead {
  max-width: 62ch;
  color: #c9d1e0;
  font-size: 17px;
  margin-bottom: 0;
}

/* Slim page banner for inner pages */
.page-banner {
  background:
    radial-gradient(900px 300px at 90% -20%, rgba(248, 114, 23, .3), transparent 60%),
    linear-gradient(160deg, #171c26, #232b3a);
  color: #fff;
  padding: 40px 0 36px;
}

.page-banner h1 {
  font-size: clamp(26px, 3.6vw, 36px);
  margin-bottom: .3em;
}

.page-banner p {
  color: #c9d1e0;
  margin: 0;
  max-width: 60ch;
}

/* ---------- Layout ---------- */

.page {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 1fr);
  gap: 28px;
  padding-top: 32px;
  padding-bottom: 44px;
  align-items: start;
}

.page--narrow {
  grid-template-columns: minmax(0, 1fr);
  max-width: 820px;
}

.content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 28px 32px;
}

.content > :last-child {
  margin-bottom: 0;
}

.content > :first-child {
  margin-top: 0;
}

.content h1 {
  font-size: 26px;
}

.content h2 {
  font-size: 20px;
  margin-top: 1.8em;
}

.content ul, .content ol {
  padding-left: 1.3em;
}

.content li {
  margin-bottom: .35em;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  background: var(--accent-grad);
  color: #fff;
  padding: 13px 26px;
  margin: 6px 4px;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  border: none;
  border-radius: 999px;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  transition: transform .15s, box-shadow .15s, filter .15s;
}

.btn:hover {
  opacity: 1;
  color: #fff;
  transform: translateY(-2px);
  filter: brightness(1.05);
  box-shadow: var(--shadow-lg);
}

.btn:active {
  transform: translateY(0);
}

.btn--line {
  background: linear-gradient(135deg, #19d366, #05a948);
}

.btn--ghost {
  background: transparent;
  color: #fff;
  border: 1.5px solid rgba(255, 255, 255, .45);
  box-shadow: none;
}

.btn--ghost:hover {
  background: rgba(255, 255, 255, .12);
  box-shadow: none;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  margin: 22px 0 6px;
}

.hero .actions,
.page-banner .actions {
  justify-content: flex-start;
  margin: 26px 0 0;
}

/* ---------- Section headings ---------- */

.section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 19px;
  font-weight: 800;
  color: var(--text);
  margin: 34px 0 16px;
}

.section-title::before {
  content: "";
  flex: 0 0 auto;
  width: 5px;
  height: 1.15em;
  border-radius: 3px;
  background: var(--accent-grad);
}

.section-title:first-of-type {
  margin-top: 4px;
}

/* ---------- Product cards ---------- */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}

.card {
  display: flex;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
}

.card img {
  flex: 0 0 auto;
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 10px;
  background: var(--surface-2);
}

.card .card-title {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.card p {
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--text-soft);
}

/* ---------- Sidebar widgets ---------- */

.widget {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 18px;
  margin-bottom: 18px;
}

.widget h3 {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 14px;
}

.widget--login img.preview {
  display: block;
  width: 100%;
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
  border: 1px solid var(--border);
}

.widget--login label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
  padding: 6px 0 4px;
}

.widget--login input {
  width: 100%;
  padding: 10px 12px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color .15s, background .15s;
}

.widget--login input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
}

.widget--login .submit-row {
  text-align: right;
  margin-top: 12px;
}

.widget--login input[type="submit"],
.widget--login .submit-row button {
  width: auto;
  background: var(--accent-grad);
  color: #fff;
  font-weight: 700;
  font-family: inherit;
  border: none;
  padding: 10px 20px;
  border-radius: 999px;
  cursor: pointer;
  transition: transform .15s, filter .15s;
}

.widget--login input[type="submit"]:hover,
.widget--login .submit-row button:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

.store-links {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.store-links a {
  flex: 1;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  color: var(--text-soft);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 8px;
  transition: transform .15s, box-shadow .15s;
}

.store-links a:hover {
  opacity: 1;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.store-links img {
  display: block;
  width: 100%;
  margin-bottom: 6px;
}

.widget--contact {
  font-size: 14px;
}

.widget--contact ol {
  margin: 0 0 12px;
  padding-left: 18px;
}

.widget--contact li {
  margin-bottom: .4em;
}

.widget--contact a.qr {
  display: block;
  text-align: center;
  text-decoration: none;
  color: var(--text-soft);
}

.widget--contact a.qr img {
  width: 100%;
  max-width: 180px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #fff;
  padding: 6px;
}

.widget--contact .qr-caption {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}

/* ---------- Contact page ---------- */

.contact-info address {
  font-style: normal;
  margin-bottom: 1em;
  color: var(--text-soft);
}

.company-name {
  font-size: 19px;
}

.qr-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 8px;
}

.qr-row a {
  display: block;
  width: 200px;
  text-align: center;
  font-size: 13px;
  text-decoration: none;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  transition: transform .15s, box-shadow .15s;
}

.qr-row a:hover {
  opacity: 1;
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.qr-row img {
  width: 100%;
  border-radius: var(--radius-sm);
  background: #fff;
  padding: 6px;
}

/* ---------- Footer ---------- */

.site-footer {
  background: var(--footer-bg);
  color: #97a1b3;
  font-size: 14px;
  padding: 26px 0;
}

.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 28px;
  align-items: center;
}

.site-footer ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 0;
  padding: 0;
}

.site-footer a {
  color: #dbe1ec;
  text-decoration: none;
}

.site-footer a:hover {
  color: #fff;
  opacity: 1;
  text-decoration: underline;
}

.site-footer .copyright {
  margin-left: auto;
  color: #6e7889;
}

/* ---------- Hero bullet points ---------- */

.hero-points {
  list-style: none;
  display: grid;
  gap: 8px;
  margin: 20px 0 0;
  padding: 0;
}

.hero-points li {
  position: relative;
  padding-left: 30px;
  color: #dfe6f2;
  font-size: 15px;
}

.hero-points li::before {
  content: "\2713";
  position: absolute;
  left: 0;
  top: 0;
  color: #ff8a3d;
  font-weight: 700;
}

/* ---------- Brand chips ---------- */

.chips {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 0;
  padding: 0;
}

.chip {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
  padding: 3px 11px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-ink, var(--accent));
  border: 1px solid var(--accent);
}

/* ---------- FAQ (native <details>) ---------- */

.faq {
  margin-top: 30px;
}

.faq details {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 13px 16px;
  margin-bottom: 10px;
}

.faq summary {
  cursor: pointer;
  font-weight: 700;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  flex: 0 0 auto;
  color: var(--accent);
  font-weight: 700;
}

.faq details[open] summary::after {
  content: "\2212";
}

.faq details p {
  margin: 10px 0 2px;
  color: var(--text-soft);
  font-size: 15px;
}

/* ---------- How-it-works steps ---------- */

.steps {
  list-style: none;
  counter-reset: step;
  margin: 0;
  padding: 0;
}

.steps li {
  counter-increment: step;
  position: relative;
  padding: 0 0 16px 44px;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-grad);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}

/* ---------- Timeline (about page) ---------- */

.timeline {
  list-style: none;
  margin: 0;
  padding: 0 0 0 22px;
  border-left: 2px solid var(--border);
}

.timeline li {
  position: relative;
  padding: 0 0 20px 14px;
}

.timeline li::before {
  content: "";
  position: absolute;
  left: -29px;
  top: 7px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 1px var(--accent);
}

.timeline .year {
  display: block;
  font-weight: 800;
  color: var(--accent-ink, var(--accent));
  font-size: 14px;
  letter-spacing: .04em;
}

/* ---------- Full-width single card ---------- */

.cards--single {
  grid-template-columns: 1fr;
}

.card-more {
  display: inline-block;
  margin-top: 8px;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
}

/* ---------- Language switch ---------- */

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.lang-switch button {
  border: 0;
  background: transparent;
  color: var(--text-soft);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  padding: 7px 13px;
  border-radius: 999px;
  cursor: pointer;
  transition: background .15s, color .15s;
}

.lang-switch button:hover {
  background: var(--border);
  color: var(--text);
}

.lang-switch button[aria-pressed="true"] {
  background: var(--accent-grad);
  color: #fff;
}

.lang-switch .sep {
  color: var(--muted);
  font-size: 13px;
  user-select: none;
}

/* ---------- Language visibility (both languages ship in the HTML) ---------- */

[data-lang="en"] .lang-th,
[data-lang="th"] .lang-en {
  display: none !important;
}

.lang-note {
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 14px;
  color: var(--text-soft);
  margin-bottom: 18px;
}

/* ---------- Error page ---------- */

.error-code {
  font-size: clamp(56px, 12vw, 110px);
  font-weight: 800;
  line-height: 1;
  margin: 0 0 4px;
  color: transparent;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
}

.link-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.link-list li {
  border-bottom: 1px solid var(--border);
}

.link-list li:last-child {
  border-bottom: 0;
}

.link-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 4px;
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  transition: color .15s, padding .15s;
}

.link-list a::after {
  content: "\2192";
  flex: 0 0 auto;
  color: var(--accent);
  transition: transform .15s;
}

.link-list a:hover {
  color: var(--accent-ink, var(--accent));
  opacity: 1;
}

.link-list a:hover::after {
  transform: translateX(4px);
}

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .page {
    grid-template-columns: 1fr;
    padding-top: 22px;
  }

  /* Login panel jumps above the first (server) product section */
  .page > aside {
    display: contents;
  }

  .page .content {
    order: 2;
  }

  .page .widget--login {
    order: 1;
    margin-bottom: 0;
  }

  .page .widget--contact {
    order: 3;
    margin-bottom: 0;
  }

  .content {
    padding: 22px 18px;
  }

  .site-header .container {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .site-nav {
    margin-left: 0;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  .nav-lang {
    margin-left: 4px;
    position: sticky;
    right: 0;
    padding-left: 6px;
    background: linear-gradient(90deg, transparent, var(--header-bg) 40%);
  }

  .site-nav ul {
    flex-wrap: nowrap;
    padding-bottom: 2px;
  }

  .site-nav a {
    padding: 7px 13px;
    font-size: 14px;
    white-space: nowrap;
  }

  .brand .tagline {
    display: none;
  }

  .hero {
    padding: 44px 0 40px;
  }

  .site-footer .copyright {
    margin-left: 0;
  }

  .qr-row a {
    width: 100%;
    max-width: 320px;
  }
}
