/* Reset simples */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: #1f2937; /* gray-800 */
  background: #f8fafc; /* slate-50 */
  padding-top: 56px; /* compensa a topbar fixa */
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Topbar */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  width: 100%;
  background: #000000; /* barra preta */
  border-bottom: 1px solid #111111;
  box-shadow: 0 1px 0 rgba(0,0,0,0.4);
}

.topbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.brand {
  text-decoration: none;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.brand img { height: 32px; display: block; }

/* Hamburguer (mobile) */
.hamburger {
  display: inline-flex;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  flex-direction: column; /* barras uma embaixo da outra */
  border-radius: 12px;
  text-decoration: none;
  appearance: none;
  border: 1px solid #e5e7eb; /* default; será sobrescrito dentro da topbar */
  background: linear-gradient(180deg, #ffffff, #f9fafb);
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  cursor: pointer;
  color: #0ea5e9; /* default; será sobrescrito dentro da topbar */
  transition: background .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.hamburger:hover {
  background: linear-gradient(180deg, #f9fafb, #f3f4f6);
  border-color: #e5e7eb;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.hamburger:focus-visible {
  outline: 3px solid rgba(14,165,233,0.35);
  outline-offset: 2px;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2.5px;
  background: currentColor;
  margin: 4px 0;
  border-radius: 2px;
  transition: transform .25s ease, opacity .2s ease, background-color .2s ease;
}

/* Variante de ícone sobre a barra preta */
.topbar .hamburger {
  border-color: rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.06);
  color: #ffffff;
  box-shadow: none;
}
.topbar .hamburger:hover {
  background: rgba(255,255,255,0.12);
}

/* Animação para X quando aberto */
.hamburger.is-active span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.hamburger.is-active span:nth-child(2) { opacity: 0; }
.hamburger.is-active span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* Navegação desktop */
.desktop-nav { display: none; }
.desktop-nav a {
  color: #374151; /* gray-700 */
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 6px;
}
.desktop-nav a:hover { background: #f3f4f6; }

/* Botões utilitários */
.btn-secondary {
  appearance: none;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  color: #111827;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
}
.btn-secondary:hover { background: #f9fafb; }

/* Conteúdo */
.content { padding: 12px 16px 24px; }
/* Cartão principal do conteúdo */
.content.container {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.06), 0 2px 6px rgba(0,0,0,0.04);
  padding: 8px 20px 20px;
  margin-top: 10px;
  text-align: center;
}
/* Ajustes específicos para conteúdo de páginas internas (ex.: gerador-cpf) */
.content.container > h1 { margin: 0 0 8px; font-size: 22px; }
.content.container > h1 + .options { margin-top: 6px; }
.content.container .options { text-align: center; }
.content.container .radio-group { justify-content: center; }
.content.container select { display: inline-block; margin: 0 auto; }
.hero {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 28px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
  text-align: center;
  background-image: linear-gradient(180deg, #ffffff, #f9fafb);
}
.hero h1 { margin-top: 0; margin-bottom: 8px; font-size: 20px; }
.hero p { margin: 8px 0; color: #4b5563; }

.btn {
  display: inline-block;
  background: #0ea5e9; /* sky-500 */
  color: #ffffff;
  text-decoration: none;
  padding: 10px 14px;
  border-radius: 8px;
  font-weight: 600;
}
.btn:hover { background: #0284c7; /* sky-600 */ }

.cta { margin-top: 16px; text-align: center; }

/* Rodapé */
.footer {
  margin-top: 24px;
  padding: 16px 0 24px;
  color: #6b7280; /* gray-500 */
  text-align: center;
}

/* ========== Páginas: Gerador de Meta Tags ========== */
.meta-form {
  max-width: 760px;
  margin: 8px auto 0;
  text-align: left;
}
.meta-form .form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px 16px;
}
.meta-form .form-group { margin: 0; }
.meta-form label {
  display: block;
  font-weight: 600;
  color: #374151; /* gray-700 */
  margin-bottom: 6px;
}
.meta-form input[type="text"],
.meta-form input[type="url"],
.meta-form select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  color: #111827;
  font-size: 14px;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.meta-form input:focus,
.meta-form select:focus {
  outline: none;
  border-color: #93c5fd; /* blue-300 */
  box-shadow: 0 0 0 3px rgba(59,130,246,0.25);
}
.meta-form .counter {
  font-size: 12px;
  color: #6b7280;
  margin-top: 6px;
}
.meta-form .counter.over { color: #dc2626; }

.meta-actions { margin-top: 8px; text-align: center; }

.meta-result {
  margin-top: 18px;
  background: #f8fafc; /* slate-50 */
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 14px 14px 18px;
  position: relative;
}
.meta-result .meta-code {
  font: 500 13px/1.5 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  color: #111827;
  white-space: pre-wrap;
  word-break: break-word;
}
.meta-result .copy-btn { position: absolute; top: 10px; right: 10px; }

@media (min-width: 768px) {
  .meta-form .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .meta-form .form-group.full { grid-column: 1 / -1; }
}

/* Intro/home */
.home-intro { margin-top: 16px; }
.home-intro h1 { margin: 0 0 6px; font-size: 20px; }
.home-intro p { margin: 0; color: #4b5563; }
.home-intro { text-align: center; }

/* Backdrop e Drawer (off-canvas) */
.backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s ease, visibility .2s ease;
  z-index: 90;
}
.backdrop.show { opacity: 1; visibility: visible; }

/* Overlay adicional (se precisar usar) */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s ease, visibility .2s ease;
  z-index: 90;
}
.overlay.show { opacity: 1; visibility: visible; }

.drawer {
  position: fixed;
  top: 0; bottom: 0; left: 0;
  width: 340px;
  max-width: 85vw;
  background: #ffffff;
  border-right: 1px solid #e5e7eb;
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
  transform: translateX(-100%);
  transition: transform .25s ease;
  z-index: 100;
  display: flex;
  flex-direction: column;
}
.drawer.open { transform: translateX(0); }

.drawer-header {
  position: absolute; /* remove do fluxo para não criar barra */
  top: 8px;
  right: 8px;
  left: auto;
  bottom: auto;
  padding: 0;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: flex-end; /* só o botão no canto */
  z-index: 2;
}
.drawer-header strong { display: none; }
.drawer-close {
  appearance: none;
  border: 1px solid #9ca3af; /* cinza mais escuro */
  background: #e5e7eb;       /* fundo mais escuro para destacar */
  color: #111827;
  font-size: 22px;
  line-height: 1;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
  cursor: pointer;
}
.drawer-close:hover { background: #d1d5db; border-color: #6b7280; box-shadow: 0 3px 10px rgba(0,0,0,0.14); }
.drawer-close:focus-visible { outline: 3px solid rgba(14,165,233,0.35); outline-offset: 2px; }

.drawer-body {
  padding: 4px 10px 16px; /* conteúdo sobe, botão fica sobreposto no topo */
  overflow: auto;
}

/* Estilos do conteúdo de menu.php dentro do drawer */
.menu { padding: 4px 2px; }
.menu-section { margin-bottom: 20px; }
.menu-section h3 {
  margin: 0 6px 10px;
  color: #1f2937;
  font-size: 16px; /* maior no mobile */
  font-weight: 700;
  text-align: center;
  padding: 6px 10px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
}
.menu ul { list-style: none; padding: 0; margin: 0; }
.menu li { margin: 0 6px 6px; }
.menu a {
  color: #667eea;
  text-decoration: none;
  display: block;
  padding: 8px 10px;
  border: 1px solid #667eea;
  border-radius: 6px;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.menu a:hover { background: #667eea; color: #ffffff; border-color: #667eea; }

/* Cores por seção do menu (na ordem atual) */
/* 1) Utilitários — roxo (#6366f1) em tons claros */
.menu .menu-section:nth-of-type(1) h3 { background: #eef2ff; border-color: #c7d2fe; }
.menu .menu-section:nth-of-type(1) a { color: #6366f1; border-color: #6366f1; }
.menu .menu-section:nth-of-type(1) a:hover { background: #6366f1; border-color: #6366f1; color: #fff; }

/* 2) Geradores — azul (#0ea5e9) em tons claros */
.menu .menu-section:nth-of-type(2) h3 { background: #e0f2fe; border-color: #bae6fd; }
.menu .menu-section:nth-of-type(2) a { color: #0ea5e9; border-color: #0ea5e9; }
.menu .menu-section:nth-of-type(2) a:hover { background: #0ea5e9; border-color: #0ea5e9; color: #fff; }

/* 3) Validadores — ciano (#06b6d4) em tons claros */
.menu .menu-section:nth-of-type(3) h3 { background: #ecfeff; border-color: #a5f3fc; }
.menu .menu-section:nth-of-type(3) a { color: #06b6d4; border-color: #06b6d4; }
.menu .menu-section:nth-of-type(3) a:hover { background: #06b6d4; border-color: #06b6d4; color: #fff; }

/* Seções de opções (cards) */
.options { margin-top: 28px; }
.options h2 {
  margin: 0 0 16px;
  text-align: center;
  font-size: 24px;
  font-weight: 800;
  color: #0ea5e9;
  letter-spacing: .3px;
  display: block;
}
.options h2::after {
  content: "";
  display: block;
  width: 72px;
  height: 4px;
  margin: 8px auto 0;
  background: linear-gradient(90deg, #0ea5e9, #22d3ee);
  border-radius: 999px;
}

.radio-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.result {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
  margin-top: 10px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  text-align: center;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.options .result { cursor: pointer; }

.result:hover {
 
  box-shadow: 0 6px 16px rgba(0,0,0,0.08);
  border-color: #d1d5db;
}

.result i {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ffffff; /* chip neutro para não misturar com o fundo do card */
  border: 1px solid #e5e7eb; /* leve contorno para destacar */
  color: #111827; /* será sobrescrito por seção */
  font-size: 20px;
}

.result h3 { margin: 4px 0 2px; font-size: 16px; color: #111827; }
.result p { margin: 0 0 8px; color: #4b5563; font-size: 14px; }
.result a {
  align-self: center;
  text-decoration: none;
  background: #0ea5e9;
  color: #ffffff;
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: 600;
}
.result a:hover { background: #0284c7; }

/* Link envolvendo o card (home) */
.result-link { display: block; text-decoration: none; color: inherit; height: 100%; }
.radio-group .result-link { height: 100%; }
.radio-group .result { height: 100%; }
.result-link:hover .result { box-shadow: 0 6px 16px rgba(0,0,0,0.08); border-color: #0ea5e9; }
.result-link:focus-visible .result { outline: 3px solid rgba(14,165,233,0.35); outline-offset: 3px; border-color: #0ea5e9; }
.btn-acessar { background: #0ea5e9; color: #fff; padding: 10px 14px; border-radius: 8px; display: inline-block; margin-top: auto; font-weight: 600; }
.result-link:hover .btn-acessar { background: #0284c7; }

/* Variações por seção (cores do botão e borda no hover) */
#geradores .result-link:hover .result,
#geradores .result-link:focus-visible .result { border-color: #0ea5e9; }
#geradores .btn-acessar { background: #0ea5e9; }
#geradores .result-link:hover .btn-acessar { background: #0284c7; }
/* Fundo suave em degradê para os cards desta seção */
#geradores .result { background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%); }

#validadores .result-link:hover .result,
#validadores .result-link:focus-visible .result { border-color: #06b6d4; }
#validadores .btn-acessar { background: #06b6d4; }
#validadores .result-link:hover .btn-acessar { background: #0891b2; }
/* Fundo suave em degradê para os cards desta seção */
#validadores .result { background: linear-gradient(135deg, #ecfeff 0%, #cffafe 100%); }

#utilitarios .result-link:hover .result,
#utilitarios .result-link:focus-visible .result { border-color: #6366f1; }
#utilitarios .btn-acessar { background: #6366f1; }
#utilitarios .result-link:hover .btn-acessar { background: #4f46e5; }
/* Fundo suave em degradê para os cards desta seção */
#utilitarios .result { background: linear-gradient(135deg, #f5f7ff 0%, #eef2ff 100%); }

/* Harmoniza a cor dos ícones por seção */
#geradores .result i { background: #ffffff; border-color: #bae6fd; color: #0ea5e9; }
#geradores .result-link:hover .result i,
#geradores .result-link:focus-visible .result i { color: #0284c7; }
#validadores .result i { background: #ffffff; border-color: #a5f3fc; color: #06b6d4; }
#validadores .result-link:hover .result i,
#validadores .result-link:focus-visible .result i { color: #0891b2; }
#utilitarios .result i { background: #ffffff; border-color: #c7d2fe; color: #6366f1; }
#utilitarios .result-link:hover .result i,
#utilitarios .result-link:focus-visible .result i { color: #4f46e5; }

/* Estados de validação (usado em validador de Título Eleitoral) */
.result.valid { color: #16a34a; font-weight: 800; }
.result.invalid { color: #dc2626; font-weight: 800; }
/* Força de senha */
.result.weak { color: #dc2626; font-weight: 800; }
.result.medium { color: #d97706; font-weight: 800; }
.criteria .valid { color: #16a34a; }
.criteria .invalid { color: #dc2626; }

/* Publicidade (caixa discreta para ads) */
.ad-box {
  position: relative;
  background: #f9fafb;
  border: 1px dashed #e5e7eb;
  border-radius: 12px;
  padding: 10px;
  margin: 16px auto 0;
  max-width: 1280px;
}
.ad-label {
  position: absolute;
  top: -10px;
  left: 12px;
  background: #f3f4f6;
  color: #6b7280;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  font-size: 11px;
  padding: 2px 8px;
}

/* Espaçamento extra quando a publicidade vem logo após o conteúdo principal */
.content.container + .ad-box { margin-top: 28px; }

/* Ajustes para páginas de ferramentas */
.option-group { margin: 10px 0; }
.option-group label { display: block; font-weight: 600; margin-bottom: 6px; }
.option-group .radio-group { display: flex; gap: 12px; }
.cpf-display { font: 700 20px/1.2 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; }
.copy-btn { margin-left: 8px; }

/* Aperfeiçoamentos desktop */
@media (min-width: 1024px) {
  .drawer { width: 380px; }
  .content.container > h1 { font-size: 32px; }
}

/* Responsividade */
@media (min-width: 768px) {
  /* Em telas maiores, esconda o hambúrguer da esquerda e mostre o da direita */
  #open-menu { display: none; }
  .desktop-nav { display: flex; gap: 8px; }
  .topbar .container { height: 64px; }
  .hero { padding: 36px; }
  .hero h1 { font-size: 32px; }
  .content.container > h1 { font-size: 28px; }
  .options h2 { font-size: 28px; }
  .brand img { height: 40px; }
}

/* ===== Conteúdo adicional (cards + FAQ) ===== */
.content-plain { text-align: left; }
/* Garantir que override a regra de .content.container { text-align:center } */
.content.container.content-plain { text-align: left; }
.content.container h2 { margin: 8px 0 10px; font-size: 20px; }
.content.container p { margin: 8px 0; }
.content.container ul { margin: 8px 0 0 18px; }
.content.container ol { margin: 8px 0 0 18px; }

.faq, .faq-section { margin-top: 6px; text-align: left; }
.faq details, .faq-section details {
  background: #f8fafc; /* slate-50 */
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 10px 12px;
  margin: 10px 0;
}
.faq summary, .faq-section summary {
  cursor: pointer;
  font-weight: 700;
  list-style: none;
}
.faq summary::-webkit-details-marker, .faq-section summary::-webkit-details-marker { display: none; }
.faq summary::after, .faq-section summary::after {
  content: '▸';
  float: right;
  color: #6b7280;
}
.faq details[open] summary::after, .faq-section details[open] summary::after { content: '▾'; }
.faq .answer, .faq-section .answer { margin-top: 8px; color: #374151; }

.note {
  background: #fff7ed; /* amber-50 */
  border: 1px solid #fdba74; /* amber-300 */
  border-radius: 10px;
  padding: 10px 12px;
}

/* Grid para seções adicionais (desktop: 2 colunas; FAQ ocupa a largura toda) */
.content-grid { display: grid; gap: 10px; align-items: stretch; margin-top: 12px; }
.content-grid .content.container { max-width: none; width: 100%; margin: 0; }
@media (min-width: 1024px) {
  .content-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .content-grid .content-span-2 { grid-column: 1 / -1; }
}

/* Sugestões (veja também) */
.suggest { text-align: left; }
.suggest-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 8px;
}
.suggest-grid a {
  display: block;
  text-decoration: none;
  padding: 8px 10px;
  border: 1px solid #667eea;
  border-radius: 6px;
  color: #667eea;
  background: #ffffff;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.suggest-grid a:hover { background: #667eea; color: #ffffff; border-color: #667eea; }

/* ===== Páginas: QR Code (inputs da agenda) ===== */
.qr-grid input[type="text"],
.qr-grid input[type="tel"],
.qr-grid input[type="email"],
.qr-grid input[type="url"],
.qr-grid input:not([type]) {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  color: #111827;
  font-size: 16px;
  transition: border-color .2s ease, box-shadow .2s ease;
}

.qr-grid input:focus {
  outline: none;
  border-color: #93c5fd; /* blue-300 */
  box-shadow: 0 0 0 3px rgba(59,130,246,0.25);
}

.qr-grid input.invalid {
  border-color: #dc2626; /* red-600 */
  box-shadow: 0 0 0 3px rgba(220,38,38,0.2);
}
