/* ============ Reset + base ============ */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0e1116;
  --bg-2: #151a22;
  --bg-3: #1c222c;
  --border: #232a35;
  --text: #e7ecf3;
  --text-soft: #a9b3c1;
  --text-dim: #6b7587;
  --accent: #d4b25a;
  --accent-soft: rgba(212, 178, 90, 0.15);
  --success: #2ecc71;
  --shadow: 0 8px 24px rgba(0,0,0,0.35);
  --radius: 12px;
  --sidebar-w: 280px;
}

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

img { max-width: 100%; display: block; }

/* ============ Sidebar ============ */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  padding: 28px 22px 22px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  z-index: 100;
  transition: transform 0.3s ease;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
  padding: 6px 0 10px;
}
.brand-logo-img {
  width: 180px;
  height: auto;
  display: block;
}

.sidebar-subtitle {
  color: var(--text-dim);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 4px 0 28px;
  text-align: center;
}

.topic-group-title {
  color: var(--accent);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 10px;
  padding-left: 6px;
  font-weight: 600;
}

/* Grupo expansível (ex.: Integrações com sub-itens) */
.topic-section {
  margin: 2px 0;
}
.topic-section-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  color: var(--text-soft);
  font-size: 0.95rem;
  cursor: default;
}
.topic-section-items {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-left: 28px;
  margin-bottom: 4px;
  border-left: 1px solid var(--border);
  margin-left: 22px;
}
.topic-sublink {
  padding: 8px 12px !important;
  font-size: 0.9rem !important;
  gap: 10px !important;
}
.topic-sub-dot {
  width: 6px; height: 6px;
  background: var(--text-dim);
  border-radius: 50%;
  flex-shrink: 0;
  transition: background 0.15s;
}
.topic-sublink:hover .topic-sub-dot,
.topic-sublink.active .topic-sub-dot {
  background: var(--accent);
}

.topics {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.topic-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  color: var(--text-soft);
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.topic-link:hover:not(.disabled) {
  background: var(--bg-3);
  color: var(--text);
  text-decoration: none;
}
.topic-link.active {
  background: var(--accent-soft);
  color: var(--accent);
}
.topic-link.disabled {
  color: var(--text-dim);
  cursor: not-allowed;
  font-style: italic;
}

.topic-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  background: var(--bg-3);
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-dim);
  flex-shrink: 0;
}
.topic-link.active .topic-num {
  background: var(--accent);
  color: var(--bg);
}

.sidebar-footer {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-dim);
}

/* ============ Main content ============ */
.content {
  margin-left: var(--sidebar-w);
  padding: 56px clamp(20px, 5vw, 64px) 80px;
  max-width: 980px;
}

.topic-header {
  margin-bottom: 48px;
}
.topic-badge {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  margin-bottom: 14px;
}
.topic-header h1 {
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  line-height: 1.2;
  margin-bottom: 14px;
  font-weight: 700;
}
.topic-intro {
  color: var(--text-soft);
  font-size: 1.05rem;
  max-width: 720px;
}

/* ============ Step ============ */
.step {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px clamp(20px, 4vw, 40px);
  margin-bottom: 28px;
  box-shadow: var(--shadow);
  display: none;
}
.step.is-active { display: block; }

.step-head {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.step-number {
  background: var(--accent);
  color: var(--bg);
  padding: 4px 12px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.85rem;
}
.step-number-sub {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 3px 11px;
}
.step-head h2 {
  font-size: clamp(1.15rem, 2.5vw, 1.4rem);
  font-weight: 600;
  line-height: 1.3;
}

.step-lead {
  color: var(--text-soft);
  font-size: 1rem;
  margin-bottom: 20px;
  padding-left: 14px;
  border-left: 3px solid var(--accent);
}
.step-lead strong { color: var(--text); }

.step-subtitle {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--accent);
  margin: 32px 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.step-instructions ul, .step-instructions ol {
  list-style: disc inside;
  margin-top: 6px;
  margin-left: 4px;
  color: var(--text-dim);
}
.step-instructions ul ul,
.step-instructions ol ol { margin-left: 14px; }
.step-instructions ul li,
.step-instructions ol ol li {
  padding: 4px 0;
  font-size: 0.95rem;
}
.step-instructions ul li::before,
.step-instructions ol ol li::before { content: none; }

.step-image + .step-image { margin-top: 18px; }

code {
  background: var(--bg-3);
  color: var(--accent);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.88em;
  font-family: "SF Mono", Menlo, Consolas, monospace;
}

.step-warn {
  background: rgba(212, 178, 90, 0.08);
  border: 1px solid rgba(212, 178, 90, 0.3);
  border-radius: 8px;
  padding: 14px 18px;
  margin: 24px 0;
  color: var(--text-soft);
  font-size: 0.95rem;
}
.step-warn strong { color: var(--accent); }

.step-instructions {
  list-style: none;
  counter-reset: instruction;
  margin-bottom: 28px;
}
.step-instructions li {
  position: relative;
  padding: 10px 0 10px 38px;
  counter-increment: instruction;
  color: var(--text-soft);
  font-size: 1rem;
}
.step-instructions li::before {
  content: counter(instruction);
  position: absolute;
  left: 0; top: 12px;
  width: 26px; height: 26px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
}
.step-instructions strong {
  color: var(--text);
  font-weight: 600;
}

.step-image {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.step-image img {
  width: 100%;
  height: auto;
}
.step-image figcaption {
  padding: 14px 18px;
  font-size: 0.9rem;
  color: var(--text-dim);
  border-top: 1px solid var(--border);
  background: var(--bg-2);
}
.step-image figcaption strong { color: var(--text-soft); }

/* ============ Topic nav (rodape) ============ */
.topic-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}
.topic-nav-hint {
  color: var(--text-dim);
  font-style: italic;
  font-size: 0.95rem;
}

/* Navegação dentro do passo */
.step-nav {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.step-nav-btn {
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text-soft);
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: 0.15s;
  font-family: inherit;
  max-width: 50%;
}
.step-nav-btn:hover:not(:disabled) {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
  text-decoration: none;
}
.step-nav-btn:disabled,
.step-nav-btn.disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}
.step-nav-btn .nav-label-small {
  display: block;
  font-size: 0.72rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 2px;
}
.step-nav-btn .nav-label-main {
  display: block;
  font-weight: 600;
  color: var(--text);
}
.step-nav-btn:hover .nav-label-main { color: var(--accent); }
.step-nav-next { text-align: right; margin-left: auto; }

.step-nav-hint {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.95rem;
  align-self: center;
  margin-left: auto;
}

/* ============ Menu mobile ============ */
.menu-toggle {
  position: fixed;
  top: 16px; left: 16px;
  z-index: 200;
  width: 44px; height: 44px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}
.menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: 0.2s;
}
.menu-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle.is-open span:nth-child(2) { opacity: 0; }
.menu-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============ Responsive ============ */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: var(--shadow);
  }
  .sidebar.is-open { transform: translateX(0); }

  .content {
    margin-left: 0;
    padding: 80px 20px 60px;
  }
  .menu-toggle { display: flex; }
}

@media (max-width: 600px) {
  .step { padding: 24px 18px; }
  .topic-header h1 { font-size: 1.5rem; }
  .step-head h2 { font-size: 1.1rem; }
  .step-instructions li { padding-left: 34px; font-size: 0.95rem; }
}
