/* Estilos dos blocos usados pelo conteúdo migrado da Wiki. */

/* ===== Wiki / Manual =====
   Os artigos são HTML com um vocabulário pequeno de blocos (wiki-steps,
   wiki-alert, wiki-grid/wiki-card, tabelas). Tudo é desenhado aqui, então um
   artigo novo já nasce no visual certo sem classe extra no texto. */
.wiki-content {
  --wiki-text: #4b5563;
  --wiki-strong: #111827;
  --wiki-muted: #6b7280;
  --wiki-line: #e5e7eb;
  --wiki-surface: #ffffff;
  --wiki-surface-2: #f8fafc;
  --wiki-accent: #2563eb;
  font-size: 0.875rem;
  color: var(--wiki-text);
}
.dark .wiki-content {
  --wiki-text: #a5b4cc;
  --wiki-strong: #e8eefb;
  --wiki-muted: #8193b2;
  --wiki-line: rgba(59, 130, 246, 0.18);
  --wiki-surface: rgba(10, 18, 38, 0.9);
  --wiki-surface-2: #0b1630;
  --wiki-accent: #60a5fa;
}

/* Títulos de seção com faixa de destaque */
.wiki-content h4 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--wiki-strong);
  margin: 2rem 0 0.875rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--wiki-line);
  scroll-margin-top: 1.5rem;
}
.wiki-content h4::before {
  content: '';
  width: 4px;
  height: 1.1em;
  border-radius: 999px;
  background: linear-gradient(180deg, #3b82f6, #8b5cf6);
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.6);
  flex-shrink: 0;
}
.wiki-content h4:first-child { margin-top: 0; }
.wiki-content p {
  font-size: 0.875rem;
  line-height: 1.7;
  margin-bottom: 0.875rem;
}
.wiki-content strong { font-weight: 600; color: var(--wiki-strong); }
.wiki-content em { color: var(--wiki-muted); }
.wiki-content a { color: var(--wiki-accent); text-decoration: underline; text-underline-offset: 2px; }

/* Listas com marcador próprio */
.wiki-content ul, .wiki-content ol {
  font-size: 0.875rem;
  margin: 0 0 1rem;
  padding-left: 0;
  list-style: none;
}
.wiki-content li {
  position: relative;
  padding-left: 1.6rem;
  margin-bottom: 0.45rem;
  line-height: 1.65;
}
.wiki-content ul > li::before {
  content: '';
  position: absolute;
  left: 0.45rem;
  top: 0.6em;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 999px;
  background: var(--wiki-accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
.wiki-content ol { counter-reset: wiki-ol; }
.wiki-content ol > li { counter-increment: wiki-ol; padding-left: 2rem; }
.wiki-content ol > li::before {
  content: counter(wiki-ol);
  position: absolute;
  left: 0;
  top: 0.1em;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
}

/* Código */
.wiki-content code {
  font-size: 0.78rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  padding: 0.1rem 0.4rem;
  border-radius: 0.375rem;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #dbeafe;
}
.dark .wiki-content code { background: rgba(59, 130, 246, 0.12); color: #93c5fd; border-color: rgba(59, 130, 246, 0.25); }
.wiki-content pre {
  position: relative;
  font-size: 0.78rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  padding: 0.9rem 1rem;
  padding-right: 4.5rem;
  border-radius: 0.75rem;
  overflow-x: auto;
  margin-bottom: 1rem;
  white-space: pre-wrap;
  word-break: break-all;
  background: #0b1220;
  color: #86efac;
  border: 1px solid rgba(59, 130, 246, 0.25);
}
.wiki-content pre code { background: none; border: 0; padding: 0; color: inherit; }
.wiki-copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  font-family: inherit;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: 0.5rem;
  color: #e2e8f0;
  background: rgba(59, 130, 246, 0.25);
  border: 1px solid rgba(59, 130, 246, 0.4);
  cursor: pointer;
}
.wiki-copy-btn:hover { background: rgba(59, 130, 246, 0.4); }

/* Tabelas: cabeçalho colorido, linhas alternadas e rolagem no celular */
.wiki-table-wrap {
  overflow-x: auto;
  margin-bottom: 1.25rem;
  border-radius: 0.875rem;
  border: 1px solid var(--wiki-line);
  background: var(--wiki-surface);
}
.dark .wiki-table-wrap { box-shadow: 0 12px 40px -24px rgba(59, 130, 246, 0.5); }
.wiki-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
  margin: 0;
}
.wiki-content th, .wiki-content td {
  padding: 0.65rem 0.9rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--wiki-line);
}
.wiki-content th {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #1e40af;
  background: linear-gradient(180deg, #eff6ff, #e0ecff);
  white-space: nowrap;
}
.dark .wiki-content th { color: #bfdbfe; background: linear-gradient(180deg, rgba(37, 99, 235, 0.28), rgba(37, 99, 235, 0.14)); }
.wiki-content td { color: var(--wiki-text); }
.wiki-content tbody tr:nth-child(even) td { background: var(--wiki-surface-2); }
.wiki-content tbody tr:hover td { background: rgba(59, 130, 246, 0.08); }
.wiki-content tbody tr:last-child td { border-bottom: 0; }
.wiki-content td:first-child { font-weight: 500; color: var(--wiki-strong); }

/* Avisos com ícone */
.wiki-alert {
  position: relative;
  padding: 0.9rem 1rem 0.9rem 3.1rem;
  border-radius: 0.875rem;
  margin-bottom: 1.1rem;
  font-size: 0.8125rem;
  line-height: 1.65;
  border: 1px solid;
}
.wiki-alert::before {
  position: absolute;
  left: 0.85rem;
  top: 0.8rem;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 0.5rem;
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  font-weight: 800;
  color: #fff;
}
.wiki-alert ul { margin-top: 0.5rem; margin-bottom: 0; }
.wiki-alert p:last-child { margin-bottom: 0; }
.wiki-alert-info { background: #eff6ff; border-color: #bfdbfe; color: #1e3a8a; }
.wiki-alert-info::before { content: 'i'; background: #3b82f6; font-family: Georgia, serif; font-style: italic; }
.wiki-alert-warning { background: #fffbeb; border-color: #fde68a; color: #78350f; }
.wiki-alert-warning::before { content: '!'; background: #f59e0b; }
.wiki-alert-success { background: #f0fdf4; border-color: #bbf7d0; color: #14532d; }
.wiki-alert-success::before { content: '✓'; background: #10b981; }
.wiki-alert strong { color: inherit; }
.dark .wiki-alert-info { background: rgba(37, 99, 235, 0.12); border-color: rgba(59, 130, 246, 0.35); color: #bfdbfe; }
.dark .wiki-alert-warning { background: rgba(245, 158, 11, 0.1); border-color: rgba(245, 158, 11, 0.35); color: #fde68a; }
.dark .wiki-alert-success { background: rgba(16, 185, 129, 0.1); border-color: rgba(16, 185, 129, 0.35); color: #a7f3d0; }
.dark .wiki-alert-info::before { box-shadow: 0 0 12px rgba(59, 130, 246, 0.6); }
.dark .wiki-alert-warning::before { box-shadow: 0 0 12px rgba(245, 158, 11, 0.6); }
.dark .wiki-alert-success::before { box-shadow: 0 0 12px rgba(16, 185, 129, 0.6); }
.wiki-alert li, .wiki-alert p { color: inherit; }

/* Cards de resumo */
.wiki-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.wiki-card {
  position: relative;
  overflow: hidden;
  background: var(--wiki-surface);
  border: 1px solid var(--wiki-line);
  border-radius: 0.875rem;
  padding: 1rem;
  text-align: left;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.wiki-card:hover { transform: translateY(-2px); box-shadow: 0 10px 28px -16px rgba(59, 130, 246, 0.55); }
.wiki-card strong { display: block; margin-bottom: 0.25rem; font-size: 0.875rem; }
.wiki-card p { font-size: 0.78rem; margin-bottom: 0; color: var(--wiki-muted); }
.wiki-card-icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.65rem;
  display: grid;
  place-items: center;
  margin-bottom: 0.65rem;
  font-size: 1.1rem;
  color: #fff;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  box-shadow: 0 0 16px rgba(59, 130, 246, 0.35);
}
.wiki-card:nth-child(5n+2) .wiki-card-icon { background: linear-gradient(135deg, #10b981, #0d9488); box-shadow: 0 0 16px rgba(16, 185, 129, 0.35); }
.wiki-card:nth-child(5n+3) .wiki-card-icon { background: linear-gradient(135deg, #f59e0b, #f97316); box-shadow: 0 0 16px rgba(245, 158, 11, 0.35); }
.wiki-card:nth-child(5n+4) .wiki-card-icon { background: linear-gradient(135deg, #8b5cf6, #d946ef); box-shadow: 0 0 16px rgba(139, 92, 246, 0.35); }
.wiki-card:nth-child(5n+5) .wiki-card-icon { background: linear-gradient(135deg, #f43f5e, #ec4899); box-shadow: 0 0 16px rgba(244, 63, 94, 0.35); }
/* O texto antigo do ícone era um "•" provisório: vira uma marca desenhada. */
.wiki-card-icon.is-dot { font-size: 0; }
.wiki-card-icon.is-dot::after {
  content: '';
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 0.2rem;
  background: rgba(255, 255, 255, 0.95);
  transform: rotate(45deg);
}
.wiki-card-success { border-color: rgba(16, 185, 129, 0.45); }
.wiki-card-success .wiki-card-icon { background: linear-gradient(135deg, #10b981, #0d9488); }
.wiki-card-danger { border-color: rgba(244, 63, 94, 0.45); }
.wiki-card-danger .wiki-card-icon { background: linear-gradient(135deg, #f43f5e, #e11d48); }

/* Passo a passo: linha do tempo clicável (o técnico marca o que já fez) */
.wiki-steps { margin-bottom: 1.25rem; }
.wiki-step {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  padding: 0.85rem 1rem;
  margin: 0 0 0.6rem 0;
  border-radius: 0.875rem;
  border: 1px solid var(--wiki-line);
  background: var(--wiki-surface);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
.wiki-step:hover { border-color: rgba(59, 130, 246, 0.5); transform: translateX(2px); }
.wiki-step::after {
  /* conector até o próximo passo */
  content: '';
  position: absolute;
  left: 1.95rem;
  top: 3rem;
  bottom: -0.65rem;
  width: 2px;
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.5), rgba(59, 130, 246, 0.05));
}
.wiki-step:last-child::after, .wiki-step:has(+ :not(.wiki-step))::after { display: none; }
.wiki-step-number {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15), 0 0 14px rgba(59, 130, 246, 0.45);
}
.wiki-step > div { min-width: 0; padding-top: 0.25rem; line-height: 1.6; }
.wiki-step strong { font-size: 0.875rem; display: block; color: var(--wiki-strong); }
.wiki-step p { font-size: 0.8125rem; margin: 0.15rem 0 0; color: var(--wiki-muted); }
.wiki-step.is-done { border-color: rgba(16, 185, 129, 0.45); background: rgba(16, 185, 129, 0.06); }
.wiki-step.is-done .wiki-step-number { background: linear-gradient(135deg, #10b981, #059669); box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15), 0 0 14px rgba(16, 185, 129, 0.45); font-size: 0; }
.wiki-step.is-done .wiki-step-number::after { content: '✓'; font-size: 0.9rem; }
.wiki-step.is-done strong { text-decoration: line-through; text-decoration-color: rgba(16, 185, 129, 0.7); }

@media (prefers-reduced-motion: reduce) {
  .wiki-step, .wiki-card { transition: none; }
  .wiki-step:hover, .wiki-card:hover { transform: none; }
}

/* ===== Wiki Mode Cards (PPPoE RADIUS / API / DHCP) ===== */
.wiki-mode-cards {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1rem;
}
.wiki-mode-card {
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 1.25rem;
  position: relative;
  overflow: hidden;
}
.wiki-mode-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}
.wiki-mode-radius::before { background: linear-gradient(90deg, #3b82f6, #8b5cf6); }
.wiki-mode-api::before { background: linear-gradient(90deg, #f59e0b, #ef4444); }
.wiki-mode-dhcp::before { background: linear-gradient(90deg, #22c55e, #06b6d4); }
.wiki-mode-radius { background: #eff6ff; border-color: #bfdbfe; }
.wiki-mode-api { background: #fffbeb; border-color: #fde68a; }
.wiki-mode-dhcp { background: #f0fdf4; border-color: #bbf7d0; }
.dark .wiki-mode-radius { background: #1e3a5f20; border-color: #3b82f640; }
.dark .wiki-mode-api { background: #78350f15; border-color: #f59e0b40; }
.dark .wiki-mode-dhcp { background: #14532d15; border-color: #22c55e40; }

.wiki-mode-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.wiki-mode-header h4 { margin: 0 !important; font-size: 1rem !important; }
.wiki-mode-icon { font-size: 1.5rem; }
.wiki-mode-badge {
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  background: #3b82f6;
  color: white;
  margin-left: auto;
}
.wiki-mode-badge-alt {
  background: #94a3b8;
}
.wiki-mode-pro { color: #166534 !important; font-size: 0.75rem !important; }
.wiki-mode-con { color: #92400e !important; font-size: 0.75rem !important; }
.dark .wiki-mode-pro { color: #86efac !important; }
.dark .wiki-mode-con { color: #fcd34d !important; }

/* ===== Wiki Flow Diagram ===== */
.wiki-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.75rem;
  background: rgba(0,0,0,0.05);
  border-radius: 0.5rem;
  margin: 0.75rem 0;
  font-size: 0.75rem;
  font-weight: 600;
  flex-wrap: wrap;
}
.wiki-flow span {
  padding: 0.25rem 0.5rem;
  background: white;
  border-radius: 0.375rem;
  border: 1px solid #e5e7eb;
  white-space: nowrap;
}
.dark .wiki-flow { background: rgba(255,255,255,0.05); }
.dark .wiki-flow span { background: #1e293b; border-color: #334155; color: #e2e8f0; }

