/* onpostt — estilos compartilhados (dashboard, documentação e demo) */

:root {
  --bg: #070b0f;
  --bg-soft: #0b1219;
  --panel: #0f1720;
  --panel-2: #121d28;
  --border: #1f3140;
  --border-soft: #162531;
  --text: #e6f1f7;
  --muted: #8ba3b5;
  --faint: #5d7284;
  --accent: #34e0a1;
  --accent-2: #4cc9f0;
  --danger: #ff6b6b;
  --warn: #ffc857;
  --ok: #34e0a1;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(900px 500px at 15% -10%, rgba(52, 224, 161, 0.13), transparent 60%),
    radial-gradient(800px 480px at 95% 0%, rgba(76, 201, 240, 0.1), transparent 55%),
    var(--bg);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

[hidden] {
  display: none !important;
}

a {
  color: var(--accent-2);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img,
svg {
  max-width: 100%;
}

h1,
h2,
h3,
h4 {
  line-height: 1.2;
  margin: 0 0 0.6rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

p {
  margin: 0 0 1rem;
}

code,
pre,
.mono {
  font-family: var(--mono);
}

code {
  font-size: 0.9em;
  color: #a8f0d4;
  background: rgba(52, 224, 161, 0.08);
  border: 1px solid rgba(52, 224, 161, 0.16);
  border-radius: 6px;
  padding: 0.08rem 0.34rem;
  overflow-wrap: anywhere;
}

pre {
  margin: 0 0 1rem;
  padding: 1rem 1.1rem;
  overflow: auto;
  background: #060a0e;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: #cfe6f2;
  font-size: 0.86rem;
  line-height: 1.55;
}

pre code {
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

.container {
  width: min(1180px, calc(100% - 2rem));
  margin-inline: auto;
}

.container-narrow {
  width: min(900px, calc(100% - 2rem));
  margin-inline: auto;
}

/* -------------------------------------------------------------------------- */
/* Header                                                                     */
/* -------------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px);
  background: rgba(7, 11, 15, 0.82);
  border-bottom: 1px solid var(--border-soft);
}

.site-header .container {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text);
  font-weight: 750;
  letter-spacing: -0.03em;
  font-size: 1.18rem;
  text-decoration: none;
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: #04120c;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  font-family: var(--mono);
  font-weight: 800;
  font-size: 0.95rem;
}

.brand small {
  color: var(--faint);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
  flex-wrap: wrap;
}

.site-nav a {
  color: var(--muted);
  font-size: 0.9rem;
  padding: 0.45rem 0.7rem;
  border-radius: 8px;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--text);
  background: var(--panel-2);
  text-decoration: none;
}

/* -------------------------------------------------------------------------- */
/* Botões, pills e status                                                     */
/* -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.6rem 1rem;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.btn:hover {
  border-color: #2c4a5e;
  text-decoration: none;
  transform: translateY(-1px);
}

.btn:focus-visible,
.input:focus-visible,
.textarea:focus-visible,
.select:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  color: #04120c;
  background: linear-gradient(135deg, var(--accent), #67f0be);
  border-color: transparent;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #4cebb1, #86f5cd);
}

.btn-ghost {
  background: transparent;
}

.btn-danger {
  color: #2a0707;
  background: linear-gradient(135deg, #ff8b8b, var(--danger));
  border-color: transparent;
}

.btn-small {
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
  border-radius: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.22rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.pill-accent {
  color: #b9ffe3;
  border-color: rgba(52, 224, 161, 0.35);
  background: rgba(52, 224, 161, 0.08);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--faint);
  box-shadow: 0 0 0 3px rgba(93, 114, 132, 0.15);
}

.status-dot.ok {
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(52, 224, 161, 0.16);
}

.status-dot.warn {
  background: var(--warn);
  box-shadow: 0 0 0 3px rgba(255, 200, 87, 0.16);
}

.status-dot.error {
  background: var(--danger);
  box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.16);
}

.muted {
  color: var(--muted);
}

.faint {
  color: var(--faint);
}

.small {
  font-size: 0.84rem;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.divider {
  height: 1px;
  background: var(--border-soft);
  margin: 1.25rem 0;
}

/* -------------------------------------------------------------------------- */
/* Hero e cards                                                               */
/* -------------------------------------------------------------------------- */

.hero {
  padding: 4.2rem 0 2.2rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.7fr);
  gap: 2rem;
  align-items: end;
}

.hero h1 {
  font-size: clamp(2.6rem, 7vw, 4.8rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
  margin-bottom: 1rem;
}

.hero h1 span {
  color: var(--accent);
}

.hero-lead {
  max-width: 56ch;
  color: var(--muted);
  font-size: 1.06rem;
}

.hero-meta {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1.2rem;
}

.hero-side {
  display: grid;
  gap: 0.8rem;
}

.glass {
  background: linear-gradient(180deg, rgba(18, 29, 40, 0.9), rgba(11, 18, 25, 0.9));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.card h3 {
  font-size: 1rem;
  margin-bottom: 0.4rem;
}

.card p:last-child {
  margin-bottom: 0;
}

.grid {
  display: grid;
  gap: 1rem;
}

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

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

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

.section {
  padding: 2.4rem 0;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.section-head h2 {
  font-size: clamp(1.4rem, 3vw, 2rem);
  margin: 0;
}

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

.metric {
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--panel);
}

.metric-label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--faint);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.45rem;
}

.metric-value {
  font-family: var(--mono);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.metric-value.small-value {
  font-size: 1rem;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.metric-hint {
  color: var(--faint);
  font-size: 0.76rem;
  margin-top: 0.25rem;
}

/* -------------------------------------------------------------------------- */
/* Tabelas                                                                    */
/* -------------------------------------------------------------------------- */

.table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: auto;
  background: var(--panel);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th,
td {
  padding: 0.8rem 1rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border-soft);
}

th {
  color: var(--faint);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: rgba(11, 18, 25, 0.6);
  position: sticky;
  top: 0;
}

tr:last-child td {
  border-bottom: 0;
}

td code {
  white-space: nowrap;
}

/* -------------------------------------------------------------------------- */
/* Endpoints                                                                  */
/* -------------------------------------------------------------------------- */

.endpoint {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-soft);
}

.endpoint:last-child {
  border-bottom: 0;
}

.method {
  flex: 0 0 auto;
  min-width: 58px;
  text-align: center;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 0.28rem 0.45rem;
  border-radius: 6px;
  color: #b9ffe3;
  background: rgba(52, 224, 161, 0.1);
  border: 1px solid rgba(52, 224, 161, 0.25);
}

.method.ws {
  color: #c8ecff;
  background: rgba(76, 201, 240, 0.1);
  border-color: rgba(76, 201, 240, 0.28);
}

.endpoint-body {
  min-width: 0;
}

.endpoint-body strong {
  font-family: var(--mono);
  font-size: 0.9rem;
}

.endpoint-body p {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

/* -------------------------------------------------------------------------- */
/* Formulários                                                                */
/* -------------------------------------------------------------------------- */

.input,
.textarea,
.select {
  width: 100%;
  color: var(--text);
  background: #0a1219;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.68rem 0.8rem;
  font: inherit;
  font-size: 0.92rem;
}

.textarea {
  min-height: 96px;
  resize: vertical;
}

.field {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 0.9rem;
}

.field label {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

/* -------------------------------------------------------------------------- */
/* Callouts                                                                   */
/* -------------------------------------------------------------------------- */

.callout {
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent-2);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1rem;
  background: rgba(76, 201, 240, 0.05);
  color: var(--muted);
  font-size: 0.9rem;
  margin: 1rem 0;
}

.callout strong {
  color: var(--text);
}

.callout.warn {
  border-left-color: var(--warn);
  background: rgba(255, 200, 87, 0.05);
}

.callout.danger {
  border-left-color: var(--danger);
  background: rgba(255, 107, 107, 0.05);
}

/* -------------------------------------------------------------------------- */
/* Documentação                                                               */
/* -------------------------------------------------------------------------- */

.doc-hero {
  padding: 3rem 0 1.4rem;
}

.doc-hero h1 {
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  margin-bottom: 0.5rem;
}

.doc-lead {
  max-width: 70ch;
}

.doc-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
  padding-bottom: 4rem;
}

.doc-side {
  position: sticky;
  top: 84px;
  max-height: calc(100vh - 104px);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 0.8rem;
}

.doc-side h2 {
  color: var(--faint);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0.7rem 0.55rem 0.35rem;
}

.doc-side h2:first-child {
  margin-top: 0.2rem;
}

.doc-side a {
  display: block;
  color: var(--muted);
  font-size: 0.84rem;
  padding: 0.34rem 0.55rem;
  border-radius: 7px;
  border-left: 2px solid transparent;
  text-decoration: none;
}

.doc-side a:hover {
  color: var(--text);
  background: var(--panel-2);
  text-decoration: none;
}

.doc-side a.active {
  color: #c9ffe8;
  background: rgba(52, 224, 161, 0.08);
  border-left-color: var(--accent);
}

.doc-main {
  min-width: 0;
}

.doc-section {
  scroll-margin-top: 88px;
  padding: 0 0 2.4rem;
  margin-bottom: 2.4rem;
  border-bottom: 1px solid var(--border-soft);
}

.doc-section:last-child {
  border-bottom: 0;
}

.doc-section h2 {
  font-size: 1.6rem;
  margin-bottom: 0.7rem;
}

.doc-section h3 {
  font-size: 1.12rem;
  margin: 1.5rem 0 0.5rem;
}

.doc-section h4 {
  font-size: 0.98rem;
  margin: 1.1rem 0 0.4rem;
  color: var(--muted);
}

.doc-section ul,
.doc-section ol {
  padding-left: 1.3rem;
  margin: 0 0 1rem;
}

.doc-section li {
  margin-bottom: 0.3rem;
}

.doc-section table {
  margin-bottom: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.doc-section blockquote {
  margin: 1rem 0;
  padding: 0.6rem 0 0.6rem 1rem;
  border-left: 3px solid var(--border);
  color: var(--muted);
}

.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.35rem;
}

.code-head span {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.code-block-wrap {
  position: relative;
  margin-bottom: 1rem;
}

.code-block-wrap pre {
  margin-bottom: 0;
  padding-top: 2.2rem;
}

.copy-btn {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  background: rgba(18, 29, 40, 0.92);
  z-index: 1;
  color: var(--muted);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Diagrama em HTML/CSS puro (sem imagens externas) */
.diagram {
  display: grid;
  gap: 0.6rem;
  justify-items: center;
  padding: 1.4rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(18, 29, 40, 0.8), rgba(8, 13, 18, 0.8));
  margin: 1rem 0 1.4rem;
}

.diagram-row {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: center;
}

.diagram-node {
  min-width: 132px;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-2);
  text-align: center;
  font-size: 0.82rem;
}

.diagram-node strong {
  display: block;
  font-size: 0.86rem;
}

.diagram-node small {
  color: var(--faint);
  font-size: 0.72rem;
}

.diagram-node.accent {
  border-color: rgba(52, 224, 161, 0.38);
  background: rgba(52, 224, 161, 0.07);
}

.diagram-arrow {
  color: var(--faint);
  font-size: 0.9rem;
  font-family: var(--mono);
}

/* -------------------------------------------------------------------------- */
/* Rodapé                                                                     */
/* -------------------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--border-soft);
  padding: 2rem 0;
  color: var(--faint);
  font-size: 0.84rem;
}

.site-footer .container {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
}

.site-footer a {
  color: var(--muted);
}

/* -------------------------------------------------------------------------- */
/* Utilitários                                                                */
/* -------------------------------------------------------------------------- */

.stack {
  display: grid;
  gap: 0.8rem;
}

.row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.spacer {
  flex: 1;
}

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.toast-stack {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  display: grid;
  gap: 0.5rem;
  z-index: 50;
  width: min(360px, calc(100vw - 2rem));
}

.toast {
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  background: var(--panel-2);
  color: var(--text);
  box-shadow: var(--shadow);
  padding: 0.7rem 0.85rem;
  font-size: 0.86rem;
}

.toast.error {
  border-left-color: var(--danger);
}

/* -------------------------------------------------------------------------- */
/* Responsivo                                                                 */
/* -------------------------------------------------------------------------- */

@media (max-width: 960px) {
  .hero-grid,
  .doc-layout {
    grid-template-columns: 1fr;
  }

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

  .doc-side {
    position: static;
    max-height: none;
    display: flex;
    gap: 0.4rem;
    overflow-x: auto;
    padding: 0.6rem;
  }

  .doc-side h2 {
    display: none;
  }

  .doc-side a {
    white-space: nowrap;
    border-left: 0;
    border-bottom: 2px solid transparent;
    padding: 0.3rem 0.55rem;
  }

  .doc-side a.active {
    border-left: 0;
    border-bottom-color: var(--accent);
  }
}

@media (max-width: 760px) {
  .grid-2,
  .grid-3,
  .grid-4,
  .form-row {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 3rem;
  }

  .site-header .container {
    min-height: 58px;
    gap: 0.4rem;
  }

  .brand small {
    display: none;
  }

  .site-nav a {
    padding: 0.35rem 0.5rem;
    font-size: 0.82rem;
  }

  .section {
    padding: 1.7rem 0;
  }

  .metric-value {
    font-size: 1.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
