/* ===== ServiZy hub theme — GENERATED by scripts/sync-tokens.sh, do not edit Part 1 =====
 * Part 1: copied verbatim from servizymax packages/ui/src/tokens.css ("Clear Blue", ADR 0012).
 * Part 2: marketing layer from assets/theme.marketing.css. */

/* ---------- Part 1: ServiZyMax tokens ---------- */
:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-2: #eef3fa;
  --ink: #101b36;
  --ink-2: #44536e;
  --muted: #5c6b85;
  --line: #e1e8f2;
  --primary: #2563eb;
  --primary-hover: #1b4fd1;
  --primary-soft: #e6eefe;
  --on-primary: #ffffff;
  --accent: #8a6400;
  --accent-surface: #e9a800;
  --success: #15803d;
  --warning: #7a5600;
  --danger: #dc2626;
  --on-danger: #ffffff;
  --info: #1d4ed8;
  --pending: #6d28d9;
  --focus: #1b4fd1;

  --chip-info-bg: #e3edfd;
  --chip-info-fg: #1749b8;
  --chip-primary-bg: #2563eb;
  --chip-primary-fg: #ffffff;
  --chip-primary-soft-bg: #e6eefe;
  --chip-primary-soft-fg: #1a4fbe;
  --chip-warning-bg: #fcf0d8;
  --chip-warning-fg: #7a5600;
  --chip-pending-bg: #eee9fd;
  --chip-pending-fg: #5b21b6;
  --chip-success-bg: #dcf3e4;
  --chip-success-fg: #146b3d;
  --chip-danger-bg: #fce5e6;
  --chip-danger-fg: #b02a2a;
  --chip-muted-bg: #eef3fa;
  --chip-muted-fg: #4a5a73;

  /* Chart fills (design.md §9.9, ADR 0017). Fills, never text: values stay in ink tokens. */
  --viz-1: #2563eb;
  --viz-2: #14b8a6;
  --viz-3: #f59e0b;
  --viz-4: #e11d48;
  --viz-new: #60a5fa;
  --viz-assigned: #7c3aed;
  --viz-progress: #f59e0b;
  --viz-hold: #e11d48;
  --viz-closing: #14b8a6;
  --viz-done: #10b981;
  --viz-cancelled: #64748b;
  --viz-good: #10b981;
  --viz-warn: #f59e0b;
  --viz-bad: #e11d48;
}

[data-theme=dark] {
  --bg: #0d131f;
  --surface: #141c2b;
  --surface-2: #1c2536;
  --ink: #e6edf7;
  --ink-2: #afbdd1;
  --muted: #8e9db4;
  --line: #273245;
  --primary: #60a5fa;
  --primary-hover: #93c0fc;
  --primary-soft: #17294a;
  --on-primary: #07172e;
  --accent: #f5c21b;
  --accent-surface: #f5c21b;
  --success: #4ade80;
  --warning: #f5c21b;
  --danger: #f87171;
  --on-danger: #2a0808;
  --info: #8ab6ff;
  --pending: #a78bfa;
  --focus: #93c0fc;

  --chip-info-bg: #16253f;
  --chip-info-fg: #96beff;
  --chip-primary-bg: #60a5fa;
  --chip-primary-fg: #07172e;
  --chip-primary-soft-bg: #17294a;
  --chip-primary-soft-fg: #9cc4fd;
  --chip-warning-bg: #332a08;
  --chip-warning-fg: #f5c21b;
  --chip-pending-bg: #241f45;
  --chip-pending-fg: #bfaeff;
  --chip-success-bg: #10301f;
  --chip-success-fg: #62de99;
  --chip-danger-bg: #3a1a18;
  --chip-danger-fg: #ff9490;
  --chip-muted-bg: #1c2536;
  --chip-muted-fg: #a9b7cb;

  --viz-1: #60a5fa;
  --viz-2: #2dd4bf;
  --viz-3: #f59e0b;
  --viz-4: #f43f5e;
  --viz-new: #60a5fa;
  --viz-assigned: #8b5cf6;
  --viz-progress: #f59e0b;
  --viz-hold: #f43f5e;
  --viz-closing: #2dd4bf;
  --viz-done: #34d399;
  --viz-cancelled: #64748b;
  --viz-good: #34d399;
  --viz-warn: #f59e0b;
  --viz-bad: #f43f5e;
}

/* Shape, type, spacing and layout: shared by both themes (design.md §9.4–§9.6). */
:root {
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  /* The phone bottom sheet's top corners: a sheet is the largest surface, so the roundest. */
  --radius-xl: 22px;
  --radius-pill: 999px;

  --font-display: 'Anuphan Variable', 'Anuphan', system-ui, sans-serif;
  --font-body: 'IBM Plex Sans Thai', 'IBM Plex Sans', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;

  /* A card is a hairline AND a shadow — see design.md §9.5 for why neither alone works. */
  --shadow-card: 0 1px 2px rgb(16 27 54 / 6%);
  --shadow-raised: 0 4px 12px rgb(16 27 54 / 8%);
  --shadow-sheet: 0 16px 40px rgb(16 27 54 / 18%);
  --shadow-tabbar: 0 -6px 20px rgb(16 27 54 / 6%);

  --space-gutter: 16px;
  --space-gutter-phone: 16px;
  --space-card: 16px;
  --space-card-phone: 16px;
  --tap-target: 44px;
  --tap-target-field: 48px;

  /*
   * Control heights (design.md §9.5, plan 7.29, 7.47). A touch screen gets 40 px — the owner
   * traded the old 44 px for more room for content (ADR 0013); it is still well over WCAG 2.2's
   * 24 px minimum. A desk with a mouse gets the compact height below, so a list or form shows
   * more rows without a single component knowing about the device.
   */
  --control-h: 40px;
  --control-h-lg: 44px;

  --sidebar-w: 232px;
  --sidebar-w-collapsed: 72px;
  --content-max: 1440px;
  --tabbar-h: 56px;
}


/* ---------- Part 2: marketing layer (edit freely) ----------
 * Max's app body (0.875rem / lh 1.5) is dense app UI. Thai marketing copy needs more room:
 * stacked vowels and tone marks clip below lh ~1.65, and Thai glyphs read smaller than Latin
 * at the same px size. So the sale pages use a larger scale while keeping every colour,
 * radius and shadow from Max. */
:root {
  --page-max: 1180px;
  --section-y: clamp(64px, 9vw, 112px);
  --fs-body: 1.0625rem;   /* 17px */
  --fs-lead: 1.1875rem;   /* 19px */
  --fs-h1: clamp(2.1rem, 5vw, 3.5rem);
  --fs-h2: clamp(1.6rem, 3.4vw, 2.4rem);
  --fs-h3: 1.2rem;
  --fs-metric: clamp(2.2rem, 5vw, 3rem);
  --navy: #101b36;        /* wordmark suffix / dark bands — same value as light --ink */
}

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; color-scheme: light; background: var(--bg); }
html[data-theme=dark] { color-scheme: dark; }
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; line-height: 1.32; letter-spacing: 0; margin: 0 0 .5em; text-wrap: balance; }
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); font-weight: 600; }
h1:lang(en), h2:lang(en) { letter-spacing: -0.01em; } /* never on Thai */
p { margin: 0 0 1em; }
.lead { font-size: var(--fs-lead); color: var(--ink-2); }
.muted { color: var(--muted); }
.mono { font-family: var(--font-mono); font-weight: 500; }
.nowrap { white-space: nowrap; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }
img, svg { max-width: 100%; display: block; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* Layout */
.container { width: min(var(--page-max), 100% - 32px); margin-inline: auto; }
.section { padding-block: var(--section-y); }
.section--surface { background: var(--surface); border-block: 1px solid var(--line); }
.section-head { max-width: 760px; margin: 0 auto 3rem; text-align: center; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-2 { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

/* Wordmark: "ServiZy" in primary + product suffix in navy (matches the Max cover slide) */
.wordmark { display: inline-flex; align-items: center; gap: .55rem; font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; color: var(--primary); line-height: 1; }
.wordmark img { width: 36px; height: 36px; border-radius: 22%; }
.wordmark b { color: var(--ink); font-weight: 700; }

/* Header (sticky, light blur like Max's sticky headers) */
.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: 68px; }
.nav-links { display: flex; gap: 1.6rem; list-style: none; margin: 0; padding: 0; }
.nav-links a { color: var(--ink-2); font-weight: 500; }
.nav-links a:hover, .nav-links a[aria-current=page] { color: var(--primary); }
.menu-btn { display: none; background: none; border: 0; padding: 8px; color: var(--ink); cursor: pointer; }
@media (max-width: 900px) {
  .nav-links { position: absolute; inset: 68px 0 auto 0; flex-direction: column; gap: 0; padding: .5rem 16px 1rem; background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: var(--shadow-raised); display: none; }
  .nav-links.open { display: flex; }
  .nav-links a { display: block; padding: .75rem 0; }
  .menu-btn { display: block; }
  .nav .btn-header { display: none; }
}

/* Buttons — mirrors packages/ui button-class.ts (primary / secondary / ghost) at marketing size */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 48px; padding: .55em 1.4em; border-radius: var(--radius-md); font: inherit; font-weight: 600; border: 1px solid transparent; cursor: pointer; transition: background .15s, box-shadow .15s, transform .15s; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--primary); color: var(--on-primary); box-shadow: var(--shadow-card); }
.btn-primary:hover { background: var(--primary-hover); color: var(--on-primary); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-secondary:hover { background: var(--surface-2); color: var(--ink); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; }
@media (max-width: 600px) { .btn-row .btn { flex: 1 1 100%; } }

/* Cards — hairline AND shadow; never nest a card in a card */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); padding: 24px; }
a.card, .card--interactive { color: inherit; transition: box-shadow .2s, transform .2s; }
a.card:hover, .card--interactive:hover { box-shadow: var(--shadow-raised); transform: translateY(-2px); }
.card--accent > h3 { border-left: 3px solid var(--primary); padding-left: 10px; }
.card p:last-child { margin-bottom: 0; }
.icon-tile { width: 44px; height: 44px; border-radius: var(--radius-md); display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); margin-bottom: 14px; }

/* Chips — soft pastel, never solid blocks (except .chip--primary) */
.chip { display: inline-flex; align-items: center; gap: .35em; font-size: .8rem; font-weight: 500; line-height: 1.6; padding: .15em .75em; border-radius: var(--radius-pill); white-space: nowrap; }
.chip--info { background: var(--chip-info-bg); color: var(--chip-info-fg); }
.chip--primary { background: var(--chip-primary-bg); color: var(--chip-primary-fg); }
.chip--primary-soft { background: var(--chip-primary-soft-bg); color: var(--chip-primary-soft-fg); }
.chip--success { background: var(--chip-success-bg); color: var(--chip-success-fg); }
.chip--warning { background: var(--chip-warning-bg); color: var(--chip-warning-fg); }
.chip--pending { background: var(--chip-pending-bg); color: var(--chip-pending-fg); }
.chip--danger { background: var(--chip-danger-bg); color: var(--chip-danger-fg); }
.chip--muted { background: var(--chip-muted-bg); color: var(--chip-muted-fg); }

/* Hero — the only gradient allowed: primary-soft → surface (as Max DashboardHero) */
.hero { background: linear-gradient(to right, var(--primary-soft), var(--surface) 60%, var(--surface)); border-bottom: 1px solid var(--line); padding-block: clamp(56px, 8vw, 104px); }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 3rem; align-items: center; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } }

/* Metrics — numbers are the loudest thing on the page */
.metric b { display: block; font-family: var(--font-display); font-size: var(--fs-metric); font-weight: 700; line-height: 1.25; color: var(--ink); font-variant-numeric: tabular-nums; }
.metric span { color: var(--muted); }

/* Wayfinding band (from Max public intake): navy + amber stripe + faint 28px grid */
.band-navy { background-color: var(--navy); color: #fff; background-image: linear-gradient(rgb(255 255 255 / 6%) 1px, transparent 1px), linear-gradient(90deg, rgb(255 255 255 / 6%) 1px, transparent 1px); background-size: 28px 28px; border-top: 4px solid var(--accent-surface); }
.band-navy p, .band-navy .muted { color: #b4c0d6; }
.band-navy a:not(.btn) { color: #fff; }

/* Product chooser (hub) */
.product-card { display: flex; flex-direction: column; gap: 12px; }
.product-card ul { list-style: none; padding: 0; margin: 4px 0 8px; flex: 1; }
.product-card li { padding: .3rem 0 .3rem 1.6rem; position: relative; }
.product-card li::before { content: ""; position: absolute; left: 0; top: .85em; width: 14px; height: 8px; border-left: 2px solid var(--success); border-bottom: 2px solid var(--success); transform: rotate(-45deg) translateY(-50%); }

/* Comparison table */
.compare { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); overflow: hidden; }
.compare th, .compare td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.compare thead th { background: var(--surface-2); font-family: var(--font-display); }
.compare tr:last-child td { border-bottom: 0; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Pricing */
.plan { display: flex; flex-direction: column; position: relative; }
.plan--featured { border: 2px solid var(--primary); box-shadow: var(--shadow-raised); }
.plan .price { font-family: var(--font-display); font-size: 2.2rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.3; }
.plan .price small { font-size: 1rem; font-weight: 500; color: var(--muted); }

/* FAQ */
.faq { max-width: 820px; margin-inline: auto; }
.faq details { border-bottom: 1px solid var(--line); padding: 1rem 0; }
.faq summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--primary); font-size: 1.4rem; line-height: 1; transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--ink-2); margin: .75rem 0 0; }

/* Footer */
.site-footer { background: var(--navy); color: #b4c0d6; padding: 48px 0 32px; font-size: .95rem; }
.site-footer a { color: #fff; }

/* PDPA consent banner */
.consent-banner { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 70; max-width: 640px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sheet); padding: 16px 18px; font-size: .95rem; display: none; animation: sheet-up .25s ease-out; }
.consent-banner.show { display: block; }

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .5s ease, transform .5s ease; }
.reveal.in { opacity: 1; transform: none; }

@keyframes sheet-up { from { transform: translateY(100%); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}
