/* Finfort BNPL Engine developer docs — same tokens as the admin dashboard. */
@font-face { font-family: "Proxima Nova"; font-weight: 400; font-display: swap; src: url("fonts/proxima-nova-400.ttf") format("truetype"); }
@font-face { font-family: "Proxima Nova"; font-weight: 600; font-display: swap; src: url("fonts/proxima-nova-600.ttf") format("truetype"); }
@font-face { font-family: "Proxima Nova"; font-weight: 800; font-display: swap; src: url("fonts/proxima-nova-800.ttf") format("truetype"); }
@font-face { font-family: "Plex Mono"; font-weight: 400; font-display: swap; src: url("fonts/plex-mono-400.woff2") format("woff2"); }

:root {
  --bg: #f5f4ef; --surface: #fff; --border: #e6e3da; --line-soft: #efece4;
  --text: #0f1417; --muted: #5b6369; --faint: #8a9298;
  --primary: #0e7f8b; --primary-hover: #0a656f; --wash: #e4f3f4; --brand-red: #d73c26;
  --code-bg: #0b2e38; --code-text: #eaf3f2;
  --good: #1a7f4b; --good-bg: #e9f5ee; --warn: #a5610a; --warn-bg: #fdf4e6; --bad: #c0392b; --bad-bg: #fceeec;
  --mono: "Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { scroll-padding-top: 76px; }
body { margin: 0; font-family: "Proxima Nova", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 16.5px; line-height: 1.65; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
a { color: var(--primary); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--primary); color: #fff; padding: 8px 12px; border-radius: 8px; z-index: 30; }
.skip:focus { left: 8px; }

.top { position: sticky; top: 0; z-index: 20; display: flex; justify-content: space-between; align-items: center; height: 60px; padding: 0 24px; background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: inset 0 3px 0 var(--brand-red); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-size: 17px; }
.brand img { width: 30px; height: 30px; border-radius: 7px; }
.brand b { font-weight: 800; }
.swagger { font-size: 14px; font-weight: 600; text-decoration: none; }

.layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); max-width: 1180px; margin: 0 auto; }
nav { position: sticky; top: 60px; align-self: start; height: calc(100vh - 60px); overflow-y: auto; padding: 24px 16px; border-right: 1px solid var(--border); }
nav a { display: block; padding: 8px 12px; border-radius: 8px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 15px; }
nav a:hover { background: #f0eee7; color: var(--text); }
nav a[aria-current="page"] { background: var(--wash); color: var(--primary); }

main { display: grid; grid-template-columns: minmax(0, 1fr) 190px; gap: 32px; padding: 36px 32px 80px; }
article { min-width: 0; max-width: 760px; }
.toc { position: sticky; top: 84px; align-self: start; font-size: 13.5px; display: flex; flex-direction: column; gap: 6px; }
.toc b { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--faint); margin-bottom: 4px; }
.toc a { color: var(--muted); text-decoration: none; }
.toc a:hover { color: var(--primary); }

h1 { font-size: 36px; line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 16px; font-weight: 800; }
h2 { font-size: 24px; letter-spacing: -0.01em; margin: 44px 0 12px; font-weight: 800; padding-top: 12px; border-top: 1px solid var(--border); }
h3 { font-size: 18px; margin: 28px 0 8px; font-weight: 800; }
h2 .anchor, h3 .anchor { margin-left: 8px; color: var(--faint); text-decoration: none; opacity: 0; font-weight: 400; }
h2:hover .anchor, h3:hover .anchor, .anchor:focus { opacity: 1; }
p, ul, ol { margin: 0 0 16px; }
li { margin-bottom: 4px; }
.lead { font-size: 19px; color: var(--muted); }
strong { font-weight: 800; }
hr { border: 0; border-top: 1px solid var(--border); margin: 32px 0; }
.muted { color: var(--muted); }

code { font-family: var(--mono); font-size: 0.88em; background: #ece9e0; padding: 1px 6px; border-radius: 5px; }
.code { position: relative; margin: 0 0 20px; }
.code pre { margin: 0; padding: 16px 18px; overflow-x: auto; background: var(--code-bg); color: var(--code-text); border-radius: 12px; font-size: 14px; line-height: 1.55; }
.code pre code { background: none; padding: 0; color: inherit; font-size: inherit; }
.copy { position: absolute; top: 8px; right: 8px; font: inherit; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 6px; border: 1px solid rgba(255, 255, 255, 0.25); background: rgba(255, 255, 255, 0.08); color: var(--code-text); cursor: pointer; }
.copy:hover { background: rgba(255, 255, 255, 0.18); }

.table-wrap { overflow-x: auto; margin: 0 0 20px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
th { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--faint); background: #faf9f5; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td code { white-space: nowrap; }

blockquote { margin: 0 0 18px; padding: 12px 16px; border-left: 4px solid var(--primary); background: var(--wash); border-radius: 0 10px 10px 0; color: #0b3d44; }
blockquote p:last-child { margin-bottom: 0; }

/* API reference */
.tag h2 { margin-top: 36px; }
.op { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 10px; }
.op summary { cursor: pointer; padding: 12px 14px; display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; list-style: none; }
.op summary::-webkit-details-marker { display: none; }
.method { font-family: var(--mono); font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 6px; min-width: 62px; text-align: center; color: #fff; }
.method.GET { background: #2563a8; } .method.POST { background: var(--good); } .method.PATCH { background: var(--warn); } .method.DELETE { background: var(--bad); } .method.PUT { background: var(--warn); }
.op .path { font-family: var(--mono); font-size: 14px; font-weight: 600; }
.op .sum { color: var(--muted); font-size: 14.5px; flex-basis: 100%; }
.op .body { padding: 0 14px 14px; border-top: 1px solid var(--line-soft); }
.op h4 { margin: 14px 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--faint); }
.req { color: var(--bad); font-weight: 700; font-size: 12px; margin-left: 6px; }

@media (max-width: 1000px) { main { grid-template-columns: 1fr; } .toc { display: none; } }
@media (max-width: 780px) {
  .layout { display: block; }
  nav { position: static; height: auto; display: flex; gap: 4px; overflow-x: auto; padding: 10px 12px; border-right: 0; border-bottom: 1px solid var(--border); background: var(--surface); }
  nav a { white-space: nowrap; }
  main { padding: 24px 16px 64px; }
  h1 { font-size: 28px; }
}
@media print { .top, nav, .toc, .copy { display: none; } .layout { display: block; } main { padding: 0; } }
