/* TigerPay developer docs. One stylesheet for every page. */

:root {
  --orange: #E43B07;
  --orange-dark: #B52E04;
  --orange-soft: #FDEBE4;
  --ink: #0D0F14;
  --paper: #F8F6F1;
  --line: #E7E2D8;
  --muted: #555A63;
  --card: #FFFFFF;
  --soft: #F0EDE4;
  --code-bg: #0D0F14;
  --code-line: #272B34;
  --code-text: #ECEAE3;
  --code-muted: #9CA2AD;
  --green: #17693A;
  --green-soft: #E3F2E9;
  --header-h: 60px;
  --side-w: 276px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-padding-top: calc(var(--header-h) + 20px);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; }
a { color: var(--orange-dark); text-underline-offset: 3px; }
a:hover { color: var(--orange); }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; border-radius: 4px; }

/* ---------- Top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 70;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 24px;
  background: rgba(248, 246, 241, 0.94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); min-width: 0; }
.brand img { display: block; height: 24px; width: auto; }
.brand-sub {
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--muted);
  padding-left: 12px;
  border-left: 1px solid var(--line);
  white-space: nowrap;
}
.spacer { flex: 1; }
.pill {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  white-space: nowrap;
}
.toplink { font-size: 14px; font-weight: 600; color: var(--ink); text-decoration: none; white-space: nowrap; }
.toplink:hover { color: var(--orange); }

.menu-btn {
  display: none;
  width: 40px;
  height: 40px;
  margin-left: -8px;
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  position: relative;
  flex: none;
}
.menu-btn span, .menu-btn span::before, .menu-btn span::after {
  content: "";
  position: absolute;
  left: 10px;
  width: 20px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.18s, opacity 0.18s;
}
.menu-btn span { top: 19px; }
.menu-btn span::before { top: -6px; left: 0; }
.menu-btn span::after { top: 6px; left: 0; }
.menu-btn[aria-expanded="true"] span { background: transparent; }
.menu-btn[aria-expanded="true"] span::before { transform: translateY(6px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span::after { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Layout ---------- */

.layout {
  display: grid;
  grid-template-columns: var(--side-w) minmax(0, 1fr);
  max-width: 1480px;
  margin: 0 auto;
}

.sidebar {
  position: sticky;
  top: var(--header-h);
  align-self: start;
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  padding: 28px 16px 40px 24px;
  border-right: 1px solid var(--line);
}

.nav-group { margin-bottom: 26px; }
.nav-title {
  margin: 0 0 8px;
  padding: 0 12px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar a {
  display: block;
  padding: 7px 12px;
  margin: 1px 0;
  border-radius: 8px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  border-left: 3px solid transparent;
}
.sidebar a:hover { background: var(--soft); color: var(--ink); }
.sidebar a[aria-current="page"] {
  background: var(--orange-soft);
  color: var(--orange-dark);
  border-left-color: var(--orange);
}

.content {
  display: grid;
  grid-template-columns: minmax(0, 760px) 190px;
  gap: 56px;
  padding: 44px 40px 90px 56px;
  min-width: 0;
}

article { min-width: 0; }

.toc {
  position: sticky;
  top: calc(var(--header-h) + 28px);
  align-self: start;
  font-size: 13.5px;
  max-height: calc(100vh - var(--header-h) - 60px);
  overflow-y: auto;
}
.toc-title { font-size: 11px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc a { display: block; padding: 4px 0 4px 14px; margin-left: -1px; border-left: 2px solid transparent; color: var(--muted); text-decoration: none; font-weight: 500; line-height: 1.4; }
.toc a:hover { color: var(--ink); }
.toc a.active { color: var(--orange-dark); border-left-color: var(--orange); font-weight: 700; }

/* ---------- Text ---------- */

.eyebrow { margin: 0 0 8px; font-size: 12px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--orange-dark); }
h1 { margin: 0 0 14px; font-size: 40px; line-height: 1.15; letter-spacing: -0.02em; font-weight: 800; }
.lead { margin: 0 0 26px; font-size: 19px; line-height: 1.6; color: #2b2f37; }
h2 { margin: 52px 0 14px; font-size: 26px; line-height: 1.25; letter-spacing: -0.015em; font-weight: 800; padding-top: 6px; }
h3 { margin: 34px 0 10px; font-size: 19px; line-height: 1.35; font-weight: 700; }
h4 { margin: 24px 0 8px; font-size: 15px; font-weight: 800; }
p { margin: 0 0 16px; }
ul, ol { margin: 0 0 18px; padding-left: 24px; }
li { margin: 0 0 6px; }
li > ul, li > ol { margin: 6px 0 0; }
strong { font-weight: 700; }
hr { border: 0; border-top: 1px solid var(--line); margin: 40px 0; }

.anchor { margin-left: 8px; color: var(--line); text-decoration: none; font-weight: 600; opacity: 0; }
h2:hover .anchor, h3:hover .anchor, .anchor:focus { opacity: 1; color: var(--orange); }

code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--soft);
  border: 1px solid var(--line);
  padding: 1px 6px;
  border-radius: 6px;
  overflow-wrap: anywhere;
}

/* ---------- Code blocks ---------- */

.codebox { position: relative; margin: 0 0 22px; border-radius: 12px; background: var(--code-bg); color: var(--code-text); overflow: hidden; }
.codebox-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 8px 7px 16px;
  border-bottom: 1px solid var(--code-line);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--code-muted);
  text-transform: uppercase;
}
.copy-btn {
  font: inherit;
  font-size: 12px;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--code-text);
  background: #1C2028;
  border: 1px solid var(--code-line);
  border-radius: 7px;
  padding: 4px 12px;
  cursor: pointer;
}
.copy-btn:hover { background: #262B35; }
.copy-btn.done { background: var(--green); border-color: var(--green); color: #fff; }

pre {
  margin: 0;
  padding: 16px 18px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--code-text);
  tab-size: 2;
}
pre code { font: inherit; background: none; border: 0; padding: 0; color: inherit; overflow-wrap: normal; }
/* a pre that JS has not wrapped yet (no JS) still looks like a block */
article > pre, .tab-panel > pre { background: var(--code-bg); border-radius: 12px; margin-bottom: 22px; }
.codebox pre { border-radius: 0; margin: 0; }
.codebox > pre { background: transparent; }

/* tabs */
.tabs { margin: 0 0 22px; }
.tab-list { display: flex; gap: 4px; padding: 6px 6px 0; background: var(--code-bg); border-radius: 12px 12px 0 0; overflow-x: auto; }
.tab-btn {
  font: inherit; font-size: 13px; font-weight: 700;
  color: var(--code-muted);
  background: transparent; border: 0;
  padding: 8px 16px;
  border-radius: 8px 8px 0 0;
  cursor: pointer;
}
.tab-btn:hover { color: var(--code-text); }
.tab-btn[aria-selected="true"] { color: #fff; background: #1C2028; box-shadow: inset 0 -2px 0 var(--orange); }
.tabs .codebox { border-radius: 0 0 12px 12px; margin: 0; }
.tabs .codebox-bar { display: none; }
.tabs .codebox .copy-float { position: absolute; top: 8px; right: 8px; }
html.js .tab-panel[hidden] { display: none; }
html:not(.js) .tab-panel::before {
  content: attr(data-label);
  display: block;
  font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted); margin-bottom: 6px;
}

/* ---------- Tables ---------- */

.table-wrap { margin: 0 0 24px; overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
table { width: 100%; min-width: 480px; border-collapse: collapse; font-size: 14.5px; line-height: 1.55; }
table.fields, table.compact { min-width: 0; }
table.wide { min-width: 680px; }
table.errs td:first-child { width: 42%; }
table.errs td:first-child code { white-space: normal; }
table:not(.fields) td:first-child code { white-space: nowrap; overflow-wrap: normal; }
th, td { text-align: left; vertical-align: top; padding: 11px 14px; border-bottom: 1px solid var(--line); }
th { font-size: 11.5px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); background: var(--soft); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td code { white-space: normal; }
table.fields td:first-child { width: 36%; min-width: 150px; }
table.compact td, table.compact th { padding: 9px 12px; }
.nowrap { white-space: nowrap; }

.type { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.tag {
  display: inline-block;
  font-size: 10.5px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 1px 7px; border-radius: 5px; vertical-align: 1px;
  background: var(--soft); color: var(--muted);
}
.tag.req { background: var(--orange-soft); color: var(--orange-dark); }
.tag.ok { background: var(--green-soft); color: var(--green); }

/* ---------- Endpoint headers ---------- */

.endpoint {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin: 0 0 18px; padding: 12px 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
}
.method { font-family: var(--mono); font-size: 12.5px; font-weight: 800; padding: 3px 9px; border-radius: 6px; color: #fff; background: var(--ink); }
.method.post { background: var(--orange); }
.path { font-family: var(--mono); font-size: 14px; font-weight: 600; overflow-wrap: anywhere; min-width: 0; }

/* ---------- Callouts, cards, steps ---------- */

.callout {
  margin: 0 0 22px; padding: 14px 18px;
  border-radius: 12px; border: 1px solid var(--line); border-left: 4px solid var(--ink);
  background: var(--card); font-size: 15px;
}
.callout > :last-child { margin-bottom: 0; }
.callout .callout-title { font-weight: 800; margin: 0 0 4px; }
.callout.warn { border-left-color: var(--orange); background: #FFF6F2; }
.callout.tip { border-left-color: var(--green); background: #F2FAF5; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin: 0 0 24px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.card .card-title { display: block; margin: 0 0 6px; font-size: 16px; font-weight: 800; line-height: 1.35; }
.card p { margin: 0; font-size: 14.5px; color: var(--muted); }
a.card { text-decoration: none; color: var(--ink); display: block; }
a.card:hover { border-color: var(--orange); }
a.card .card-title { color: var(--orange-dark); }

.flow { list-style: none; margin: 0 0 26px; padding: 0; counter-reset: flow; display: grid; gap: 12px; }
.flow li {
  counter-increment: flow;
  position: relative;
  margin: 0;
  padding: 16px 18px 16px 62px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
}
.flow li::before {
  content: counter(flow);
  position: absolute; left: 16px; top: 16px;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--orange); color: #fff;
  display: grid; place-items: center;
  font-weight: 800; font-size: 14px;
}
.flow .who { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--orange-dark); margin-bottom: 2px; }
.flow p { margin: 0; font-size: 15px; }
.flow p + p { margin-top: 6px; }

.big-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin: 0 0 24px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 20px; }
.stat .num { font-size: 34px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; color: var(--ink); }
.stat .lbl { margin-top: 6px; font-size: 14.5px; color: var(--muted); }

/* ---------- Pager and footer ---------- */

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 64px; }
.pager a {
  display: block; padding: 14px 18px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  text-decoration: none; color: var(--ink); font-weight: 700;
}
.pager a:hover { border-color: var(--orange); }
.pager small { display: block; font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.pager .next { text-align: right; grid-column: 2; }
.pager .prev { grid-column: 1; }

.footer { margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--muted); }

.scrim { display: none; }

/* ---------- Responsive ---------- */

@media (max-width: 1260px) {
  .content { grid-template-columns: minmax(0, 760px); padding-right: 40px; }
  .toc { display: none; }
}

@media (max-width: 960px) {
  :root { --header-h: 56px; }
  .topbar { padding: 0 16px; gap: 10px; }
  .menu-btn { display: block; }
  .toplink { display: none; }
  .brand-sub { display: none; }

  .layout { display: block; }
  .content { display: block; padding: 28px 16px 70px; }

  /* Without JS the nav simply sits above the page. With JS it becomes a drawer. */
  .sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 16px; }
  html.js .sidebar {
    position: fixed;
    z-index: 60;
    top: 0; bottom: 0; left: 0;
    width: min(86vw, 320px);
    height: 100%;
    padding: calc(var(--header-h) + 18px) 14px 40px;
    background: var(--paper);
    border-right: 1px solid var(--line);
    box-shadow: 8px 0 30px rgba(13, 15, 20, 0.16);
    transform: translateX(-102%);
    visibility: hidden;
    transition: transform 0.22s ease, visibility 0.22s;
  }
  html.js body.nav-open .sidebar { transform: none; visibility: visible; }
  html.js body.nav-open .scrim {
    display: block;
    position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 50;
    background: rgba(13, 15, 20, 0.45);
  }
  body.nav-open { overflow: hidden; }

  h1 { font-size: 32px; }
  .lead { font-size: 17.5px; }
  h2 { font-size: 23px; margin-top: 44px; }
  .anchor { display: none; }
}

@media (max-width: 520px) {
  body { font-size: 15.5px; }
  h1 { font-size: 28px; }
  .pill { display: none; }
  .brand img { height: 22px; }
  pre { font-size: 12.5px; padding: 14px; }
  th, td { padding: 9px 10px; }
  table { font-size: 13.5px; }
  .pager { grid-template-columns: 1fr; }
  .pager .next, .pager .prev { grid-column: 1; text-align: left; }
  .flow li { padding-left: 56px; }
  .flow li::before { left: 14px; }
  .stat .num { font-size: 28px; }
  .endpoint { padding: 10px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Pay button demo (pay-button.html) ---------- */

.button-demo { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin: 0 0 26px; }
.button-demo figure { margin: 0; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--card); }
.button-demo .stage { display: grid; place-items: center; min-height: 150px; padding: 28px 16px; }
.button-demo .stage.on-dark { background: #F1EEE6; }
.button-demo figcaption { padding: 10px 16px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.button-demo figcaption code { white-space: nowrap; }
