/* ============================================================
   FortPass Docs · style.css
   Standalone modern dark UI for the developer documentation.
   No external dependencies, no JS framework required.
   ============================================================ */

:root {
  --bg:          #0b0f17;
  --bg-soft:     #11171f;
  --bg-softer:   #0d121b;
  --border:      #1f2733;
  --border-soft: #1a212c;
  --text:        #e6edf3;
  --text-2:      #cfd9e3;
  --text-3:      #8ea0b3;
  --text-4:      #5a6a7d;
  --accent:      #3b82f6;
  --accent-2:    #6366f1;
  --accent-soft: rgba(110, 168, 255, 0.12);
  --ok:          #4ade80;
  --warn:        #fbbf24;
  --bad:         #f87171;
  --mono:        ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --radius:      12px;
  --shadow:      0 10px 40px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); }
body {
  font: 15px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: #7aa6ff; text-decoration: none; transition: color .15s ease; }
a:hover { color: #a5c4ff; }

::selection { background: rgba(99, 102, 241, .35); color: #fff; }

/* ====================== LAYOUT ============================ */
.layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; border-right: 0; border-bottom: 1px solid var(--border); }
  .sidebar__inner { position: static; }
}

.sidebar {
  background: var(--bg-soft);
  border-right: 1px solid var(--border);
  height: 100vh;
  position: sticky;
  top: 0;
}
.sidebar__inner {
  position: sticky;
  top: 0;
  padding: 28px 24px;
  height: 100vh;
  overflow-y: auto;
}
.sidebar__inner::-webkit-scrollbar { width: 8px; }
.sidebar__inner::-webkit-scrollbar-track { background: transparent; }
.sidebar__inner::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.sidebar__inner::-webkit-scrollbar-thumb:hover { background: #2a3441; }

.brand {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 28px;
  text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand__logo {
  width: 38px; height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex; align-items: center; justify-content: center;
  font-size: 19px;
  box-shadow: 0 4px 14px rgba(59,130,246,.35);
  color: #fff;
}
.brand__title { color: var(--text); font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.brand__sub   { color: var(--text-3); font-size: 11.5px; }

.nav-group { margin-bottom: 22px; }
.nav-group__title {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--text-4);
  padding: 0 12px 8px;
}
.nav-group ul { list-style: none; padding: 0; margin: 0; }
.nav-group a {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
  transition: background .12s ease, color .12s ease;
}
.nav-group a:hover { background: var(--bg-softer); color: var(--text); }
.nav-group a.is-active {
  background: var(--accent-soft);
  color: #a5c4ff;
}
.nav-group a .ico { font-size: 16px; opacity: .8; width: 18px; text-align: center; }

/* ====================== MAIN ============================== */
.main {
  padding: 56px 64px 96px;
  max-width: 920px;
}
@media (max-width: 900px) { .main { padding: 32px 24px 64px; } }

.crumbs {
  font-size: 12.5px; color: var(--text-3);
  margin-bottom: 18px;
  text-transform: uppercase; letter-spacing: .06em;
}
.crumbs a { color: var(--text-3); }
.crumbs a:hover { color: var(--text); }

h1, h2, h3, h4 { color: var(--text); }
h1 {
  font-size: 36px; line-height: 1.18;
  font-weight: 800; letter-spacing: -.025em;
  margin: 0 0 14px;
}
.lead {
  font-size: 17px;
  color: var(--text-3);
  margin: 0 0 32px;
  max-width: 70ch;
}
h2 {
  font-size: 24px; line-height: 1.25;
  font-weight: 700; letter-spacing: -.015em;
  margin: 48px 0 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
h2:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
h3 {
  font-size: 18px;
  font-weight: 700; letter-spacing: -.01em;
  margin: 32px 0 10px;
}
h4 {
  font-size: 15px;
  font-weight: 700;
  margin: 22px 0 8px;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: .04em;
}

p { margin: 0 0 14px; color: var(--text-2); max-width: 72ch; }

ul, ol { margin: 0 0 14px; padding-left: 22px; max-width: 72ch; }
li { margin-bottom: 6px; color: var(--text-2); }
li > ul, li > ol { margin-top: 6px; margin-bottom: 6px; }

strong { color: var(--text); font-weight: 600; }
em { color: var(--text-2); }

hr { border: 0; border-top: 1px solid var(--border); margin: 28px 0; }

/* ===================== CODE =============================== */
code {
  font-family: var(--mono);
  font-size: .9em;
  background: var(--bg-softer);
  border: 1px solid var(--border);
  padding: 1px 7px;
  border-radius: 5px;
  color: #c5d2e0;
}
pre {
  background: var(--bg-softer);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 16px 18px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
  margin: 14px 0 22px;
  color: #d6e2f0;
  max-width: 100%;
}
pre code {
  background: transparent;
  border: 0;
  padding: 0;
  color: inherit;
  font-size: inherit;
}
pre::-webkit-scrollbar { height: 8px; }
pre::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* Token-ish coloring without JS: we use spans in the markup */
.tok-k { color: #c084fc; }   /* keyword */
.tok-s { color: #86efac; }   /* string */
.tok-n { color: #fcd34d; }   /* number */
.tok-c { color: var(--text-4); font-style: italic; } /* comment */
.tok-f { color: #7aa6ff; }   /* function */
.tok-t { color: #f9a8d4; }   /* type */

/* ===================== TABLES ============================= */
.table-wrap { overflow-x: auto; margin: 14px 0 22px; }
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 13.5px;
}
th, td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: top;
}
th {
  color: var(--text-3);
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  background: var(--bg-softer);
}
td { color: var(--text-2); }
tr:last-child td { border-bottom: 0; }
tr:hover td { background: rgba(255,255,255,.015); }

td code, th code { font-size: 12px; }

/* ===================== CALLOUTS =========================== */
.callout {
  margin: 18px 0;
  padding: 14px 16px;
  border-radius: var(--radius);
  border-left: 3px solid;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  font-size: 14px;
  color: var(--text-2);
}
.callout > :first-child { margin-top: 0; }
.callout > :last-child  { margin-bottom: 0; }
.callout strong { display: inline-block; margin-right: 6px; }

.callout--info { border-left-color: var(--accent); background: linear-gradient(90deg, rgba(59,130,246,.10), transparent 60%); }
.callout--ok   { border-left-color: var(--ok);     background: linear-gradient(90deg, rgba(74,222,128,.10), transparent 60%); color: #b6f0c5; }
.callout--warn { border-left-color: var(--warn);   background: linear-gradient(90deg, rgba(251,191,36,.10), transparent 60%); color: #fde9b3; }
.callout--bad  { border-left-color: var(--bad);    background: linear-gradient(90deg, rgba(248,113,113,.10), transparent 60%); color: #fcb6b6; }

/* ===================== KBD ================================ */
kbd {
  font-family: var(--mono);
  font-size: 12px;
  background: var(--bg-softer);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text);
}

/* ===================== INDEX HERO ========================= */
.hero {
  padding: 60px 0 12px;
}
.hero h1 {
  background: linear-gradient(135deg, #fff, #a5c4ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin: 28px 0 40px;
}
@media (max-width: 720px) { .cards { grid-template-columns: 1fr; } }

.card {
  display: block;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  text-decoration: none;
  transition: transform .12s ease, border-color .12s ease, background .12s ease;
}
.card:hover {
  text-decoration: none;
  transform: translateY(-2px);
  border-color: rgba(110, 168, 255, .35);
  background: #131a25;
}
.card__ico {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--accent-soft);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  color: #7aa6ff;
  margin-bottom: 14px;
}
.card__title { color: var(--text); font-size: 16px; font-weight: 700; margin: 0 0 4px; }
.card__desc  { color: var(--text-3); font-size: 13.5px; margin: 0; }

/* ===================== ANCHORS ============================ */
h2, h3 {
  scroll-margin-top: 24px;
}
h2 .anchor, h3 .anchor {
  opacity: 0;
  margin-left: 8px;
  font-size: .7em;
  color: var(--text-4);
  text-decoration: none;
  transition: opacity .15s;
}
h2:hover .anchor, h3:hover .anchor { opacity: 1; }

/* ===================== ASCII DIAGRAMS ====================== */
pre.diagram {
  background: var(--bg-soft);
  border-color: var(--border);
  color: var(--text-3);
  font-size: 12px;
  line-height: 1.45;
}

/* ===================== TINY DETAILS ======================== */
.pill {
  display: inline-flex; align-items: center;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--bg-softer);
  color: var(--text-3);
  border: 1px solid var(--border);
}
.pill--ok   { color: var(--ok);   border-color: rgba(74,222,128,.3);   background: rgba(74,222,128,.08); }
.pill--warn { color: var(--warn); border-color: rgba(251,191,36,.3);   background: rgba(251,191,36,.08); }
.pill--bad  { color: var(--bad);  border-color: rgba(248,113,113,.3);  background: rgba(248,113,113,.08); }

/* ===================== FOOTNOTE BANNER ===================== */
.docfoot {
  margin: 64px 0 0;
  padding: 22px 0 0;
  border-top: 1px solid var(--border);
  color: var(--text-4);
  font-size: 12.5px;
  text-align: center;
}
