:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #eef1f8;
  --text: #121826;
  --muted: #5d6679;
  --border: #dde2ee;
  --accent: #2f6bff;
  --accent-text: #ffffff;
  --accent-soft: #e6eeff;
  --ok: #138a4a;
  --ok-soft: #e3f5ea;
  --warn: #9a5b00;
  --warn-soft: #fff3dc;
  --err: #c0262d;
  --err-soft: #fde8e9;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 4px 16px rgba(16, 24, 40, .06);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e121a;
    --surface: #161b26;
    --surface-2: #1d2433;
    --text: #e8ecf4;
    --muted: #98a2b6;
    --border: #2a3245;
    --accent: #5b8cff;
    --accent-text: #0b0f17;
    --accent-soft: #1c2a4a;
    --ok: #4cc485;
    --ok-soft: #14301f;
    --warn: #f0b44c;
    --warn-soft: #3a2c10;
    --err: #ff7a7f;
    --err-soft: #3b171a;
    --shadow: none;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); }

.wrap { width: 100%; max-width: 980px; margin: 0 auto; padding: 0 16px; }
.center { text-align: center; }
.pad { padding: 48px 0; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.hidden { display: none !important; }

/* Top bar */
.topbar { background: var(--surface); border-bottom: 1px solid var(--border); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text); text-decoration: none; white-space: nowrap; }
.brand-mark { width: 26px; height: 26px; border-radius: 7px; background: var(--accent) url("/favicon.svg") center/cover; }
.topnav { display: flex; gap: 18px; font-size: 15px; }
.topnav a { color: var(--muted); text-decoration: none; }
.topnav a:hover { color: var(--text); }

main { flex: 1; padding-bottom: 48px; }

.footer { border-top: 1px solid var(--border); padding: 20px 0; font-size: 14px; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }

/* Hero */
.hero { padding: 48px 0 24px; }
.hero h1 { font-size: clamp(28px, 5vw, 42px); line-height: 1.15; margin: 0 0 12px; letter-spacing: -.02em; }
.hero p { font-size: 18px; color: var(--muted); margin: 0; max-width: 620px; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 28px 0 8px; padding: 0; list-style: none; counter-reset: step; }
.steps li { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; counter-increment: step; display: flex; gap: 12px; align-items: flex-start; }
.steps li::before { content: counter(step); flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; display: grid; place-items: center; font-size: 14px; }

h2 { font-size: 24px; margin: 40px 0 16px; letter-spacing: -.01em; }

/* Plans */
.plans { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.plan { display: flex; flex-direction: column; gap: 14px; }
.plan h3 { margin: 0; font-size: 20px; }
.plan-features { margin: 0; padding: 0; list-style: none; color: var(--muted); font-size: 15px; display: grid; gap: 4px; }
.plan-features li::before { content: "✓"; color: var(--ok); margin-right: 8px; font-weight: 700; }
.plan-desc { margin: 0; color: var(--muted); font-size: 14px; white-space: pre-line; }

.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { flex: 1 1 auto; min-width: 72px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); border-radius: 10px; padding: 8px 10px; font: inherit; font-size: 14px; cursor: pointer; }
.seg button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600; }

.price { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.price strong { font-size: 30px; letter-spacing: -.02em; }
.price .old { text-decoration: line-through; color: var(--muted); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px; padding: 13px 18px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; text-align: center; }
.btn-primary { background: var(--accent); color: var(--accent-text); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.btn-block { width: 100%; }
.btn-lg { padding: 16px 20px; font-size: 17px; }
.btn[disabled] { opacity: .6; cursor: progress; }

.field { display: flex; gap: 8px; flex-wrap: wrap; }
.field input, .field select { flex: 1 1 240px; min-width: 0; border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 12px; padding: 12px 14px; font: inherit; }
.field input:focus, .field select:focus, .btn:focus-visible, .seg button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Notices */
.notice { border-radius: 12px; padding: 12px 14px; margin: 12px 0; font-size: 15px; }
.notice-ok { background: var(--ok-soft); color: var(--ok); }
.notice-warn { background: var(--warn-soft); color: var(--warn); }
.notice-err { background: var(--err-soft); color: var(--err); }
.notice-info { background: var(--accent-soft); color: var(--text); }

/* FAQ */
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 16px; margin-bottom: 8px; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq p { margin: 8px 0 0; color: var(--muted); }

/* Order / subscription */
.panel { max-width: 640px; margin: 32px auto 0; }
.panel h1 { font-size: 28px; margin: 0 0 8px; letter-spacing: -.01em; }
.status { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.dot-ok { background: var(--ok); }
.dot-warn { background: var(--warn); }
.dot-err { background: var(--err); }

.spinner { width: 44px; height: 44px; border-radius: 50%; border: 4px solid var(--surface-2); border-top-color: var(--accent); animation: spin 1s linear infinite; margin: 24px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }

.step { display: grid; grid-template-columns: 32px 1fr; gap: 12px; padding: 18px 0; border-top: 1px solid var(--border); }
.step:first-of-type { border-top: 0; }
.step-num { width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; display: grid; place-items: center; }
.step > div { min-width: 0; }
.step h3 { margin: 4px 0 8px; font-size: 18px; }
.step p { margin: 0 0 10px; color: var(--muted); font-size: 15px; }

.apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.apps .btn { font-weight: 500; font-size: 14px; padding: 10px 12px; }

.linkbox { display: flex; gap: 8px; align-items: stretch; margin-top: 10px; }
.linkbox code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; font-size: 13px; }

.qr { display: flex; justify-content: center; margin: 14px 0 4px; }
.qr-box { background: #fff; padding: 12px; border-radius: 12px; line-height: 0; }
.qr-box img { width: 200px; height: 200px; image-rendering: pixelated; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 12px 0 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; }

@media (max-width: 720px) {
  .steps { grid-template-columns: 1fr; }
  .hero { padding-top: 32px; }
  .topnav { gap: 14px; }
}
