/* NetFilter SDK — modern site theme (no frameworks, offline-friendly) */
:root {
  --bg: #f6f8fc;
  --surface: #ffffff;
  --surface-2: #eef2f9;
  --ink: #0f1b2d;
  --muted: #5b6b82;
  --line: #e3e9f3;
  --brand: #2563eb;
  --brand-2: #7c3aed;
  --brand-ink: #ffffff;
  --ok: #16a34a;
  --warn: #b45309;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 10px 30px rgba(15, 27, 45, .08);
  --shadow-sm: 0 4px 14px rgba(15, 27, 45, .07);
  --header-h: 64px;
  --wrap: 1140px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background:
    radial-gradient(1100px 380px at 85% -60px, rgba(124, 58, 237, .10), transparent 60%),
    radial-gradient(900px 340px at 8% -40px, rgba(37, 99, 235, .12), transparent 60%),
    var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
h1, h2, h3, h4 { line-height: 1.25; letter-spacing: -.02em; margin: 0 0 .6em; }
h1 { font-size: clamp(1.7rem, 2.6vw, 2.4rem); }
h2 { font-size: 1.35rem; margin-top: 1.6em; }
h3 { font-size: 1.1rem; margin-top: 1.5em; }
.prose > :first-child, .card > :first-child { margin-top: 0; }
p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; }

/* layout */
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 22px; }
.page { padding: calc(var(--header-h) + 26px) 22px 30px; max-width: var(--wrap); margin: 0 auto; }

/* ---------- header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: var(--header-h);
  background: rgba(11, 18, 32, .82);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255,255,255,.08);
  color: #eaf0fa;
}
.header-inner { height: var(--header-h); display: flex; align-items: center; gap: 18px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; font-weight: 800; font-size: 1.4rem; letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.site-nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.site-nav a {
  color: #c9d5ea; font-weight: 600; font-size: .92rem;
  padding: 9px 13px; border-radius: 9px; white-space: nowrap;
}
.site-nav a:hover { color: #fff; background: rgba(255,255,255,.08); text-decoration: none; }
.site-nav a.active { color: #fff; background: rgba(255,255,255,.14); }
.nav-cta {
  margin-left: 8px; color: #fff !important;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)) !important;
  box-shadow: 0 6px 16px rgba(37,99,235,.4);
}
.nav-toggle { display: none; margin-left: auto; background: transparent; border: 1px solid rgba(255,255,255,.25); border-radius: 9px; padding: 8px 10px; cursor: pointer; }
.nav-toggle span { display: block; width: 20px; height: 2px; background: #fff; margin: 4px 0; border-radius: 2px; }

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden; color: #fff;
  background: linear-gradient(135deg, #0b1220 0%, #16295e 45%, #4c1d95 100%);
  border-radius: 20px; padding: clamp(28px, 4.5vw, 54px);
  box-shadow: var(--shadow); margin-bottom: 26px;
}
.hero::before, .hero::after {
  content: ""; position: absolute; border-radius: 50%; filter: blur(2px); opacity: .5; pointer-events: none;
}
.hero::before { width: 420px; height: 420px; right: -140px; top: -160px; background: radial-gradient(circle, rgba(124,58,237,.55), transparent 65%); }
.hero::after { width: 340px; height: 340px; right: 120px; bottom: -180px; background: radial-gradient(circle, rgba(37,99,235,.5), transparent 65%); }
.hero > * { position: relative; z-index: 1; }
.hero h1, .hero h2 { color: #fff; margin-top: 0; }
.hero h1 { font-size: clamp(1.8rem, 3.4vw, 2.7rem); max-width: 16em; }
.hero p.lead { color: #cdd9f2; font-size: 1.05rem; max-width: 46em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.hero-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.hero-badges span { font-size: .78rem; font-weight: 600; color: #dbe6ff; background: rgba(255,255,255,.10); border: 1px solid rgba(255,255,255,.16); padding: 5px 11px; border-radius: 999px; }

/* generic page head (inner pages) */
.page-head { margin-bottom: 22px; }
.page-head h1 { margin-bottom: .25em; }
.page-head p { color: var(--muted); margin: 0; }
.crumbs { font-size: .82rem; color: var(--muted); margin-bottom: 10px; }
.crumbs a { color: var(--muted); }

/* ---------- cards / grid ---------- */
.grid { display: grid; gap: 18px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .grid.cols-2, .grid.cols-3 { grid-template-columns: 1fr; } }
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm);
}
.card h3 { margin-top: 0; font-size: 1.12rem; }
.card h3 a { color: var(--ink); }
.card h3 a:hover { color: var(--brand); }
.card p:last-child { margin-bottom: 0; }
.card .meta { color: var(--muted); font-size: .86rem; }
.card.accent { border-top: 4px solid var(--brand); }
.icon { width: 42px; height: 42px; border-radius: 12px; display: inline-grid; place-items: center; font-size: 1.25rem; margin-bottom: 12px; background: var(--surface-2); color: var(--brand); }
.icon svg { width: 22px; height: 22px; display: block; }
.icon-row { display: flex; gap: 8px; margin-bottom: 12px; }
.icon.sm { width: 34px; height: 34px; border-radius: 10px; margin-bottom: 0; }
.icon.sm svg { width: 18px; height: 18px; }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-top .pill, .card-top .icon-row, .card-top .icon { margin-bottom: 0; }
.pill { display: inline-block; font-size: .75rem; font-weight: 700; letter-spacing: .02em; padding: 3px 10px; border-radius: 999px; background: #e8effe; color: #2347b8; margin-bottom: 10px; }
.pill.green { background: #e4f6ea; color: #15803d; }
.pill.violet { background: #efe7fd; color: #6d28d9; }

/* feature list with checks */
.checks { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 8px; }
.checks li { position: relative; padding-left: 30px; }
.checks li::before {
  content: "✓"; position: absolute; left: 0; top: 1px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #e4f6ea; color: #15803d; font-size: .75rem; font-weight: 800;
  display: inline-grid; place-items: center;
}

/* ---------- buttons (also restyle old bootstrap .btn) ---------- */
.btn, button.btn, input[type="submit"].btn, a.btn,
button, input[type="submit"], input[type="button"] {
  display: inline-block; font-family: inherit; font-weight: 700; font-size: .93rem;
  border-radius: 10px; border: 1px solid transparent; cursor: pointer;
  padding: 11px 20px; transition: transform .06s ease, box-shadow .15s ease, background .15s ease;
}
.btn-primary, input[type="submit"], .btn-success, input[type="button"] {
  color: var(--brand-ink) !important;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)) !important;
  border-color: transparent !important;
  box-shadow: 0 8px 20px rgba(37,99,235,.35);
  text-shadow: none !important;
}
.btn-primary:hover, input[type="submit"]:hover, input[type="button"]:hover { filter: brightness(1.07); text-decoration: none; }
.btn-default {
  background: var(--surface); color: var(--ink) !important; border-color: var(--line) !important;
}
.btn-default:hover { border-color: var(--brand) !important; color: var(--brand) !important; text-decoration: none; }
.btn-lg { padding: 13px 26px; font-size: 1rem; }
.btn-sm { padding: 8px 14px; font-size: .85rem; border-radius: 8px; }
.btn-ghost { background: rgba(255,255,255,.12) !important; color: #fff !important; border: 1px solid rgba(255,255,255,.3) !important; box-shadow: none; }
.btn-ghost:hover { background: rgba(255,255,255,.2) !important; }

/* ---------- tables (also restyle bootstrap .table) ---------- */
.table, table {
  width: 100%; border-collapse: collapse; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden;
  font-size: .93rem; margin-bottom: 22px;
}
.table th, table th, .table td, table td { padding: 13px 15px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.table thead th, table thead th { background: var(--surface-2); font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.table tbody tr:last-child td, table tbody tr:last-child td { border-bottom: none; }
.table-striped tbody tr:nth-child(even), table tbody tr:nth-child(even) { background: #f8fafd; }
.table-bordered, .table-hover { border: 1px solid var(--line); }
.selectable { cursor: pointer; }
.selectable:hover { background: #eef4ff !important; }

/* ---------- list groups (changelog, sidebar) ---------- */
.list-group { display: grid; gap: 0; margin-bottom: 14px; padding: 0; }
.list-group + .list-group { margin-top: -6px; }
.list-group-item, p.list-group-item, a.list-group-item {
  background: var(--surface); border: 1px solid var(--line) !important;
  border-radius: var(--radius-sm) !important; padding: 13px 16px; display: block; color: var(--ink);
  text-shadow: none !important; margin: 0;
}
a.list-group-item:hover { border-color: var(--brand) !important; text-decoration: none; background: #f4f7ff; }
.list-group-item.active, a.list-group-item.active {
  background: linear-gradient(135deg, #101c34, #1d3a8a) !important;
  color: #fff !important; font-weight: 800; border-color: transparent !important;
  border-radius: var(--radius-sm) !important;
}
/* flush joint list: no gaps, shared borders, rounding only on outer corners */
.list-group-item + .list-group-item { border-top: 1px solid var(--surface) !important; }
a.list-group-item:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.list-group-item:first-child { border-radius: var(--radius-sm) var(--radius-sm) 0 0 !important; }
.list-group-item:not(:first-child):not(:last-child) { border-radius: 0 !important; }
.list-group-item:last-child { border-radius: 0 0 var(--radius-sm) var(--radius-sm) !important; }
.list-group-item:first-child:last-child { border-radius: var(--radius-sm) !important; }

/* ---------- jumbotron (legacy) -> hero-like ---------- */
.jumbotron {
  background: linear-gradient(135deg, #0b1220 0%, #1a2f6b 50%, #5b21b6 100%) !important;
  color: #eaf0fa !important; border: none !important; border-radius: 20px !important;
  padding: clamp(26px, 4vw, 46px) !important; box-shadow: var(--shadow);
}
.jumbotron h2, .jumbotron h1 { color: #fff !important; }
.jumbotron a { color: #bcd0ff; }
.jumbotron .btn { margin-top: 10px; }

/* ---------- forms ---------- */
form { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm); margin-bottom: 22px; }
form b, form label { font-size: .9rem; }
input[type="text"], input[type="edit"], input[type="email"], textarea, select {
  font-family: inherit; font-size: .93rem; color: var(--ink);
  border: 1px solid var(--line); border-radius: 9px; padding: 10px 13px;
  background: #fbfcfe; width: 100%; max-width: 560px; margin: 6px 0 14px;
}
textarea { max-width: 100%; min-height: 120px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid rgba(37,99,235,.35); border-color: var(--brand); background: #fff; }
select { width: auto; max-width: 100%; }

/* ---------- content helpers ---------- */
.prose { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(22px, 3vw, 36px); box-shadow: var(--shadow-sm); }
.prose ul { padding-left: 22px; }
.prose li { margin-bottom: .45em; }
.notice { border-left: 4px solid var(--brand); background: #eef4ff; border-radius: 0 10px 10px 0; padding: 14px 18px; margin: 18px 0; }
.notice.warn { border-color: var(--warn); background: #fef6e7; }
.two-col { display: grid; grid-template-columns: minmax(0,1fr) 300px; gap: 22px; align-items: start; }
@media (max-width: 960px) { .two-col { grid-template-columns: 1fr; } }
.side-stack { display: grid; gap: 16px; }
.version-tag { font-family: var(--mono); font-size: .8rem; background: var(--surface-2); border: 1px solid var(--line); padding: 2px 9px; border-radius: 999px; }
code { font-family: var(--mono); font-size: .86em; background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }
pre { background: #0f1b2d; color: #dbe6ff; border-radius: 12px; padding: 18px; overflow: auto; font-size: .85rem; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: #0d1526; color: #9fb0ca; margin-top: 34px; }
.site-footer .wrap { padding-top: 30px; padding-bottom: 26px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 24px; }
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer a { color: #c9d5ea; }
.site-footer h4 { color: #fff; font-size: .9rem; margin-bottom: 10px; }
.foot-links { list-style: none; padding: 0; margin: 0; display: grid; gap: 7px; font-size: .9rem; }
.foot-bottom { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; border-top: 1px solid rgba(255,255,255,.08); margin-top: 24px; padding-top: 16px; font-size: .84rem; }

/* legacy footer element */
footer p { color: var(--muted); font-size: .85rem; }

/* ---------- legacy inline-style overrides ---------- */
.table th[style], table th[style] { background: var(--surface-2) !important; }
table td[colspan="2"] { background: var(--surface-2) !important; }
table[style*="500px"] { width: 100% !important; max-width: 680px; }
.text-center { text-align: center; }

/* ---------- responsive nav ---------- */
@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .site-nav {
    display: none; position: absolute; top: var(--header-h); left: 0; right: 0;
    background: #0d1526; flex-direction: column; align-items: stretch;
    padding: 10px 14px 14px; border-bottom: 1px solid rgba(255,255,255,.1); gap: 2px;
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 12px; }
  .nav-cta { margin: 6px 0 0; text-align: center; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
