:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --text: #14172b;
  --muted: #5d6280;
  --line: #e3e6f0;
  --brand: #3b3bd6;
  --brand-ink: #ffffff;
  --brand-soft: #ececfd;
  --ok: #157f4f;
  --ok-soft: #e3f5ec;
  --bad: #b42335;
  --bad-soft: #fbe7ea;
  --warn: #8a5a00;
  --warn-soft: #fff4d6;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 23, 43, .06), 0 8px 24px rgba(20, 23, 43, .06);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1120;
    --surface: #171a2e;
    --text: #eceefa;
    --muted: #a3a8c6;
    --line: #2a2e4a;
    --brand: #8b8bff;
    --brand-ink: #0f1120;
    --brand-soft: #23264a;
    --ok: #5fd39a;
    --ok-soft: #12301f;
    --bad: #ff8a98;
    --bad-soft: #3a1820;
    --warn: #ffd27a;
    --warn-soft: #3a2e10;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
.wrap { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }

.test-banner {
  background: var(--warn-soft);
  color: var(--warn);
  text-align: center;
  font-size: 14px;
  padding: 8px 16px;
  font-weight: 600;
}

.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.header-row { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; font-size: 18px; }
.brand-mark {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px;
  background: var(--brand); color: var(--brand-ink); font-weight: 800;
}
.secure-note { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; }

.hero { padding: 48px 0 24px; }
.hero h1 { margin: 0 0 8px; font-size: clamp(28px, 4vw, 40px); line-height: 1.15; letter-spacing: -.01em; }
.lead { margin: 0; max-width: 640px; color: var(--muted); font-size: 17px; }

.products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  padding: 16px 0 56px;
}
.product {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.product .tag { align-self: flex-start; font-size: 12px; font-weight: 700; color: var(--brand); background: var(--brand-soft); padding: 3px 9px; border-radius: 999px; }
.product h2 { margin: 0; font-size: 20px; }
.product p { margin: 0; color: var(--muted); flex: 1; }
.product ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 14px; }
.price { font-size: 26px; font-weight: 800; letter-spacing: -.01em; }
.price small { font-size: 14px; font-weight: 600; color: var(--muted); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 10px; padding: 11px 18px;
  font: inherit; font-weight: 700; cursor: pointer; text-decoration: none;
}
.btn-primary { background: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-primary[disabled] { opacity: .6; cursor: progress; }
.btn-block { width: 100%; }
.icon-btn { border: 0; background: transparent; color: var(--muted); font-size: 26px; line-height: 1; cursor: pointer; padding: 4px 8px; }

.checkout { border: 0; padding: 0; border-radius: var(--radius); width: min(440px, calc(100vw - 32px)); background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.checkout::backdrop { background: rgba(10, 12, 30, .55); }
.checkout-form { display: flex; flex-direction: column; gap: 14px; padding: 20px 22px 22px; }
.checkout-head { display: flex; align-items: center; justify-content: space-between; }
.checkout-head h2 { margin: 0; font-size: 20px; }
.order-line { display: flex; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 10px; background: var(--brand-soft); }
label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; }
input {
  font: inherit; font-weight: 400; color: var(--text); background: var(--bg);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%;
}
input:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
.form-error { margin: 0; color: var(--bad); background: var(--bad-soft); padding: 10px 12px; border-radius: 10px; font-size: 14px; }
.fine { margin: 0; text-align: center; color: var(--muted); font-size: 13px; }

.result-wrap { display: grid; place-items: center; padding-top: 48px; padding-bottom: 48px; }
.result-card {
  width: min(520px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 32px 24px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.result-card h1 { margin: 0; font-size: 24px; }
.result-card p { margin: 0; }
.result-icon { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; font-size: 28px; font-weight: 800; background: var(--brand-soft); color: var(--brand); }
.result-icon::before { content: "…"; }
.result-card[data-state="paid"] .result-icon { background: var(--ok-soft); color: var(--ok); }
.result-card[data-state="paid"] .result-icon::before { content: "✓"; }
.result-card[data-state="failed"] .result-icon { background: var(--bad-soft); color: var(--bad); }
.result-card[data-state="failed"] .result-icon::before { content: "!"; }
.result-card[data-state="pending"] .result-icon { background: var(--warn-soft); color: var(--warn); }
.result-facts { width: 100%; margin: 8px 0; display: grid; gap: 8px; text-align: left; }
.result-facts div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.result-facts dt { color: var(--muted); }
.result-facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; text-align: right; }

.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; padding: 18px 0; background: var(--surface); }
