/* Central de Ajuda — todo o CSS vive sob o prefixo .ajuda-, para não haver
   chance de encostar no layout das telas existentes. A paleta segue a da
   plataforma (slate para texto e bordas, indigo para o destaque), e os raios e
   sombras seguem os dos modais que já existem em lote-placas.css. */

/* O botão no cabeçalho herda as classes utilitárias do próprio cabeçalho; aqui
   só entra a cor, para ele não gritar mais que o sino ao lado. */
.ajuda-botao-topo { color: #4b5563; line-height: 1; }
.ajuda-botao-topo:hover { color: #4f46e5; }

/* Com a ajuda aberta, a página atrás não rola junto. */
body.ajuda-travada { overflow: hidden; }

.ajuda-fundo {
  position: fixed;
  inset: 0;
  /* Acima dos modais da plataforma (lote-placas.css usa 1250): a ajuda pode
     ser aberta a qualquer momento, inclusive por cima de um deles. */
  z-index: 1400;
  background: rgba(15, 23, 42, .5);
  display: grid;
  place-items: center;
  padding: 20px;
  color: #1e293b;
  font-size: 14px;
  line-height: 1.6;
}
.ajuda-fundo[hidden] { display: none !important; }

.ajuda-painel {
  width: min(1040px, 100%);
  height: min(760px, 100%);
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .35);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ------------------------------------------------------------------ topo */

.ajuda-topo {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px 16px;
  border-bottom: 1px solid #e2e8f0;
}
.ajuda-topo-texto h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 10px;
}
.ajuda-topo-texto h2 i { color: #4f46e5; }
.ajuda-topo-texto p { margin: 4px 0 0; font-size: 13px; color: #64748b; }

.ajuda-fechar {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  color: #64748b;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  transition: background .15s, color .15s;
}
.ajuda-fechar:hover { background: #f1f5f9; color: #0f172a; }

/* ----------------------------------------------------------------- busca */

.ajuda-busca {
  position: relative;
  display: flex;
  align-items: center;
  margin: 16px 24px 0;
}
.ajuda-busca > i {
  position: absolute;
  left: 14px;
  color: #94a3b8;
  font-size: 14px;
  pointer-events: none;
}
.ajuda-busca input {
  width: 100%;
  padding: 11px 40px 11px 38px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  font-size: 14px;
  color: #0f172a;
  outline: none;
  transition: border-color .15s, background .15s, box-shadow .15s;
  /* o X nativo do type=search duplicaria o nosso botão de limpar */
  -webkit-appearance: none;
  appearance: none;
}
.ajuda-busca input::-webkit-search-cancel-button { display: none; }
.ajuda-busca input::placeholder { color: #94a3b8; }
.ajuda-busca input:focus {
  border-color: #a5b4fc;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .12);
}
.ajuda-limpar {
  position: absolute;
  right: 8px;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
}
.ajuda-limpar:hover { background: #e2e8f0; color: #0f172a; }
.ajuda-limpar[hidden] { display: none !important; }

/* ----------------------------------------------------------------- corpo */

.ajuda-corpo {
  flex: 1;
  display: grid;
  grid-template-columns: 236px 1fr;
  gap: 0;
  min-height: 0;   /* sem isto o grid não deixa os filhos rolarem */
  padding-top: 16px;
}

.ajuda-lateral {
  border-right: 1px solid #e2e8f0;
  padding: 0 12px 16px 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ajuda-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #475569;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.ajuda-item i { width: 16px; text-align: center; color: #94a3b8; flex-shrink: 0; }
.ajuda-item:hover { background: #f1f5f9; color: #0f172a; }
.ajuda-item-ativo { background: #eef2ff; color: #4338ca; }
.ajuda-item-ativo i { color: #4f46e5; }

.ajuda-conteudo {
  overflow-y: auto;
  padding: 0 24px 28px;
  outline: none;
}

/* ---------------------------------------------------------------- seções */

.ajuda-secao-titulo {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 10px;
}
.ajuda-secao-titulo i { color: #4f46e5; font-size: 15px; }
.ajuda-secao-sub { margin: 2px 0 14px; font-size: 12px; color: #94a3b8; }

.ajuda-grupo {
  margin: 20px 0 8px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #94a3b8;
}

/* --------------------------------------------------------------- artigos */

.ajuda-artigo {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  margin-bottom: 8px;
  background: #fff;
  overflow: hidden;
}
.ajuda-artigo[open] { border-color: #c7d2fe; box-shadow: 0 2px 10px rgba(15, 23, 42, .05); }

.ajuda-artigo-titulo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  color: #1e293b;
  list-style: none;
  transition: background .15s;
}
.ajuda-artigo-titulo::-webkit-details-marker { display: none; }
.ajuda-artigo-titulo:hover { background: #f8fafc; }
.ajuda-artigo[open] .ajuda-artigo-titulo { color: #3730a3; }
.ajuda-seta { color: #94a3b8; font-size: 12px; transition: transform .18s; flex-shrink: 0; }
.ajuda-artigo[open] .ajuda-seta { transform: rotate(180deg); }

.ajuda-artigo-corpo {
  padding: 0 14px 14px;
  border-top: 1px solid #f1f5f9;
  padding-top: 12px;
}
.ajuda-artigo-corpo p { margin: 0; }
.ajuda-oquefaz { color: #334155; }

.ajuda-bloco { margin-top: 12px; }
.ajuda-bloco h5 {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #64748b;
}
.ajuda-bloco p { color: #475569; }

/* O reset do Tailwind (preflight) zera list-style em toda ol/ul, e sem isto os
   passos aparecem sem numeração dentro da plataforma -- some justamente a
   ordem, que é o que faz um passo a passo ser um passo a passo. */
.ajuda-passos { margin: 0; padding-left: 20px; display: grid; gap: 5px; color: #475569; list-style: decimal outside; }
.ajuda-passos li { padding-left: 2px; }

.ajuda-exemplo {
  margin-top: 12px !important;
  display: flex;
  gap: 9px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #475569;
  font-size: 13px;
}
.ajuda-exemplo i { color: #d97706; margin-top: 3px; flex-shrink: 0; }

/* ------------------------------------------------------------- contatos */

.ajuda-contatos { margin-top: 12px !important; display: flex; flex-wrap: wrap; gap: 8px; }
.ajuda-contato {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid #c7d2fe;
  background: #eef2ff;
  color: #4338ca;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}
.ajuda-contato:hover { background: #e0e7ff; }

/* ----------------------------------------------------------------- vazio */

.ajuda-vazio {
  padding: 34px 20px;
  text-align: center;
  color: #64748b;
  border: 1px dashed #e2e8f0;
  border-radius: 14px;
  background: #f8fafc;
}
.ajuda-vazio > i { font-size: 26px; color: #cbd5e1; }
.ajuda-vazio-titulo { margin: 10px 0 6px !important; font-weight: 700; color: #334155; }
.ajuda-vazio a { color: #4f46e5; font-weight: 600; }

/* --------------------------------------------------------- responsividade */

/* Tablet: o painel ocupa a tela toda e a lateral encolhe. */
@media (max-width: 900px) {
  .ajuda-fundo { padding: 0; }
  .ajuda-painel { width: 100%; height: 100%; border-radius: 0; }
  .ajuda-corpo { grid-template-columns: 1fr; padding-top: 12px; }

  /* A lateral vira uma fila de atalhos que rola na horizontal: no estreito,
     uma coluna de categorias comeria a tela inteira antes do conteúdo. */
  .ajuda-lateral {
    flex-direction: row;
    gap: 8px;
    border-right: 0;
    border-bottom: 1px solid #e2e8f0;
    padding: 0 16px 12px;
    overflow-x: auto;
    overflow-y: hidden;
    /* Firefox e WebKit: sem barra visível, mas continua rolando */
    scrollbar-width: none;
  }
  .ajuda-lateral::-webkit-scrollbar { display: none; }
  .ajuda-item {
    width: auto;
    flex: 0 0 auto;
    white-space: nowrap;
    border: 1px solid #e2e8f0;
    padding: 8px 12px;
  }
  .ajuda-item-ativo { border-color: #c7d2fe; }
  .ajuda-conteudo { padding: 16px 16px 24px; }
}

/* Celular: menos respiro lateral, títulos um pouco menores. */
@media (max-width: 520px) {
  .ajuda-topo { padding: 16px 16px 12px; }
  .ajuda-topo-texto h2 { font-size: 16px; }
  .ajuda-topo-texto p { font-size: 12px; }
  .ajuda-busca { margin: 12px 16px 0; }
  .ajuda-artigo-titulo { font-size: 13.5px; padding: 11px 12px; }
  .ajuda-conteudo { padding: 14px 12px 22px; }
  .ajuda-lateral { padding: 0 12px 10px; }
  .ajuda-contato { width: 100%; justify-content: center; }
}

/* Telas muito baixas (notebook com a janela reduzida): o painel acompanha. */
@media (max-height: 640px) {
  .ajuda-painel { height: 100%; }
}

/* Quem pediu menos animação no sistema não leva a seta girando. */
@media (prefers-reduced-motion: reduce) {
  .ajuda-seta, .ajuda-item, .ajuda-busca input, .ajuda-fechar { transition: none; }
}
