:root {
  --bg: #07111f;
  --bg-soft: #0b1729;
  --bg-elevated: rgba(11, 23, 41, 0.92);
  --panel: rgba(10, 21, 39, 0.9);
  --panel-strong: #10233d;
  --line: rgba(148, 163, 184, 0.18);
  --line-strong: rgba(96, 165, 250, 0.42);
  --text: #eef4ff;
  --muted: #9eb0c8;
  --accent: #4da3ff;
  --accent-strong: #2e7de4;
  --success: #2dd4bf;
  --warning: #f59e0b;
  --danger: #f87171;
  --shadow: 0 28px 80px rgba(2, 6, 23, 0.42);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
  direction: ltr;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Inter", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(77, 163, 255, 0.18), transparent 24%),
    radial-gradient(circle at top right, rgba(45, 212, 191, 0.14), transparent 20%),
    linear-gradient(180deg, #07111f 0%, #091627 42%, #040b14 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: linear-gradient(rgba(77, 163, 255, 0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(77, 163, 255, 0.05) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.42), transparent 92%);
  pointer-events: none;
}

body::after {
  content: "";
  position: fixed;
  inset: auto -8% -26% auto;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(77, 163, 255, 0.2), transparent 66%);
  filter: blur(20px);
  animation: drift 10s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(-32px, -18px, 0) scale(1.08); }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes glow {
  from { box-shadow: 0 0 0 rgba(98, 176, 255, 0); }
  to { box-shadow: 0 0 28px rgba(98, 176, 255, 0.18); }
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.auth-layout {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 42px 0;
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 420px);
}

.auth-hero,
.panel,
.sidebar,
.metric,
.list-item,
.endpoint-card,
.table-card,
.kv-card,
.doc-card,
.exam-question-card,
.exam-guard {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.auth-hero,
.panel,
.sidebar,
.content > *,
.metric,
.list-item,
.endpoint-card,
.kv-card,
.doc-card,
.exam-question-card,
.exam-guard {
  animation: fadeUp 0.38s ease both;
}

.auth-hero {
  min-height: 540px;
  padding: 38px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background:
    radial-gradient(circle at top left, rgba(77, 163, 255, 0.14), transparent 28%),
    linear-gradient(135deg, rgba(15, 28, 50, 0.98), rgba(10, 21, 39, 0.98) 60%, rgba(8, 16, 30, 0.98));
}

.auth-hero .eyebrow,
.page-eyebrow,
.metric .label,
.mini-label {
  font-size: 0.75rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
}

.auth-hero h1 {
  margin: 16px 0 14px;
  font-size: clamp(2.6rem, 4vw, 4.8rem);
  line-height: 0.94;
  letter-spacing: -0.05em;
}

.auth-hero p,
.subtle,
.text-muted,
.status,
.empty {
  color: var(--muted);
}

.hero-grid,
.grid,
.metrics,
.table-grid,
.doc-grid,
.exam-question-grid {
  display: grid;
  gap: 16px;
}

.hero-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.hero-card,
.nav-group,
.table-card {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(12, 24, 44, 0.78);
}

.hero-card,
.nav-group {
  padding: 18px;
}

.hero-card strong,
.metric .value,
.kv-card span,
.doc-card h3,
.list-item h3,
.endpoint-card h3,
.page-title,
.panel h2,
.panel h3 {
  color: var(--text);
}

.panel {
  padding: 28px;
}

.form-stack {
  display: grid;
  gap: 14px;
}

label span,
.field-label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.92rem;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  padding: 13px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(4, 12, 24, 0.92);
  color: var(--text);
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

textarea {
  min-height: 130px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(98, 176, 255, 0.7);
  box-shadow: 0 0 0 4px rgba(98, 176, 255, 0.14);
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--line-strong);
}

.actions,
.inline-actions,
.chip-row,
.card-actions,
.top-nav,
.sidebar-nav {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.nav-groups {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.nav-group strong {
  display: block;
  margin-bottom: 12px;
  font-size: 0.95rem;
}

.nav-stack {
  display: grid;
  gap: 10px;
}

.btn,
.nav-link,
.top-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 700;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, opacity 0.18s ease;
}

.btn:hover,
.nav-link:hover,
.top-nav a:hover {
  transform: translateY(-1px);
}

.btn-primary {
  color: #06111d;
  background: linear-gradient(135deg, #8ecbff, var(--accent));
}

.btn-secondary,
.nav-link,
.top-nav a {
  color: var(--text);
  background: rgba(148, 163, 184, 0.08);
  border-color: var(--line);
}

.btn-danger {
  color: #fff;
  background: linear-gradient(135deg, #ef4444, var(--danger));
}

.btn-mint {
  color: #04120e;
  background: linear-gradient(135deg, #6ee7b7, var(--success));
}

.btn.active,
.nav-link.active,
.top-nav a.active {
  border-color: rgba(98, 176, 255, 0.5);
  background: rgba(98, 176, 255, 0.14);
  animation: glow 1.4s ease-in-out infinite alternate;
}

.shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 24px;
  width: min(1320px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 42px;
}

.sidebar {
  padding: 26px;
  background: linear-gradient(180deg, rgba(8, 16, 31, 0.96), rgba(12, 25, 46, 0.98));
}

.sidebar .identity {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.sidebar .identity strong {
  display: block;
  margin-top: 10px;
  font-size: 1.45rem;
}

.sidebar .identity span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
}

.sidebar-nav {
  margin-top: 22px;
  flex-direction: column;
}

.content {
  display: grid;
  gap: 18px;
}

.top-nav,
.page-header,
.panel,
.list-item,
.endpoint-card,
.metric,
.kv-card,
.doc-card,
.exam-question-card,
.exam-guard {
  background: var(--bg-elevated);
}

.top-nav,
.page-header {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.page-title {
  margin: 8px 0 10px;
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  line-height: 1;
  letter-spacing: -0.04em;
}

.page-copy {
  margin: 0;
  color: var(--muted);
  max-width: 720px;
}

.metrics {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.metric {
  padding: 20px;
}

.metric .value {
  margin-top: 12px;
  font-size: 2rem;
  font-weight: 800;
}

.split {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
}

.split-wide {
  align-items: start;
}

.list-item,
.endpoint-card,
.kv-card,
.doc-card,
.exam-question-card,
.exam-guard {
  padding: 18px;
}

.list-item-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.result-box {
  margin: 14px 0 0;
  padding: 14px;
  min-height: 88px;
  overflow: auto;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(4, 10, 20, 0.9);
  color: #cfe5ff;
  white-space: pre-wrap;
  word-break: break-word;
}

.table-simple {
  width: 100%;
  border-collapse: collapse;
}

.table-simple th,
.table-simple td {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.table-simple th {
  color: var(--muted);
  font-weight: 600;
  width: 160px;
}

.table-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.kv-card {
  display: grid;
  gap: 8px;
}

.kv-card span {
  font-size: 1.02rem;
  font-weight: 700;
}

.chip-row {
  margin-top: 14px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(148, 163, 184, 0.08);
}

.chip button {
  border: none;
  background: transparent;
  color: var(--danger);
  font-weight: 700;
}

.wrap-form > * {
  flex: 1 1 180px;
}

.endpoint-grid,
.doc-grid,
.exam-question-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.endpoint-path,
.mono {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

.loader,
.empty {
  padding: 26px;
  border-radius: 18px;
  border: 1px dashed var(--line-strong);
  background: rgba(148, 163, 184, 0.05);
}

.toast-root {
  position: fixed;
  right: 20px;
  bottom: 20px;
  display: grid;
  gap: 10px;
  z-index: 1000;
}

.toast {
  min-width: 240px;
  max-width: 360px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(8, 16, 31, 0.96);
  box-shadow: var(--shadow);
  animation: fadeUp 0.2s ease;
}

.toast.success {
  border-color: rgba(52, 211, 153, 0.35);
}

.toast.error {
  border-color: rgba(248, 113, 113, 0.4);
}

.status {
  min-height: 20px;
}

.doc-page {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 30px 0 42px;
  display: grid;
  gap: 18px;
}

.docs-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.doc-sidebar {
  position: sticky;
  top: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  box-shadow: var(--shadow);
}

.doc-sidebar-links {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.doc-nav-link {
  display: block;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(148, 163, 184, 0.06);
  color: var(--text);
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.doc-nav-link:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
}

.doc-nav-link.active {
  border-color: rgba(98, 176, 255, 0.45);
  background: rgba(98, 176, 255, 0.14);
}

.doc-main {
  display: grid;
  gap: 18px;
}

.doc-section-meta {
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: rgba(148, 163, 184, 0.06);
}

.doc-method-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.doc-method-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 68px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  background: rgba(98, 176, 255, 0.18);
  color: #d9ebff;
}

.doc-card h3,
.doc-card h2,
.doc-card p,
.doc-card pre,
.doc-card ul {
  margin-top: 0;
}

.doc-card pre {
  margin-bottom: 0;
  padding: 14px;
  border-radius: 16px;
  background: rgba(4, 10, 20, 0.9);
  border: 1px solid var(--line);
  overflow: auto;
}

.exam-question-card.active {
  border-color: rgba(98, 176, 255, 0.44);
}

.exam-guard {
  position: sticky;
  top: 18px;
}

.guard-state {
  color: var(--warning);
}

.modal,
.modal-content {
  border: 1px solid var(--line);
  background: var(--bg-elevated);
  color: var(--text);
  box-shadow: var(--shadow);
}

@media (max-width: 1080px) {
  .auth-layout,
  .shell,
  .split,
  .table-grid,
  .docs-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    order: 2;
  }

  .hero-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .auth-layout,
  .shell,
  .doc-page {
    width: min(100% - 20px, 100%);
  }

  .panel,
  .auth-hero,
  .sidebar,
  .top-nav,
  .page-header {
    padding: 18px;
  }

  .page-header,
  .list-item-header {
    flex-direction: column;
  }

  .doc-sidebar {
    position: static;
  }

  .btn,
  .nav-link,
  .top-nav a {
    width: 100%;
  }
}

.preview-banner {
  border: 1px solid rgba(17, 24, 39, 0.14);
  background: linear-gradient(135deg, rgba(224, 242, 254, 0.9), rgba(240, 253, 244, 0.9));
}
