/* SemAuth documentation — standalone stylesheet (no Tailwind dependency). */
:root {
  --bg: #ffffff;
  --bg-soft: #f7f8fa;
  --bg-code: #f4f5f7;
  --border: #e5e7eb;
  --text: #1f2933;
  --text-soft: #52606d;
  --muted: #7b8794;
  --brand: #2563eb;
  --brand-soft: #dbeafe;
  --accent: #1d4ed8;
  --note-bg: #eff6ff;
  --note-border: #93c5fd;
  --warn-bg: #fffbeb;
  --warn-border: #fcd34d;
  --tip-bg: #ecfdf5;
  --tip-border: #6ee7b7;
  --sidebar-w: 280px;
  --topbar-h: 56px;
  --maxw: 880px;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
html.dark {
  --bg: #0b0f17;
  --bg-soft: #111827;
  --bg-code: #1e2530;
  --border: #2a3340;
  --text: #e5e9f0;
  --text-soft: #b8c1cf;
  --muted: #8a96a6;
  --brand: #60a5fa;
  --brand-soft: #1e3a8a;
  --accent: #93c5fd;
  --note-bg: #13233f;
  --note-border: #1e40af;
  --warn-bg: #2a2410;
  --warn-border: #92740d;
  --tip-bg: #0f2a20;
  --tip-border: #0f7a52;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* ---- Top bar ---- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.topbar .brand { font-weight: 700; font-size: 1.15rem; color: var(--text); text-decoration: none; letter-spacing: -.01em; }
.topbar .brand span { color: var(--brand); }
.topbar .docs-tag {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); border: 1px solid var(--border); border-radius: 999px;
  padding: 2px 9px;
}
.topbar .spacer { flex: 1; }
.topbar a.toplink { color: var(--text-soft); text-decoration: none; font-size: .9rem; font-weight: 500; }
.topbar a.toplink:hover { color: var(--brand); }
.topbar .menu-btn {
  display: none; background: none; border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); width: 38px; height: 38px; font-size: 1.2rem; cursor: pointer;
}

/* ---- Shell ---- */
.shell { display: flex; align-items: flex-start; max-width: 1320px; margin: 0 auto; }
.sidebar {
  position: sticky;
  top: var(--topbar-h);
  align-self: flex-start;
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  padding: 24px 12px 64px 20px;
  border-right: 1px solid var(--border);
}
.sidebar h4 {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .07em;
  color: var(--muted); margin: 18px 8px 6px;
}
.sidebar a {
  display: block; padding: 6px 10px; border-radius: 8px;
  color: var(--text-soft); text-decoration: none; font-size: .9rem;
}
.sidebar a:hover { background: var(--bg-soft); color: var(--text); }
.sidebar a.active { background: var(--brand-soft); color: var(--accent); font-weight: 600; }

/* ---- Content ---- */
.content {
  flex: 1 1 auto;
  min-width: 0;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 40px 32px 96px;
}
.content h1 { font-size: 2rem; line-height: 1.2; letter-spacing: -.02em; margin: 0 0 .4em; }
.content h2 {
  font-size: 1.4rem; letter-spacing: -.01em; margin: 2.2em 0 .6em;
  padding-bottom: .3em; border-bottom: 1px solid var(--border);
}
.content h3 { font-size: 1.12rem; margin: 1.8em 0 .5em; }
.content h4 { font-size: .98rem; margin: 1.4em 0 .4em; color: var(--text-soft); }
.content p, .content li { color: var(--text-soft); }
.content a { color: var(--brand); text-decoration: none; }
.content a:hover { text-decoration: underline; }
.content strong { color: var(--text); }
.lead { font-size: 1.12rem; color: var(--text-soft); margin-bottom: 1.5em; }
.content ul, .content ol { padding-left: 1.4em; }
.content li { margin: .3em 0; }
.content hr { border: 0; border-top: 1px solid var(--border); margin: 2.5em 0; }

/* code */
code {
  font-family: var(--mono); font-size: .86em;
  background: var(--bg-code); padding: .12em .4em; border-radius: 5px;
  border: 1px solid var(--border);
}
pre {
  background: var(--bg-code); border: 1px solid var(--border); border-radius: 10px;
  padding: 16px 18px; overflow-x: auto; font-size: .85rem; line-height: 1.55;
}
pre code { background: none; border: 0; padding: 0; font-size: inherit; }

/* tables */
.table-wrap { overflow-x: auto; margin: 1.2em 0; }
table { border-collapse: collapse; width: 100%; font-size: .88rem; }
th, td { text-align: left; padding: 9px 12px; border: 1px solid var(--border); vertical-align: top; }
th { background: var(--bg-soft); color: var(--text); font-weight: 600; }
td { color: var(--text-soft); }
td code, th code { font-size: .82em; }

/* callouts */
.callout {
  border: 1px solid var(--border); border-left-width: 4px;
  border-radius: 8px; padding: 12px 16px; margin: 1.3em 0; font-size: .92rem;
}
.callout p { margin: .4em 0; color: var(--text-soft); }
.callout p:first-child { margin-top: 0; }
.callout p:last-child { margin-bottom: 0; }
.callout .label { font-weight: 700; color: var(--text); }
.callout.note { background: var(--note-bg); border-left-color: var(--note-border); }
.callout.warn { background: var(--warn-bg); border-left-color: var(--warn-border); }
.callout.tip  { background: var(--tip-bg);  border-left-color: var(--tip-border); }

/* mermaid */
.mermaid {
  margin: 1.6em 0; text-align: center;
  background: var(--bg-soft); border: 1px solid var(--border); border-radius: 10px;
  padding: 18px; overflow-x: auto;
}
.mermaid:not([data-processed]) { color: transparent; min-height: 40px; }

/* cards on the home page */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; margin: 1.6em 0; }
.card {
  display: block; border: 1px solid var(--border); border-radius: 12px; padding: 18px 20px;
  text-decoration: none; background: var(--bg); transition: border-color .15s, transform .15s;
}
.card:hover { border-color: var(--brand); transform: translateY(-2px); text-decoration: none; }
.card h3 { margin: 0 0 .3em; font-size: 1.02rem; color: var(--text); }
.card p { margin: 0; font-size: .87rem; color: var(--muted); }

/* misc */
.pill { display: inline-block; font-size: .7rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--brand-soft); color: var(--accent); vertical-align: middle; }
.kbd { font-family: var(--mono); font-size: .8em; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; background: var(--bg-soft); }
.pagenav { display: flex; justify-content: space-between; gap: 16px; margin-top: 3em; padding-top: 1.5em; border-top: 1px solid var(--border); }
.pagenav a { font-size: .9rem; }
footer.docfoot { max-width: 1320px; margin: 0 auto; padding: 24px 32px; border-top: 1px solid var(--border); color: var(--muted); font-size: .82rem; }

/* responsive */
.backdrop { display: none; }
@media (max-width: 900px) {
  .topbar .menu-btn { display: inline-flex; align-items: center; justify-content: center; }
  .sidebar {
    position: fixed; top: var(--topbar-h); left: 0; z-index: 25;
    height: calc(100vh - var(--topbar-h)); background: var(--bg);
    transform: translateX(-100%); transition: transform .2s ease; box-shadow: 0 8px 30px rgba(0,0,0,.18);
  }
  body.nav-open .sidebar { transform: translateX(0); }
  body.nav-open .backdrop { display: block; position: fixed; inset: var(--topbar-h) 0 0 0; background: rgba(0,0,0,.4); z-index: 24; }
  .content { padding: 28px 20px 80px; }
}
