/* ============================================================
   ViralScript AI — Estilo compartilhado das páginas de conteúdo
   v4: máscara de continuação CONDICIONAL (.rolavel via JS — o fade
   de 18px na direita não é mais aplicado quando a tabela cabe
   inteira) + 100dvh + safe-area no rodapé + alvos de toque ≥44px
   ============================================================ */

:root {
  --bg: #05070f;
  --card-bg: rgba(15, 23, 42, 0.65);
  --card-border: rgba(255, 255, 255, 0.08);
  --input-bg: rgba(10, 15, 29, 0.8);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #d946ef 100%);
  --accent: #6366f1;
  --accent-glow: rgba(99, 102, 241, 0.4);
  --success: #10b981;
}

/* -webkit-tap-highlight-color: transparent — remove o retângulo cinza
   que o Chrome/Android pinta ao tocar em links/botões (artefato fora do
   design system; mesmo padrão do index.html) */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  background-image:
    radial-gradient(circle at 15% 15%, rgba(99, 102, 241, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(217, 70, 239, 0.08) 0%, transparent 40%);
  background-attachment: fixed;
  color: var(--text-main);
  margin: 0;
  padding: 36px 20px;
  line-height: 1.7;
  min-height: 100vh;
  min-height: 100dvh;
}

.container { max-width: 900px; margin: 0 auto; }

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--card-border);
}

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }

.brand-icon {
  width: 42px; height: 42px;
  background: var(--accent-gradient);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 20px var(--accent-glow);
  flex-shrink: 0;
}

.brand-icon svg { width: 22px; height: 22px; color: #ffffff; display: block; }
.brand-icon img { width: 32px; height: 32px; display: block; }

.brand h1 {
  margin: 0; font-size: 1.4rem; font-weight: 800;
  letter-spacing: -0.5px; color: #ffffff;
}

.brand h1 span {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-topo { display: flex; gap: 4px; flex-wrap: wrap; }

.nav-topo a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 12px 16px;
  border-radius: 30px;
  transition: all 0.2s ease;
}

.nav-topo a:hover { color: #ffffff; background: rgba(99, 102, 241, 0.15); }
.nav-topo a.ativo { color: #a5b4fc; background: rgba(99, 102, 241, 0.12); }

.artigo {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 40px;
  border-radius: 16px;
  border: 1px solid var(--card-border);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.artigo h1 {
  margin: 0 0 6px 0;
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.25;
  color: #ffffff;
}

.meta {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 0 0 28px 0;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--card-border);
}

.artigo h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: #ffffff;
  margin: 36px 0 12px 0;
}

.artigo h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #a5b4fc;
  margin: 28px 0 8px 0;
}

.artigo p { color: #cbd5e1; margin: 0 0 16px 0; }
.artigo ul, .artigo ol { color: #cbd5e1; margin: 0 0 16px 0; padding-left: 22px; }
.artigo li { margin-bottom: 8px; }
.artigo strong { color: #ffffff; }

.artigo a { color: #a5b4fc; }
.artigo a:hover { color: #c7d2fe; }

.artigo code {
  font-family: 'JetBrains Mono', monospace;
  background: rgba(99, 102, 241, 0.12);
  color: #a5b4fc;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 0.85em;
}

.aviso-caixa {
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0;
  padding: 14px 18px;
  margin: 20px 0;
  font-size: 0.92rem;
  color: #cbd5e1;
}

.aviso-caixa.sucesso {
  background: rgba(16, 185, 129, 0.07);
  border-color: rgba(16, 185, 129, 0.3);
  border-left-color: var(--success);
}

/* TABELAS ROLÁVEIS */
.tabela-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 10px 0 24px 0;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  background: rgba(5, 7, 15, 0.35);
}

/* Sombra que sugere continuação do conteúdo à direita — aplicada SOMENTE
   quando a tabela realmente transborda (classe .rolavel controlada pelo
   JS da página). Antes, o fade de 18px era permanente e apagava o fim do
   texto mesmo em telas largas, onde não há scroll. */
.tabela-scroll.rolavel {
  -webkit-mask-image: linear-gradient(to right, #000 0%, #000 calc(100% - 18px), transparent 100%);
  mask-image: linear-gradient(to right, #000 0%, #000 calc(100% - 18px), transparent 100%);
}

.tabela-scroll .tabela-wiki { margin: 0; min-width: 560px; }

/* Scrollbar visível (desktop) — mesma identidade do app */
.tabela-scroll::-webkit-scrollbar { height: 8px; }
.tabela-scroll::-webkit-scrollbar-track { background: rgba(5, 7, 15, 0.6); }
.tabela-scroll::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.45);
  border-radius: 4px;
}
.tabela-scroll::-webkit-scrollbar-thumb:hover { background: var(--accent); }

.tabela-wiki {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin: 0;
}

.tabela-wiki th, .tabela-wiki td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--card-border);
}

.tabela-wiki th {
  color: #a5b4fc;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tabela-wiki tr:last-child td { border-bottom: none; }
.tabela-wiki td:first-child { font-weight: 600; color: #ffffff; }

/* DICA DE ARRASTE — discreta, some quando o usuário chega ao fim.
   Ao ocultar, o espaço é LIBERADO DE VERDADE: além de opacity +
   visibility, max-height e margin-top colapsam a zero (opacity e
   visibility sozinhos escondem o texto mas mantêm o vão fantasma
   acima da tabela). */
.dica-arraste {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  max-height: 40px;
  overflow: hidden;
  margin: 14px 6px 0 0;
  transition: opacity 0.4s ease, visibility 0.4s ease, max-height 0.4s ease, margin-top 0.4s ease;
}

.dica-arraste svg { width: 15px; height: 15px; flex-shrink: 0; color: var(--accent); }

.dica-arraste.oculta {
  opacity: 0;
  visibility: hidden;
  max-height: 0;
  margin-top: 0;
}

/* PASSOS NUMERADOS */
.passos { counter-reset: passo; padding-left: 0; list-style: none; }
.passos li {
  counter-increment: passo;
  position: relative;
  padding-left: 46px;
  margin-bottom: 18px;
}
.passos li::before {
  content: counter(passo);
  position: absolute;
  left: 0; top: 0;
  width: 32px; height: 32px;
  background: var(--accent-gradient);
  border-radius: 10px;
  text-align: center;
  line-height: 32px;
  font-weight: 800;
  font-size: 0.9rem;
  color: #ffffff;
}

.passos li strong { display: block; margin-bottom: 4px; }

/* FAQ */
.faq-item {
  background: var(--input-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  margin-bottom: 12px;
  overflow: hidden;
}

.faq-item summary {
  cursor: pointer;
  padding: 16px 20px;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-main);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+';
  color: var(--accent);
  font-size: 1.4rem;
  font-weight: 400;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item[open] summary { color: #a5b4fc; }
.faq-item .faq-resposta { padding: 0 20px 18px 20px; color: #cbd5e1; font-size: 0.92rem; }
.faq-item .faq-resposta p:last-child { margin-bottom: 0; }

.cta-caixa {
  margin-top: 36px;
  text-align: center;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: 14px;
  padding: 26px;
}

.cta-caixa h3 { margin: 0 0 8px 0; color: #ffffff; font-size: 1.15rem; }
.cta-caixa p { margin-bottom: 18px; font-size: 0.92rem; }

.btn-cta {
  background: var(--accent-gradient);
  color: #ffffff;
  text-decoration: none;
  border: none;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 30px;
  min-height: 44px;
  border-radius: 12px;
  box-shadow: 0 8px 24px var(--accent-glow);
  transition: transform 0.2s ease;
  cursor: pointer;
}

.btn-cta svg { width: 18px; height: 18px; flex-shrink: 0; }
.btn-cta:hover { transform: translateY(-2px); }
.btn-cta:active { transform: translateY(0); }
.btn-cta:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.btn-cta.bloco { width: 100%; }

.btn-cta.secundario {
  background: rgba(99, 102, 241, 0.15);
  box-shadow: none;
  border: 1px solid rgba(99, 102, 241, 0.4);
}

.ico-texto { width: 1.05em; height: 1.05em; vertical-align: -0.15em; }

.ico-404 { width: 46px; height: 46px; color: var(--accent); margin-bottom: 12px; }

.form-campo { margin-bottom: 16px; }

.form-campo label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #cbd5e1;
}

.form-campo input, .form-campo textarea, .form-campo select {
  width: 100%;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid var(--card-border);
  background: var(--input-bg);
  color: var(--text-main);
  font-size: 0.9rem;
  font-family: inherit;
  transition: all 0.25s ease;
}

.form-campo input:focus, .form-campo textarea:focus, .form-campo select:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 4px var(--accent-glow);
}

.form-campo textarea { min-height: 140px; resize: vertical; }

footer {
  margin-top: 40px;
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  padding-top: 24px;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  border-top: 1px solid var(--card-border);
}

footer p { margin: 0 0 10px 0; }

/* Alvos de toque ≥44px: os "·" são nós de texto anônimos do flex —
   align-items:center mantém os separadores centrados com links mais altos */
.nav-rodape { display: flex; justify-content: center; align-items: center; gap: 8px; flex-wrap: wrap; }
.nav-rodape a { color: #a5b4fc; text-decoration: none; padding: 12px 8px; }
.nav-rodape a:hover { text-decoration: underline; }

.brand:focus-visible,
.nav-topo a:focus-visible,
.nav-rodape a:focus-visible,
.faq-item summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 8px;
}

.btn-cta:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 3px;
  border-radius: 12px;
}

/* ACESSIBILIDADE — usuários com "reduzir movimento" ativado no sistema
   (conformidade Seção 7.5b): desativa animações e transições */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media (max-width: 640px) {
  body { padding: 20px 12px; }
  .artigo { padding: 24px 20px; }
  .artigo h1 { font-size: 1.5rem; }
}