/* Central de Pagamentos — telas de quem paga (celular primeiro) e painel. */
:root {
  --bg: oklch(0.985 0.003 265);
  --surface: oklch(1 0 0);
  --sunken: oklch(0.965 0.004 265);
  --line: oklch(0.91 0.006 265);
  --ink: oklch(0.22 0.02 265);
  --ink-2: oklch(0.42 0.02 265);
  --ink-3: oklch(0.54 0.015 265);
  --ok: oklch(0.58 0.14 155);
  --ok-soft: oklch(0.95 0.04 155);
  --warn: oklch(0.62 0.14 70);
  --warn-soft: oklch(0.96 0.05 85);
  --err: oklch(0.56 0.19 25);
  --err-soft: oklch(0.96 0.03 25);
  --brand: #4F46E5;
  --link: oklch(0.5 0.2 275);
  --r: 10px;
  --r-lg: 16px;
  --shadow: 0 1px 2px oklch(0 0 0 / .06), 0 8px 28px oklch(0.3 0.03 265 / .08);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: oklch(0.17 0.01 265); --surface: oklch(0.21 0.012 265); --sunken: oklch(0.19 0.01 265);
    --line: oklch(0.3 0.015 265); --ink: oklch(0.95 0.005 265); --ink-2: oklch(0.78 0.01 265); --ink-3: oklch(0.66 0.012 265);
    --ok-soft: oklch(0.3 0.06 155); --warn-soft: oklch(0.32 0.06 80); --err-soft: oklch(0.32 0.07 25);
    --shadow: 0 1px 2px oklch(0 0 0 / .4), 0 12px 32px oklch(0 0 0 / .35);
    --link: oklch(0.78 0.12 275);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font); }
a { color: var(--link); }
h1, h2, h3 { line-height: 1.2; text-wrap: balance; margin: 0; }
code, .mono { font-family: var(--mono); font-size: .86em; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }

/* botões e campos */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 0 14px; border-radius: var(--r);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 550 14px var(--font); cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--ink-3); }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.big { width: 100%; min-height: 52px; font-size: 16px; border-radius: 12px; }
.btn.sm { min-height: 30px; padding: 0 10px; font-size: 13px; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
label { display: grid; gap: 5px; font-size: 13px; font-weight: 550; color: var(--ink-2); }
input, select, textarea { width: 100%; min-height: 38px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); color: var(--ink); font: 14px var(--font); }
input[type=color] { padding: 3px; min-height: 38px; }
input[type=checkbox] { width: auto; min-height: auto; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--ink); }
.hint { font-weight: 400; color: var(--ink-3); font-size: 12px; }

.alert { padding: 10px 14px; border-radius: var(--r); font-size: 14px; margin: 0 0 16px; }
.alert.err { background: var(--err-soft); color: var(--err); }
.alert.ok { background: var(--ok-soft); color: var(--ok); }
.alert.warn { background: var(--warn-soft); color: var(--ink); }

/* ============ tela de pagamento ============ */
.pay { min-height: 100dvh; display: grid; place-items: start center; padding: 28px 16px 40px; }
.pay-card { width: min(440px, 100%); background: var(--surface); border-radius: 20px; box-shadow: var(--shadow); overflow: hidden; }
.pay-top { padding: 22px 24px 18px; border-top: 5px solid var(--brand); display: flex; align-items: center; gap: 12px; }
.pay-top img { height: 36px; max-width: 140px; object-fit: contain; }
.pay-top .who { font-weight: 650; font-size: 16px; }
.pay-body { padding: 4px 24px 24px; }
.pay-body h1 { font-size: 22px; letter-spacing: -0.01em; }
.pay-body .desc { color: var(--ink-2); margin: 6px 0 0; }
.price { margin: 18px 0 4px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.price strong { font-size: 34px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.price span { color: var(--ink-3); }
.trial { display: inline-block; margin-top: 6px; padding: 3px 10px; border-radius: 999px; background: var(--ok-soft); color: var(--ok); font-size: 13px; font-weight: 600; }
.items { list-style: none; padding: 0; margin: 16px 0 0; border-top: 1px solid var(--line); }
.items li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.items li span:last-child { font-variant-numeric: tabular-nums; white-space: nowrap; }
.items li.total { font-weight: 650; border-bottom: 0; }
.buyer { margin: 18px 0; padding: 12px 14px; background: var(--sunken); border-radius: var(--r); font-size: 14px; }
.buyer div:first-child { font-weight: 600; }
.secure { margin-top: 14px; text-align: center; font-size: 12px; color: var(--ink-3); }
.msg { text-align: center; padding: 28px 24px; }
.msg .icon { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center; background: var(--sunken); font-size: 26px; }
.msg .icon.ok { background: var(--ok-soft); color: var(--ok); }
.msg h1 { font-size: 21px; }
.msg p { color: var(--ink-2); margin: 8px 0 20px; text-wrap: pretty; }

/* ============ painel ============ */
.top { display: flex; align-items: center; gap: 16px; padding: 0 24px; height: 56px; border-bottom: 1px solid var(--line); background: var(--surface); }
.top .logo { font-weight: 700; color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 8px; }
.top .logo i { width: 22px; height: 22px; border-radius: 6px; background: var(--brand); display: inline-block; }
.top form { margin-left: auto; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 28px 24px 60px; }
.head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.head h1 { font-size: 24px; letter-spacing: -0.01em; }
.head .btn:last-child { margin-left: auto; }
.crumb { font-size: 13px; color: var(--ink-3); text-decoration: none; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; margin-bottom: 20px; }
.panel > h2 { font-size: 16px; margin-bottom: 4px; }
.panel > .sub { color: var(--ink-3); font-size: 13px; margin: 0 0 16px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.stack { display: grid; gap: 14px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; font-weight: 600; color: var(--ink-3); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl { overflow-x: auto; }
.empty { padding: 18px 0 4px; color: var(--ink-3); font-size: 14px; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--sunken); color: var(--ink-2); white-space: nowrap; }
.tag.paid, .tag.active, .tag.delivered, .tag.trialing { background: var(--ok-soft); color: var(--ok); }
.tag.failed, .tag.canceled, .tag.unpaid, .tag.incomplete_expired { background: var(--err-soft); color: var(--err); }
.tag.pending, .tag.past_due { background: var(--warn-soft); color: var(--warn); }
.swatch { width: 12px; height: 12px; border-radius: 3px; display: inline-block; vertical-align: -1px; margin-right: 6px; }
.secret { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
.secret code { display: block; padding: 9px 10px; background: var(--sunken); border-radius: 8px; overflow-x: auto; white-space: nowrap; }
.kv { display: grid; grid-template-columns: 170px 1fr; gap: 10px 16px; align-items: center; }
.qr { display: grid; grid-template-columns: 200px 1fr; gap: 20px; align-items: start; }
.qr img { width: 200px; height: 200px; border-radius: 8px; background: #fff; padding: 6px; }
pre.payload { margin: 6px 0 0; padding: 8px 10px; background: var(--sunken); border-radius: 8px; font-size: 12px; max-height: 180px; overflow: auto; }
details summary { cursor: pointer; color: var(--ink-2); font-size: 13px; }
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 16px; }
.auth .panel { width: min(380px, 100%); }
@media (max-width: 640px) {
  .kv, .qr { grid-template-columns: 1fr; }
  .wrap { padding: 20px 16px 48px; }
  .top { padding: 0 16px; }
}
