/* SOFTG API WhatsApp — documentação pública. Claro/escuro por variáveis; segue o sistema e aceita escolha manual. */
:root {
  --bg: #f7f5ff; --surface: #ffffff; --border: #e4e0f5; --text: #1b1535; --muted: #5f5885; --faint: #8f88ae;
  --primary: #7c3aed; --primary-2: #6366f1; --soft: rgba(124, 58, 237, 0.09);
  --code-bg: #15112b; --code-text: #ece9ff; --code-border: #2a2350;
  --sidebar: linear-gradient(180deg, #2a1660 0%, #1d1045 100%); --sidebar-text: #e2dcff;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #0f0d1a; --surface: #1a1530; --border: #2c2547; --text: #f4f3ff; --muted: #a29bc4; --faint: #6f6891;
    --primary: #a855f7; --soft: rgba(168, 85, 247, 0.12); --code-bg: #0b0918; --sidebar: linear-gradient(180deg, #24124f 0%, #120b2c 100%);
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --bg: #0f0d1a; --surface: #1a1530; --border: #2c2547; --text: #f4f3ff; --muted: #a29bc4; --faint: #6f6891;
  --primary: #a855f7; --soft: rgba(168, 85, 247, 0.12); --code-bg: #0b0918; --sidebar: linear-gradient(180deg, #24124f 0%, #120b2c 100%);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 20px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.65 system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif; }
a { color: var(--primary); }
code, pre { font-variant-ligatures: none; }
code { font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; font-size: 0.88em; background: var(--soft); padding: 1px 6px; border-radius: 6px; overflow-wrap: anywhere; }
h1, h2, h3 { line-height: 1.25; letter-spacing: -0.01em; }
h2 { font-size: 26px; margin: 0 0 12px; }
h3 { font-size: 17px; margin: 28px 0 10px; }
h2 code, h3 code { font-size: 0.72em; }

.sidebar { position: fixed; inset: 0 auto 0 0; width: 280px; background: var(--sidebar); color: var(--sidebar-text); padding: 22px 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; z-index: 20; }
.brand { display: flex; flex-direction: column; align-items: center; gap: 4px; text-decoration: none; padding-bottom: 14px; border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
.brand img { height: 38px; }
.brand span { color: #c4b5fd; font-size: 11px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
.nav-search { width: 100%; height: 38px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, 0.15); background: rgba(0, 0, 0, 0.2); color: #fff; padding: 0 12px; font: inherit; font-size: 13px; }
.nav-search::placeholder { color: rgba(226, 220, 255, 0.55); }
#nav { display: flex; flex-direction: column; gap: 2px; }
#nav a { color: var(--sidebar-text); text-decoration: none; padding: 7px 12px; border-radius: 8px; font-size: 14px; font-weight: 500; }
#nav a.sub { padding-left: 26px; font-size: 13px; opacity: 0.85; }
#nav a:hover { background: rgba(255, 255, 255, 0.08); }
#nav a.active { background: linear-gradient(90deg, #a855f7, #6366f1); color: #fff; }
.nav-group { margin: 12px 12px 4px; font-size: 10.5px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(226, 220, 255, 0.5); }
.theme-btn { margin-top: auto; height: 36px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, 0.18); background: transparent; color: var(--sidebar-text); font: inherit; font-size: 13px; cursor: pointer; }

.content { margin-left: 280px; padding: 40px 48px 80px; max-width: 1180px; }
section { padding: 28px 0 36px; border-bottom: 1px solid var(--border); }
section:last-child { border-bottom: 0; }
.hero { border-radius: 20px; padding: 30px 32px; color: #fff; background: linear-gradient(100deg, #7c3aed 0%, #6366f1 60%, #8b5cf6 100%); margin-bottom: 20px; }
.hero h1 { margin: 0 0 8px; font-size: 32px; }
.hero p { margin: 0; opacity: 0.95; max-width: 820px; }
.cards3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.mini { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 4px; }
.mini span { color: var(--muted); font-size: 14px; }

table { width: 100%; border-collapse: separate; border-spacing: 0; margin: 14px 0; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: top; font-size: 14px; }
/* Nome de campo, código HTTP e credencial nunca quebram no meio. */
td:first-child, th:first-child, td:first-child code { white-space: nowrap; overflow-wrap: normal; }
tr:last-child td, tr:last-child th { border-bottom: 0; }
th { background: var(--soft); font-weight: 700; white-space: nowrap; }

.note { background: var(--soft); border-left: 3px solid var(--primary); padding: 10px 14px; border-radius: 0 10px 10px 0; color: var(--muted); }
.steps { padding-left: 22px; display: grid; gap: 8px; }
.cred-box { margin-top: 20px; background: var(--surface); border: 1px dashed var(--primary); border-radius: 14px; padding: 16px 18px; }
.cred-box p { margin: 4px 0 12px; color: var(--muted); font-size: 14px; }
.cred-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cred-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.cred-grid input { height: 40px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg); color: var(--text); padding: 0 12px; font: inherit; font-size: 14px; text-transform: none; }
/* Texto mascarado sem type="password": evita que o navegador preencha a senha salva do usuario. */
.cred-grid input.mascarado { -webkit-text-security: disc; }

.ex, pre.resp, pre.code-static { margin: 12px 0; border-radius: 14px; overflow: hidden; border: 1px solid var(--code-border); background: var(--code-bg); }
.ex .tabs { display: flex; flex-wrap: wrap; gap: 2px; padding: 6px 6px 0; background: #151030; }
.ex .tabs button { border: 0; background: transparent; color: #a29bc4; font: inherit; font-size: 12px; font-weight: 700; padding: 7px 12px; border-radius: 8px 8px 0 0; cursor: pointer; }
.ex .tabs button.active { background: var(--code-bg); color: #fff; }
.ex .tabs .copy { margin-left: auto; color: #d8b4fe; }
.ex pre, pre.resp, pre.code-static { margin: 0; padding: 16px; overflow-x: auto; color: var(--code-text); font: 13px/1.6 ui-monospace, 'Cascadia Code', Consolas, monospace; }
pre.resp, pre.code-static { margin: 12px 0; }
pre.resp { border-left: 3px solid #10b981; }
.ex code, pre code { background: none; padding: 0; color: inherit; font-size: inherit; overflow-wrap: normal; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 999px; background: linear-gradient(90deg, #a855f7, #6366f1); color: #fff; text-decoration: none; font-weight: 700; }
.faq dt { font-weight: 700; margin-top: 14px; }
.faq dd { margin: 4px 0 0; color: var(--muted); }
.foot { margin-top: 40px; color: var(--faint); font-size: 13px; }

.mobile-bar { display: none; }
.icon-btn { width: 38px; height: 38px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, 0.2); background: transparent; color: #fff; font-size: 18px; cursor: pointer; }
@media (max-width: 960px) {
  .mobile-bar { display: flex; position: sticky; top: 0; z-index: 15; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px; background: var(--sidebar); color: #fff; font-weight: 700; }
  .sidebar { transform: translateX(-100%); transition: transform 0.2s; }
  .sidebar.open { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, 0.5); }
  .content { margin-left: 0; padding: 20px 16px 60px; }
  .cards3, .cred-grid { grid-template-columns: 1fr; }
  th, td { padding: 8px 10px; font-size: 13px; }
  .hero { padding: 22px 20px; }
  .hero h1 { font-size: 26px; }
}
@media print {
  .sidebar, .mobile-bar, .cred-box, .ex .tabs { display: none; }
  .content { margin: 0; padding: 0; }
  .ex, pre { border: 1px solid #999; }
}
