/* JetMail API docs — визуально в духе панели */

:root {
  --bg: #0a0a0e;
  --glass: rgba(22, 22, 28, 0.92);
  --glass-card: linear-gradient(145deg, rgba(24, 24, 32, 0.95) 0%, rgba(20, 20, 26, 0.88) 100%);
  --border: rgba(255, 255, 255, 0.06);
  --border-red: rgba(220, 38, 38, 0.25);
  --text: #e5e7eb;
  --muted: #9ca3af;
  --dim: #6b7280;
  --red-300: #fca5a5;
  --red-400: #f87171;
  --red-500: #ef4444;
  --red-900: #7f1d1d;
  --emerald: #34d399;
  --sky: #38bdf8;
  --font: 'DM Sans', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --sidebar-w: 280px;
  --topbar-h: 56px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.bg-orbs {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
}

.orb-1 {
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(185, 28, 28, 0.12) 0%, transparent 65%);
  top: 8%;
  left: 10%;
  animation: drift1 22s ease-in-out infinite;
}

.orb-2 {
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, rgba(127, 29, 29, 0.1) 0%, transparent 60%);
  bottom: 15%;
  right: 5%;
  animation: drift2 18s ease-in-out infinite reverse;
}

@keyframes drift1 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(20px, -16px); }
}

@keyframes drift2 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-24px, 12px); }
}

.load-screen {
  max-width: 320px;
  margin: 30vh auto;
  padding: 2rem;
  text-align: center;
  border-radius: 1rem;
  color: var(--muted);
}

.load-pulse {
  width: 40px;
  height: 40px;
  margin: 0 auto 1rem;
  border-radius: 12px;
  background: linear-gradient(135deg, #dc2626, #7f1d1d);
  animation: pulse 1.2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
}

.layout {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 100vh;
}

/* ─── Sidebar ─── */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  padding: 1.25rem 1rem 2rem;
  background: rgba(14, 14, 18, 0.88);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border-right: 1px solid var(--border);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.2);
  overflow-y: auto;
  z-index: 40;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.35rem 0.5rem 1.25rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(127, 29, 29, 0.45);
  border-radius: 10px;
}

.sidebar-logo .sidebar-mark-svg {
  display: block;
  width: 32px;
  height: 32px;
}

.sidebar-title {
  font-weight: 700;
  font-size: 1.05rem;
  background: linear-gradient(90deg, #fca5a5, #f87171, #ef4444);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.sidebar-badge {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--dim);
  margin-top: 0.15rem;
}

.nav-section {
  margin-top: 1.25rem;
}

.nav-section-title {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--dim);
  padding: 0.35rem 0.5rem;
  margin-bottom: 0.35rem;
}

.nav-link {
  display: block;
  padding: 0.45rem 0.65rem;
  border-radius: 10px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.88rem;
  transition: color 0.2s, background 0.2s;
}

.nav-link:hover {
  color: var(--red-300);
  background: rgba(255, 255, 255, 0.04);
}

.nav-link.active {
  color: var(--red-300);
  background: rgba(220, 38, 38, 0.12);
  border: 1px solid rgba(220, 38, 38, 0.2);
}

.nav-sublink {
  padding-left: 1rem;
  font-size: 0.8rem;
  font-family: var(--mono);
  color: var(--dim);
  word-break: break-all;
}

.nav-sublink:hover {
  color: var(--text);
}

/* ─── Main ─── */
.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  padding: 2rem 2rem 4rem;
  max-width: 920px;
}

.topbar-mobile {
  display: none;
  position: sticky;
  top: 0;
  z-index: 50;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: rgba(14, 14, 18, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  margin: -2rem -2rem 1.5rem -2rem;
}

.menu-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.5rem 0.75rem;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.85rem;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 35;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

.layout.sidebar-open .sidebar-overlay {
  opacity: 1;
  pointer-events: auto;
}

.layout.sidebar-open .sidebar {
  transform: translateX(0);
}

.hero {
  background: var(--glass-card);
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  padding: 1.75rem 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.hero h1 {
  margin: 0 0 0.5rem;
  font-size: 1.75rem;
  font-weight: 700;
  background: linear-gradient(90deg, #fecaca, #f87171, #fb923c);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.hero-meta code {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--red-300);
  background: rgba(0, 0, 0, 0.35);
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.hero-actions {
  margin-top: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: transform 0.15s, box-shadow 0.2s;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: linear-gradient(135deg, #b91c1c, #991b1b);
  color: #fef2f2;
  border: 1px solid rgba(248, 113, 113, 0.35);
  box-shadow: 0 4px 16px rgba(127, 29, 29, 0.35);
}

.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(185, 28, 28, 0.4);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--border-red);
}

.section {
  margin-bottom: 2.75rem;
  scroll-margin-top: 1.5rem;
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(220, 38, 38, 0.15);
}

.section-head h2 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
  color: #f3f4f6;
}

.section-head p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--dim);
}

.prose {
  background: var(--glass-card);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.35rem 1.5rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.prose h3 {
  margin: 1.25rem 0 0.6rem;
  font-size: 0.95rem;
  color: #e5e7eb;
  font-weight: 600;
}

.prose h3:first-child {
  margin-top: 0;
}

.prose h4.doc-category-title {
  margin: 1.1rem 0 0.45rem;
  padding: 0.35rem 0 0.2rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--red-400);
  border-bottom: 1px solid rgba(220, 38, 38, 0.2);
}

.prose h3 + h4.doc-category-title {
  margin-top: 0.65rem;
}

.prose p {
  margin: 0.65rem 0;
}

.prose ul {
  margin: 0.35rem 0 0.85rem;
  padding: 0.5rem 0.65rem 0.65rem 1.35rem;
  list-style: none;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 0.65rem;
}

.prose li {
  margin: 0.4rem 0;
  position: relative;
  padding-left: 0.15rem;
}

.prose li::before {
  content: '';
  position: absolute;
  left: -0.85rem;
  top: 0.55em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(248, 113, 113, 0.65);
}

.prose code {
  font-family: var(--mono);
  font-size: 0.82em;
  color: var(--red-300);
  background: rgba(0, 0, 0, 0.35);
  padding: 0.12rem 0.35rem;
  border-radius: 4px;
}

.prose strong {
  color: #f3f4f6;
  font-weight: 600;
}

/* ─── Endpoint cards ─── */
.endpoint {
  background: var(--glass-card);
  border: 1px solid var(--border);
  border-radius: 1rem;
  margin-bottom: 1rem;
  overflow: hidden;
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s;
}

.endpoint:hover {
  border-color: rgba(220, 38, 38, 0.18);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.22), 0 0 0 1px rgba(220, 38, 38, 0.06);
}

.endpoint-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  width: 100%;
  padding: 1rem 1.25rem;
  background: transparent;
  border: none;
  color: inherit;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.endpoint-head:hover .chev {
  color: var(--red-400);
}

.method {
  font-family: var(--mono);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 0.35rem 0.55rem;
  border-radius: 8px;
  border: 1px solid transparent;
  text-transform: uppercase;
}

.method-get {
  background: rgba(6, 78, 59, 0.45);
  color: var(--emerald);
  border-color: rgba(52, 211, 153, 0.25);
}

.method-post {
  background: rgba(127, 29, 29, 0.45);
  color: var(--red-300);
  border-color: rgba(248, 113, 113, 0.25);
}

.method-put {
  background: rgba(12, 74, 110, 0.45);
  color: var(--sky);
  border-color: rgba(56, 189, 248, 0.25);
}

.method-patch {
  background: rgba(120, 53, 15, 0.45);
  color: #fcd34d;
  border-color: rgba(251, 191, 36, 0.25);
}

.method-delete {
  background: rgba(136, 19, 55, 0.45);
  color: #fda4af;
  border-color: rgba(251, 113, 133, 0.25);
}

.path-line {
  font-family: var(--mono);
  font-size: 0.88rem;
  color: #f3f4f6;
  flex: 1;
  min-width: 0;
  word-break: break-all;
}

.badge-jwt {
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.45rem;
  border-radius: 6px;
  background: rgba(55, 48, 163, 0.35);
  color: #c4b5fd;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.chev {
  color: var(--dim);
  font-size: 0.75rem;
  transition: transform 0.2s, color 0.2s;
}

.endpoint.open .chev {
  transform: rotate(90deg);
}

.endpoint-summary {
  width: 100%;
  padding: 0 1.25rem 0.85rem;
  font-size: 0.85rem;
  color: var(--dim);
  margin-top: -0.35rem;
}

.endpoint-body {
  display: none;
  padding: 0 1.25rem 1.25rem;
  border-top: 1px solid var(--border);
}

.endpoint.open .endpoint-body {
  display: block;
}

.block-title {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--dim);
  margin: 1.15rem 0 0.5rem;
}

.block-title:first-child {
  margin-top: 0.75rem;
}

.param-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.param-table th,
.param-table td {
  padding: 0.55rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.param-table th {
  background: rgba(0, 0, 0, 0.35);
  color: var(--dim);
  font-weight: 600;
}

.param-table tr:last-child td {
  border-bottom: none;
}

.param-table code {
  font-family: var(--mono);
  color: var(--red-300);
  font-size: 0.85em;
}

.req {
  color: var(--red-500);
  font-weight: 700;
  margin-left: 0.15rem;
}

.json-block {
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1.5;
  background: #07070a;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  overflow-x: auto;
  color: #d1d5db;
  margin: 0.35rem 0;
}

.responses {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.resp-badge {
  font-size: 0.75rem;
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  color: var(--muted);
}

.resp-badge.ok {
  background: rgba(6, 78, 59, 0.25);
  color: var(--emerald);
  border-color: rgba(52, 211, 153, 0.2);
}

.schema-block {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(220, 38, 38, 0.12);
  border-radius: 10px;
  padding: 1rem 1.15rem;
  margin-bottom: 1rem;
}

.schema-block h4 {
  margin: 0 0 0.75rem;
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--red-300);
  font-weight: 500;
}

.error-banner {
  background: rgba(127, 29, 29, 0.25);
  border: 1px solid rgba(248, 113, 113, 0.35);
  color: #fecaca;
  padding: 1rem 1.25rem;
  border-radius: 12px;
  margin: 2rem auto;
  max-width: 520px;
}

@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .layout.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-overlay {
    display: block;
  }

  .main {
    margin-left: 0;
    padding: 1.25rem 1rem 3rem;
  }

  .topbar-mobile {
    display: flex;
  }
}
