/* Documentação da API — reaproveita tokens de style.css/account.css.
   Mesma lição do bug de mobile do account.css: qualquer flex column aqui
   usa align-items:stretch, nunca o default flex-start, senão os filhos
   encolhem pro conteúdo em vez de ocupar a largura toda. */

.docs-stage {
  position: relative;
  z-index: 1;
  width: min(1040px, 100%);
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  padding: calc(1rem + env(safe-area-inset-top)) 1.1rem calc(3rem + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1.5rem;
}

.docs-layout {
  display: flex;
  align-items: flex-start;
  gap: 2rem;
}

.docs-toc {
  flex: none;
  width: 200px;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  position: sticky;
  top: 1rem;
}

.docs-toc a {
  padding: 0.5rem 0.7rem;
  border-radius: 10px;
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.85rem;
  transition: background-color 0.15s, color 0.15s;
}

.docs-toc a:hover {
  background: var(--bg-hover);
  color: var(--ink);
}

.docs-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.docs-section {
  scroll-margin-top: 1rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.9rem;
}

.docs-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.2rem);
  font-weight: 600;
  background: linear-gradient(120deg, var(--dawn-hot), var(--dawn) 45%, var(--mist));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.docs-lead {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--ink-soft);
}

.docs-lead a { color: var(--dawn); }

.docs-heading {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--ink);
  padding-top: 0.5rem;
  border-top: 1px solid var(--line);
}

.docs-subheading {
  margin: 0.5rem 0 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
}

.docs-note {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--ink-soft);
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.85rem 1rem;
}

.docs-note code, p code, td code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  color: var(--mist);
  background: rgba(145, 168, 196, 0.12);
  padding: 0.1rem 0.35rem;
  border-radius: 6px;
}

.docs-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg-card);
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.docs-card-label {
  margin: 0;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
}

.docs-inline-code {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--dawn);
  word-break: break-all;
}

.docs-code {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  overflow-x: auto;
  white-space: pre;
}

.docs-endpoint {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--ink);
}

.docs-method {
  flex: none;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
}

.docs-method-post {
  background: rgba(125, 219, 163, 0.16);
  color: var(--ok);
}

.docs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.docs-table th,
.docs-table td {
  text-align: left;
  padding: 0.6rem 0.7rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.docs-table th {
  color: var(--ink-soft);
  font-weight: 500;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.docs-table td:first-child { white-space: nowrap; }

.docs-status {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
}

.docs-status-2xx { background: rgba(125, 219, 163, 0.16); color: var(--ok); }
.docs-status-4xx { background: rgba(244, 167, 167, 0.16); color: #f4a7a7; }
.docs-status-5xx { background: rgba(241, 185, 135, 0.16); color: var(--dawn); }

.docs-try-form {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1rem;
}

.docs-try-form .account-submit { align-self: flex-start; }

.docs-try-result {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.4rem;
}

@media (max-width: 760px) {
  .docs-layout {
    flex-direction: column;
    align-items: stretch;
  }

  .docs-toc {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    position: static;
    gap: 0.3rem;
  }

  .docs-content { width: 100%; }

  .docs-table { display: block; overflow-x: auto; white-space: nowrap; }
}

@media (max-width: 480px) {
  .docs-stage { padding-left: 0.9rem; padding-right: 0.9rem; }
}
