/* evMax — Estilo para páginas legais (Termos de Uso / Política de Privacidade) */
:root {
  --primary: #10B981;
  --primary-dark: #047857;
  --accent: #34D399;
  --bg: #FAFAFA;
  --surface: #FFFFFF;
  --text: #1F2937;
  --text-secondary: #6B7280;
  --border: #E5E7EB;
  --highlight-bg: #ECFDF5;
  --highlight-border: #10B981;
  --warning-bg: #FFFBEB;
  --warning-border: #F59E0B;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --primary-text: var(--primary-dark);
}

/* Dark mode via classe — padrão sempre light */
html.dark {
  --bg: #111827;
  --surface: #1F2937;
  --text: #F9FAFB;
  --text-secondary: #9CA3AF;
  --border: #374151;
  --highlight-bg: #064E3B;
  --highlight-border: #34D399;
  --warning-bg: #451A03;
  --warning-border: #FBBF24;
  --primary-text: var(--accent);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s, color 0.3s;
}

/* ── Layout ── */
.page-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.header {
  background: var(--primary);
  color: #fff;
  padding: 20px 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.header-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header .logo {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  text-decoration: none;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 8px;
}

.header .logo .logo-wordmark > span {
  font-weight: 400;
  opacity: 0.8;
}

.header-nav a {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 6px;
  transition: background 0.2s;
}

.header-nav a:hover {
  background: rgba(255,255,255,0.15);
  color: #fff;
}

.header-nav a.active {
  background: rgba(255,255,255,0.2);
  color: #fff;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ── Botão de tema ── */
.theme-toggle {
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  cursor: pointer;
  border-radius: 6px;
  padding: 6px 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  margin-left: 4px;
}

.theme-toggle:hover {
  background: rgba(255,255,255,0.25);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

#iconMoon { display: none; }
html.dark #iconSun { display: none; }
html.dark #iconMoon { display: block; }

.content {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 24px 80px;
  flex: 1;
}

/* Justificação do texto */
.page-subtitle,
.section p,
.section li,
.highlight-box,
.warning-box,
.definition {
  text-align: justify;
}

/* ── Tipografia ── */
.page-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-text);
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.page-subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
  line-height: 1.6;
}

.version-badge {
  display: inline-block;
  background: var(--highlight-bg);
  color: var(--primary-text);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  margin-bottom: 16px;
}

/* ── Índice (TOC) ── */
.toc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 40px;
}

.toc-title {
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--primary);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.toc-title svg {
  width: 18px;
  height: 18px;
}

.toc ol {
  list-style: none;
  counter-reset: toc;
}

.toc ol li {
  counter-increment: toc;
  margin-bottom: 8px;
}

.toc ol li a {
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 4px 0;
  border-radius: 4px;
  transition: color 0.2s;
}

.toc ol li a::before {
  content: counter(toc) ".";
  color: var(--primary);
  font-weight: 600;
  min-width: 24px;
}

.toc ol li a:hover {
  color: var(--primary);
}

/* ── Seções ── */
.section {
  margin-bottom: 40px;
}

.section-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--primary);
  display: flex;
  align-items: center;
  gap: 10px;
  scroll-margin-top: 80px;
}

.section-title .section-number {
  background: var(--primary);
  color: #fff;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  flex-shrink: 0;
}

.section p,
.section li {
  margin-bottom: 12px;
  color: var(--text);
}

.section ul, .section ol {
  padding-left: 24px;
  margin-bottom: 16px;
}

.section ol[type="a"] {
  list-style-type: lower-alpha;
}

.subsection-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  margin: 24px 0 12px;
}

/* ── Caixas de destaque ── */
.highlight-box {
  background: var(--highlight-bg);
  border-left: 4px solid var(--highlight-border);
  border-radius: 0 8px 8px 0;
  padding: 16px 20px;
  margin: 16px 0;
  font-size: 0.9rem;
}

.warning-box {
  background: var(--warning-bg);
  border-left: 4px solid var(--warning-border);
  border-radius: 0 8px 8px 0;
  padding: 16px 20px;
  margin: 16px 0;
  font-size: 0.9rem;
}

.highlight-box strong,
.warning-box strong {
  display: block;
  margin-bottom: 4px;
}

/* ── Tabelas ── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 0.9rem;
}

.data-table th {
  background: var(--primary);
  color: #fff;
  text-align: left;
  padding: 12px 16px;
  font-weight: 600;
}

.data-table th:first-child {
  border-radius: 8px 0 0 0;
}

.data-table th:last-child {
  border-radius: 0 8px 0 0;
}

.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.data-table tr:nth-child(even) td {
  background: var(--highlight-bg);
}

/* ── Definições ── */
.definition {
  margin-bottom: 12px;
  padding-left: 16px;
  border-left: 3px solid var(--accent);
}

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

/* ── Links inline no conteúdo ── */
.section a,
.highlight-box a,
.warning-box a,
.toc a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 600;
}

.section a:hover,
.highlight-box a:hover,
.warning-box a:hover {
  color: var(--text);
}

/* ── Link cruzado ── */
.crosslink {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--highlight-bg);
  color: var(--primary-text);
  text-decoration: none;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 8px;
  margin: 24px 0;
  transition: background 0.2s, transform 0.1s;
  font-size: 0.9rem;
}

.crosslink:hover {
  background: var(--primary);
  color: #fff;
  transform: translateY(-1px);
}

.crosslink svg {
  width: 16px;
  height: 16px;
}

/* ── Footer ── */
.footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 24px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.footer a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 600;
}

.footer a:hover {
  color: var(--text);
}

/* ── Responsivo ── */
@media (max-width: 640px) {
  .content { padding: 24px 16px 60px; }
  .page-title { font-size: 1.5rem; }
  .section-title { font-size: 1.1rem; }
  .header { padding: 16px; }
  .header .logo { font-size: 1.25rem; }
  .header-nav a { font-size: 0.8rem; padding: 4px 8px; }
  .toc { padding: 16px; }
  .data-table { font-size: 0.8rem; }
  .data-table th, .data-table td { padding: 8px 10px; }
}

/* ── Acessibilidade ── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

a:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
