/* Copyright 2026 Servicehub Ltd */

:root {
  --bg: #f7f7f9; --surface: #ffffff; --surface-2: #f1f2f5; --border: #e3e5ea; --text: #15171c;
  --muted: #646a78; --accent: #4f46e5; --accent-ink: #ffffff; --ok: #0b7a53; --warn: #b26a00; --bad: #c2312f;
  --radius: 10px; --shadow: 0 1px 2px rgba(16,24,40,.05), 0 1px 3px rgba(16,24,40,.06);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg:#0f1115; --surface:#171a21; --surface-2:#1e222b; --border:#2a2f3a; --text:#e8eaf0; --muted:#9aa1b2;
          --accent:#8b85ff; --accent-ink:#0f1115; --ok:#3ccf91; --warn:#f0b23e; --bad:#ff6b66; }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.5; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 24px; margin: 0 0 16px; letter-spacing: -.01em; }
h2 { font-size: 17px; margin: 0 0 12px; }
h3 { font-size: 15px; margin: 0 0 8px; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* layout */
.topbar { display:flex; align-items:center; gap:16px; padding: 12px 24px; background: var(--surface);
          border-bottom: 1px solid var(--border); }
.brand { font-weight: 700; color: var(--text); font-size: 17px; letter-spacing: -.02em; }
.brand span { color: var(--accent); }
.spacer { flex: 1; }
.lang a { margin-left: 8px; font-size: 13px; color: var(--muted); }
.lang a.on { color: var(--text); font-weight: 600; }
.shell { display: grid; grid-template-columns: 220px 1fr; min-height: calc(100vh - 57px); }
.sidenav { background: var(--surface); border-right: 1px solid var(--border); padding: 16px 12px; }
.sidenav a { display:block; padding: 7px 10px; border-radius: 8px; color: var(--text); margin-bottom: 2px; }
.sidenav a:hover { background: var(--surface-2); text-decoration: none; }
.sidenav a.on { background: var(--surface-2); font-weight: 600; }
.sidenav .org { font-weight: 600; padding: 4px 10px 12px; }
.content { padding: 28px 32px; max-width: 1200px; }
main.narrow { max-width: 460px; margin: 48px auto; padding: 0 16px; }
main.wide { max-width: 980px; margin: 32px auto; padding: 0 16px; }

/* components */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
        padding: 20px; box-shadow: var(--shadow); margin-bottom: 20px; }
.grid { display: grid; gap: 16px; }
.grid.k4 { grid-template-columns: repeat(4, 1fr); }
.grid.k2 { grid-template-columns: 1fr 1fr; }
.kpi .label { color: var(--muted); font-size: 13px; }
.kpi .value { font-size: 24px; font-weight: 650; letter-spacing: -.02em; margin-top: 4px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: 0; }
.badge { display:inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600;
         background: var(--surface-2); color: var(--muted); }
.badge.ok { color: var(--ok); } .badge.warn { color: var(--warn); } .badge.bad { color: var(--bad); }
label { display:block; font-size: 13px; font-weight: 600; margin: 12px 0 4px; }
input, select, textarea { width: 100%; padding: 9px 11px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--text); font: inherit; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.row { display:flex; gap: 12px; } .row > * { flex: 1; }
.btn { display:inline-block; padding: 9px 16px; border-radius: 8px; border: 1px solid var(--accent);
       background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 600; cursor: pointer; }
.btn:hover { filter: brightness(1.05); text-decoration: none; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn.sm { padding: 4px 10px; font-size: 13px; }
.btn.danger { background: transparent; color: var(--bad); border-color: var(--border); }
.btn.block { width: 100%; padding: 12px; font-size: 16px; margin-top: 16px; }
form.inline { display: inline; }
.flash { padding: 10px 14px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border);
         margin-bottom: 16px; }
.error { color: var(--bad); font-size: 14px; margin-top: 8px; min-height: 1em; }
details summary { cursor: pointer; font-weight: 600; }
.chart { display:flex; align-items:flex-end; gap: 3px; height: 120px; padding-top: 8px; }
.chart .bar { flex: 1; background: var(--accent); opacity: .85; border-radius: 3px 3px 0 0; min-height: 2px; }
.secret { background: var(--surface-2); padding: 10px 12px; border-radius: 8px; word-break: break-all; }
.hero { text-align:center; padding: 72px 16px 40px; }
.hero h1 { font-size: 40px; letter-spacing: -.03em; }
.hero p { font-size: 18px; color: var(--muted); max-width: 640px; margin: 0 auto 24px; }
.features { display:grid; grid-template-columns: repeat(3, 1fr); gap: 16px; max-width: 980px; margin: 0 auto 60px;
            padding: 0 16px; }

/* checkout */
.checkout { display:grid; grid-template-columns: 1fr 1fr; min-height: 100vh; }
.checkout .summary { background: var(--surface-2); padding: 48px; }
.checkout .pay { padding: 48px; max-width: 520px; }
.line { display:flex; justify-content: space-between; padding: 6px 0; }
.line.total { font-weight: 700; font-size: 18px; border-top: 1px solid var(--border); margin-top: 8px; padding-top: 12px; }
.test-hint { font-size: 12px; color: var(--muted); margin-top: 6px; }

@media (max-width: 800px) {
  .shell, .checkout, .grid.k2, .features { grid-template-columns: 1fr; }
  .grid.k4 { grid-template-columns: 1fr 1fr; }
  .sidenav { border-right: 0; border-bottom: 1px solid var(--border); display:flex; flex-wrap: wrap; gap: 4px; }
  .content, .checkout .summary, .checkout .pay { padding: 20px 16px; }
  table { font-size: 13px; }
}

/* footer */
.site-footer { text-align: center; font-size: 13px; color: var(--muted); padding: 24px 16px; border-top: 1px solid var(--border); }
.qr svg { width: 200px; height: 200px; display: block; margin: 12px 0; }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; list-style: none; padding: 0; }
.env-banner { background: var(--warn); color: var(--accent-ink); text-align: center; font-size: 13px; font-weight: 600; padding: 4px 8px; }
.product-media { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin: 8px 0; }
.product-media img { width: 100%; height: auto; border-radius: 8px; }
/* white-label templates (approved set) */
body.theme-minimal .card, body.theme-minimal .summary { box-shadow: none; border-color: transparent; }
body.theme-dark { --bg: #0f1115; --surface: #171a21; --surface-2: #1f232c; --text: #e8eaf0; --muted: #a0a6b4; --border: #2a2f3a; background: var(--bg); color: var(--text); }
.brand-footer { margin: 16px auto; max-width: 720px; }
.embed-close { position: fixed; top: 8px; right: 8px; z-index: 10; font-size: 20px; line-height: 1; }
.lang-select { display: inline-flex; gap: 8px; align-items: center; margin: 16px auto; }
.lang-select select { width: auto; }

/* visually hidden, still read by screen readers */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
