/* Public site and partner portal.
   Same palette and typographic scale as the admin panel, so the three surfaces
   read as one product rather than three. */

:root {
  --bg: #f6f6f4;
  --panel: #fff;
  --ink: #1b1b1a;
  --muted: #75736e;
  --line: #e2e0da;
  --ok: #1f7a4d;
  --bad: #b4341f;
  --warn: #9a6b12;
  --accent: #2c4a7c;
  --ink-invert: #f6f6f4;
  --deep: #1c2b45;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

.mono { font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace; font-size: 0.92em; }
.muted { color: var(--muted); }
.small { font-size: 0.88em; }
.error { color: var(--bad); }
.ok { color: var(--ok); }
.nowrap { white-space: nowrap; }
.right { text-align: right; }

/* --- chrome --- */
.topbar {
  display: flex; align-items: center; gap: 24px;
  padding: 14px 24px; background: var(--panel); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.topbar .brand {
  font-weight: 700; text-decoration: none; color: var(--ink);
  letter-spacing: -0.02em; font-size: 1.05rem;
}
.topbar nav { display: flex; gap: 20px; flex-wrap: wrap; }
.topbar nav a { color: var(--muted); text-decoration: none; font-size: 0.94rem; }
.topbar nav a:hover, .topbar nav a.on { color: var(--ink); }
.topbar .who { margin-left: auto; color: var(--muted); font-size: 0.9rem; display: flex; gap: 14px; align-items: center; }

main { max-width: 940px; margin: 0 auto; padding: 32px 24px 80px; }
main.wide { max-width: 1100px; }

footer {
  border-top: 1px solid var(--line); margin-top: 48px;
  padding: 24px; text-align: center; color: var(--muted); font-size: 0.88rem;
}
footer a { color: var(--muted); }

h1 { font-size: 1.9rem; line-height: 1.25; margin: 0 0 10px; letter-spacing: -0.025em; }
h2 { font-size: 1.25rem; margin: 40px 0 12px; letter-spacing: -0.015em; }
h3 { font-size: 1rem; margin: 26px 0 8px; }
.eyebrow {
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.09em;
  color: var(--muted); font-weight: 600; margin: 0 0 8px;
}
.lede { font-size: 1.1rem; color: var(--muted); margin: 0 0 24px; max-width: 62ch; }

/* --- hero --- */
.hero {
  background: var(--deep); color: var(--ink-invert);
  padding: 64px 24px 56px; margin-bottom: 8px;
}
.hero .inner { max-width: 940px; margin: 0 auto; }
.hero h1 { font-size: 2.4rem; max-width: 18ch; }
.hero .lede { color: #bdc6d4; font-size: 1.15rem; max-width: 58ch; }
.hero .cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }

/* --- buttons --- */
.btn {
  display: inline-block; padding: 10px 20px; border-radius: 6px;
  font-weight: 600; font-size: 0.95rem; text-decoration: none; cursor: pointer;
  border: 1px solid var(--line); background: var(--panel); color: var(--ink);
}
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #24406f; border-color: #24406f; }
.btn.ghost { background: transparent; border-color: #4a5c78; color: var(--ink-invert); }
.btn.ghost:hover { border-color: var(--ink-invert); }
.btn.danger { border-color: var(--bad); color: var(--bad); background: #fff; }
.btn.small { padding: 5px 12px; font-size: 0.85rem; }

/* --- cards & grids --- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 20px 22px; margin: 16px 0; }
.card h3 { margin-top: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin: 20px 0; }
.grid .card { margin: 0; }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.steps { counter-reset: step; }
.steps .card::before {
  counter-increment: step; content: counter(step);
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent); color: #fff; font-size: 0.8rem; font-weight: 700;
  margin-bottom: 10px;
}

/* --- stats --- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin: 20px 0; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; }
.stat .n { display: block; font-size: 1.7rem; font-weight: 650; letter-spacing: -0.02em; line-height: 1.2; }
.stat .l { display: block; font-size: 0.8rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.stat.warn { border-color: var(--warn); box-shadow: inset 0 0 0 1px var(--warn); }
.stat.warn .n { color: var(--warn); }

/* --- tables --- */
table { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; font-size: 0.94rem; }
th { text-align: left; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; }
th, td { padding: 10px 13px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:last-child td { border-bottom: none; }
.table-wrap { overflow-x: auto; }

.status { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 0.74rem; font-weight: 600; white-space: nowrap; }
.status.APPROVED, .status.PASS, .status.TOPUP, .status.TRIAL { background: #e2f2e8; color: var(--ok); }
.status.REJECTED, .status.FAIL, .status.CHARGE { background: #fbe6e2; color: var(--bad); }
.status.MANUAL_REVIEW, .status.REVIEW, .status.ADJUSTMENT { background: #fbf0d8; color: var(--warn); }
.status.PENDING, .status.INFO, .status.REFUND { background: #ebeaf3; color: var(--accent); }

.badge { display: inline-block; padding: 1px 7px; border-radius: 4px; font-size: 0.75rem; background: var(--line); color: var(--muted); }
.badge.ok { background: #e2f2e8; color: var(--ok); }
.badge.bad { background: #fbe6e2; color: var(--bad); }

/* --- code --- */
pre {
  background: #1e2430; color: #e4e8ef; border-radius: 8px;
  padding: 16px 18px; overflow-x: auto; font-size: 0.85rem; line-height: 1.55;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  margin: 12px 0;
}
pre .c { color: #8fa3bf; }
code:not(pre code) {
  background: #ecebe6; border-radius: 4px; padding: 1px 5px; font-size: 0.88em;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}
.endpoint { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 28px 0 6px; }
.endpoint .verb { font-weight: 700; font-size: 0.78rem; letter-spacing: 0.05em; padding: 2px 8px; border-radius: 4px; background: var(--accent); color: #fff; }
.endpoint .verb.get { background: var(--ok); }
.endpoint .path { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.98rem; font-weight: 600; }

/* --- forms --- */
label { display: block; margin-bottom: 14px; font-size: 0.88rem; color: var(--muted); }
input, textarea, select {
  display: block; width: 100%; margin-top: 5px; padding: 9px 11px;
  border: 1px solid var(--line); border-radius: 6px; font: inherit;
  color: var(--ink); background: #fff;
}
textarea { resize: vertical; min-height: 90px; }
button { font: inherit; }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
form.inline { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
form.inline label { flex: 1 1 140px; margin-bottom: 0; }

.auth { max-width: 380px; margin: 8vh auto; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 30px; }
.auth h1 { font-size: 1.4rem; margin: 0; }
.auth p.muted { margin: 4px 0 22px; font-size: 0.92rem; }
.auth button { width: 100%; }

.notice { border-radius: 8px; padding: 14px 16px; margin: 16px 0; font-size: 0.94rem; border: 1px solid; }
.notice.ok { background: #e9f4ee; border-color: #b9dcc8; color: #17603b; }
.notice.warn { background: #fdf5e3; border-color: #e8d4a2; color: #7d560d; }
.notice.bad { background: #fceae6; border-color: #eec4ba; color: #922b19; }

/* --- key reveal --- */
.secret {
  background: #1e2430; color: #e4e8ef; border-radius: 6px; padding: 13px 15px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88rem; word-break: break-all; margin: 10px 0;
}

/* --- usage bars --- */
.bars { display: flex; align-items: flex-end; gap: 3px; height: 110px; margin: 18px 0 6px; }
.bars .bar { flex: 1; background: var(--accent); border-radius: 2px 2px 0 0; min-height: 2px; opacity: 0.85; }
.bars .bar.zero { background: var(--line); }
.bars-axis { display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--muted); gap: 12px; }

/* Stacked outcome bar: one column per day, segments in a fixed order so the
   eye can follow a band across the chart. */
.bars .stackbar {
  flex: 1; display: flex; flex-direction: column-reverse;
  border-radius: 2px 2px 0 0; overflow: hidden; min-height: 2px; background: var(--line);
}
.seg.approved { background: var(--ok); }
.seg.review   { background: var(--warn); }
.seg.rejected { background: var(--bad); }
.seg.pending  { background: var(--accent); }
.key {
  display: inline-block; width: 9px; height: 9px; border-radius: 2px;
  margin: 0 3px 0 10px; vertical-align: baseline;
}
.key.approved { background: var(--ok); }
.key.review   { background: var(--warn); }
.key.rejected { background: var(--bad); }

/* --- meter (share-of-total bar inside a table cell) --- */
.meter { background: var(--line); border-radius: 3px; height: 8px; min-width: 80px; overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--accent); border-radius: 3px; }

/* --- documents --- */
.docs { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.docs figure { margin: 0; }
.docs img { width: 100%; border-radius: 6px; border: 1px solid var(--line); background: #fff; display: block; }
.docs figcaption { margin-top: 8px; font-size: 0.9em; }
.docs dl { display: grid; grid-template-columns: minmax(84px, auto) 1fr; gap: 4px 12px; margin: 0; }
.docs dt { color: var(--muted); font-size: 0.85em; }
.docs dd { margin: 0; }

dl { display: grid; grid-template-columns: minmax(90px, auto) 1fr; gap: 5px 14px; margin: 0; }
dt { color: var(--muted); font-size: 0.85em; }
dd { margin: 0; }

/* --- pricing --- */
.price-figure { font-size: 2.6rem; font-weight: 650; letter-spacing: -0.03em; line-height: 1; }
.price-figure small { font-size: 0.95rem; font-weight: 400; color: var(--muted); letter-spacing: 0; }
ul.ticks { list-style: none; padding: 0; margin: 14px 0 0; }
ul.ticks li { padding-left: 22px; position: relative; margin-bottom: 7px; font-size: 0.94rem; }
ul.ticks li::before { content: "✓"; position: absolute; left: 0; color: var(--ok); font-weight: 700; }

@media (max-width: 620px) {
  .hero { padding: 44px 20px 40px; }
  .hero h1 { font-size: 1.8rem; }
  .two { grid-template-columns: 1fr; }
  .topbar { gap: 14px; padding: 12px 16px; }
  .topbar .who { width: 100%; margin-left: 0; }
}
