:root {
  --bg: #080b12;
  --bg-2: #0d1220;
  --panel: rgba(20, 26, 40, 0.72);
  --panel-solid: #141a28;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #e8edf7;
  --muted: #8b96ad;
  --accent: #6d8cff;
  --accent-2: #a855f7;
  --ok: #34d399;
  --warn: #fbbf24;
  --danger: #fb7185;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.85);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--text);
  font: 15px/1.6 "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background:
    radial-gradient(1100px 620px at 12% -12%, rgba(109, 140, 255, 0.20), transparent 60%),
    radial-gradient(900px 520px at 92% 4%, rgba(168, 85, 247, 0.16), transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 60%, var(--bg) 100%);
  background-attachment: fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 20%, transparent 75%);
  pointer-events: none;
  z-index: 0;
}

.wrap { max-width: 1120px; width: 100%; margin: 0 auto; padding: 0 20px; position: relative; z-index: 1; min-width: 0; }

a { color: var(--accent); text-decoration: none; transition: color .15s ease; }
a:hover { color: #9db2ff; text-decoration: none; }

code, pre {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", monospace;
  font-size: .88em;
}
code { background: rgba(255,255,255,.06); padding: 2px 6px; border-radius: 6px; border: 1px solid var(--line); overflow-wrap: anywhere; }

/* ---------- top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(8, 11, 18, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 62px; gap: 16px; }
.topbar nav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.topbar nav a { color: var(--muted); font-size: 14px; font-weight: 500; }
.topbar nav a:hover { color: var(--text); }

.logo {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 19px; letter-spacing: -0.02em; color: var(--text);
}
.logo-mark { width: 26px; height: 26px; flex: none; filter: drop-shadow(0 6px 16px -6px rgba(109,140,255,.9)); }
.logo-text span { background: linear-gradient(135deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }

main { padding: 34px 20px 70px; position: relative; z-index: 1; flex: 1 0 auto; width: 100%; min-width: 0; }

h1 { font-size: 26px; letter-spacing: -0.02em; margin: 0 0 20px; }
h2 { font-size: 16px; letter-spacing: -0.01em; margin: 0 0 14px; color: var(--text); }

/* ---------- cards ---------- */

.card {
  background: var(--panel);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
  animation: rise .35s ease both;
}
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.grid > * { min-width: 0; }
@media (max-width: 900px) { .grid { grid-template-columns: 1fr; } }

.auth { max-width: 440px; margin: 42px auto; }

/* ---------- forms ---------- */

label { display: block; margin-bottom: 14px; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
input[type=text], input[type=email], input[type=password] {
  display: block; width: 100%; margin-top: 8px; padding: 11px 13px;
  background: rgba(6, 9, 15, .6);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--text); font-size: 15px;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
input::placeholder { color: #5d6779; }
input:hover { border-color: rgba(255,255,255,.26); }
input:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(6, 9, 15, .8);
  box-shadow: 0 0 0 4px rgba(109, 140, 255, .16);
}

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: linear-gradient(135deg, var(--accent), #7c6bff);
  color: #fff; border: 0; border-radius: var(--radius-sm);
  padding: 11px 18px; font-size: 14px; font-weight: 600; cursor: pointer;
  box-shadow: 0 10px 24px -12px rgba(109, 140, 255, .95);
  transition: transform .12s ease, filter .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.07); box-shadow: 0 14px 28px -12px rgba(109,140,255,1); }
.btn:active { transform: translateY(0); }
.btn.small {
  padding: 7px 13px; font-size: 13px;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--line-strong);
  color: var(--muted); box-shadow: none;
}
.btn.small:hover { background: rgba(255,255,255,.1); color: var(--text); filter: none; }
.btn.small.active { border-color: var(--accent); color: #c3d0ff; background: rgba(109,140,255,.14); }

.link { background: none; border: 0; color: var(--accent); cursor: pointer; font-size: 13px; font-weight: 500; padding: 4px 6px; border-radius: 6px; }
.link:hover { background: rgba(109,140,255,.12); }
.link.danger { color: var(--danger); }
.link.danger:hover { background: rgba(251,113,133,.12); }
.inline { display: inline; }

/* ---------- rows / tables ---------- */

.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.row input { flex: 1; min-width: 190px; margin-top: 0; }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table thead th { color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; }
.table tbody tr { transition: background .12s ease; }
.table tbody tr:hover { background: rgba(255,255,255,.035); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tr.unread td { background: rgba(109,140,255,.08); }
.table tr.unread td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.table .right { text-align: right; white-space: nowrap; }
.table.kv th { width: 170px; text-transform: none; letter-spacing: 0; font-size: 12px; }
.table-wrap { overflow-x: auto; }

/* ---------- badges / alerts ---------- */

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 600;
  background: rgba(255,255,255,.06); border: 1px solid var(--line-strong); color: var(--muted);
}
/* ---------- docs ---------- */

.code {
  background: rgba(4, 7, 13, .75);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  overflow-x: auto;
  max-width: 100%;
  font-size: 12.5px;
  line-height: 1.65;
  color: #cdd6e6;
  white-space: pre;
  margin: 0 0 6px;
}
.badge.ok { color: var(--ok); border-color: rgba(52,211,153,.4); background: rgba(52,211,153,.1); }
.badge.warn { color: var(--warn); border-color: rgba(251,191,36,.4); background: rgba(251,191,36,.1); }
.badge.get { color: #7dd3fc; border-color: rgba(125,211,252,.4); background: rgba(125,211,252,.1); }
.badge.post { color: #c4b5fd; border-color: rgba(196,181,253,.4); background: rgba(196,181,253,.1); }
.badge.delete { color: var(--danger); border-color: rgba(251,113,133,.4); background: rgba(251,113,133,.1); }
.badge.ok::before, .badge.warn::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.alert {
  padding: 13px 15px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 14px;
  border: 1px solid transparent;
}
.alert.error { background: rgba(251,113,133,.1); border-color: rgba(251,113,133,.35); color: #ffb3bf; }
.alert.ok { background: rgba(52,211,153,.1); border-color: rgba(52,211,153,.35); color: #8ee7c4; }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.key { display: block; margin-top: 8px; word-break: break-all; user-select: all; font-size: 13px; }

/* ---------- message body ---------- */

.body { white-space: pre-wrap; word-break: break-word; font-family: inherit; margin: 0; font-size: 14px; line-height: 1.65; }
.body.html { white-space: normal; }
.body.html img { max-width: 100%; border-radius: 8px; }

.footer { position: relative; z-index: 1; border-top: 1px solid var(--line); background: rgba(8, 11, 18, .55); backdrop-filter: blur(10px); margin-top: auto; flex-shrink: 0; }
.footer-inner { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 28px; padding: 40px 0 26px; }
@media (max-width: 860px) { .footer-inner { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-inner { grid-template-columns: 1fr; } }
.footer-col { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.footer-col h4 { margin: 0 0 4px; font-size: 12px; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.footer-col a { color: var(--muted); font-size: 14px; }
.footer-col a:hover { color: var(--text); }
.footer-logo { margin-bottom: 4px; }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 16px 0 26px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }

/* ---------- prose pages ---------- */

.prose h2 { margin-top: 26px; }
.prose h3 { margin-top: 20px; font-size: 15px; }
.prose p, .prose li { color: #c3cbdb; font-size: 14.5px; }
.prose ul { padding-left: 20px; }
.prose a { text-decoration: underline; }
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.contact-box { background: rgba(255,255,255,.03); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px; }
.contact-box h3 { margin: 0 0 6px; font-size: 14px; }
.contact-box p { margin: 0; color: var(--muted); font-size: 13.5px; }
ul { padding-left: 18px; }
li { margin-bottom: 6px; }

/* ---------- auth hero ---------- */

.hero { text-align: center; margin-bottom: 22px; }
.hero h1 { margin-bottom: 6px; }
.hero p { color: var(--muted); margin: 0; }
.pill {
  display: inline-flex; align-items: center; gap: 7px; margin-bottom: 14px;
  padding: 5px 13px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: rgba(109,140,255,.14); border: 1px solid rgba(109,140,255,.32); color: #c3d0ff;
}
.features { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 8px; }
.features li { display: flex; gap: 9px; align-items: flex-start; color: var(--muted); font-size: 13px; margin: 0; min-width: 0; overflow-wrap: anywhere; }
.features li::before { content: "✓"; color: var(--ok); font-weight: 700; }

/* ---------- landing page ---------- */

.landing-hero {
  text-align: center;
  margin-bottom: 30px;
  padding: 26px 10px 10px;
}
.landing-title {
  font-size: clamp(28px, 5.2vw, 46px);
  line-height: 1.12;
  letter-spacing: -0.03em;
  margin: 0 0 16px;
  font-weight: 800;
}
.landing-title .grad {
  background: linear-gradient(120deg, #8ea6ff 0%, #b47bff 55%, #e879f9 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.landing-lead {
  color: var(--muted);
  max-width: 660px;
  margin: 0 auto;
  font-size: 16px;
  line-height: 1.65;
}
.landing-cta { justify-content: center; margin: 24px 0 18px; }
.btn.ghost {
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--line-strong);
  color: var(--text);
  box-shadow: none;
}
.btn.ghost:hover { background: rgba(255, 255, 255, .1); filter: none; }
.landing-badges {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.landing-badges li {
  margin: 0;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--muted);
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--line);
}

.landing-section { padding: 26px; }
.landing-h2 { font-size: 21px; margin-bottom: 8px; letter-spacing: -0.02em; }
.landing-intro { max-width: 720px; margin: 0 0 20px; font-size: 14.5px; }

.feature-grid { gap: 14px; }
.feature {
  background: rgba(255, 255, 255, .025);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  transition: border-color .15s ease, transform .15s ease, background .15s ease;
}
.feature:hover {
  border-color: rgba(109, 140, 255, .4);
  background: rgba(109, 140, 255, .06);
  transform: translateY(-2px);
}
.feature-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  font-size: 17px;
  margin-bottom: 10px;
  background: linear-gradient(135deg, rgba(109, 140, 255, .22), rgba(168, 85, 247, .22));
  border: 1px solid rgba(109, 140, 255, .28);
}
.feature h3 { margin: 0 0 6px; font-size: 14.5px; }
.feature p { margin: 0; line-height: 1.55; }

.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.step {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin: 0;
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .025);
  border: 1px solid var(--line);
  position: relative;
}
.step-num {
  flex: none;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 8px 18px -10px rgba(109, 140, 255, .9);
}
.step-body h3 { margin: 4px 0 5px; font-size: 15px; }
.step-body p { margin: 0; font-size: 14px; line-height: 1.6; }

.faq { display: grid; gap: 10px; }
.faq-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .025);
  padding: 0 16px;
}
.faq-item summary {
  cursor: pointer;
  padding: 14px 0;
  font-weight: 600;
  font-size: 14.5px;
  list-style: none;
  position: relative;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 12px;
  color: var(--accent);
  font-size: 18px;
  font-weight: 400;
}
.faq-item[open] summary::after { content: "\2013"; }
.faq-item p { margin: 0 0 14px; font-size: 14px; line-height: 1.6; }

.landing-cta-card {
  text-align: center;
  background:
    radial-gradient(600px 200px at 50% 0%, rgba(109, 140, 255, .16), transparent 70%),
    var(--panel);
}
.landing-cta-card .landing-intro { margin-left: auto; margin-right: auto; }
.landing-cta-card .row { justify-content: center; margin-bottom: 0; }

@media (max-width: 640px) {
  .landing-section { padding: 20px 16px; }
  .landing-hero { padding-top: 12px; }
  .step { padding: 14px; gap: 12px; }
}
