:root {
  color-scheme: light;
  --azul: #1557d6;
  --azul-escuro: #0d3f9e;
  --azul-claro: #e8f0ff;
  --texto: #1b2433;
  --suave: #5b6678;
  --borda: #dde3ec;
  --fundo: #f5f7fb;
  --branco: #fff;
  --campo: #fff;
  --verde: #12a150;
  --vermelho: #d93a3a;
  --amarelo: #b7791f;
  --fundo-perigo: #fde8e8;
  --fundo-aviso: #fff7e6;
  --fundo-ok: #e6f6ed;
  --fundo-chat: #eef2f7;
  --msg-dele: #fff;
  --msg-nossa: #dbe8ff;
  --sombra: rgba(0,0,0,.06);
  --sombra-cartao: 0 1px 2px rgba(16,24,40,.04), 0 4px 16px rgba(16,24,40,.06);
  --fundo-heroi: linear-gradient(160deg, #eaf1ff 0%, #f5f7fb 55%);
  --raio: 14px;
}
/* Modo noturno: segue o sistema, a menos que a pessoa escolha "claro" no botão. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --azul: #5b8def;
    --azul-escuro: #3f72d8;
    --azul-claro: #1c2a45;
    --texto: #e6e9ef;
    --suave: #9aa4b5;
    --borda: #2c3442;
    --fundo: #0f141b;
    --branco: #171d26;
    --campo: #1d2430;
    --verde: #3ccf7a;
    --vermelho: #f06b6b;
    --amarelo: #e6b45a;
    --fundo-perigo: #3a1d20;
    --fundo-aviso: #3a2e17;
    --fundo-ok: #173225;
    --fundo-chat: #0b1016;
    --msg-dele: #1d2430;
    --msg-nossa: #1f3a6b;
    --sombra: rgba(0,0,0,.4);
    --sombra-cartao: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.35);
    --fundo-heroi: linear-gradient(160deg, #142038 0%, #0f141b 60%);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --azul: #5b8def;
  --azul-escuro: #3f72d8;
  --azul-claro: #1c2a45;
  --texto: #e6e9ef;
  --suave: #9aa4b5;
  --borda: #2c3442;
  --fundo: #0f141b;
  --branco: #171d26;
  --campo: #1d2430;
  --verde: #3ccf7a;
  --vermelho: #f06b6b;
  --amarelo: #e6b45a;
  --fundo-perigo: #3a1d20;
  --fundo-aviso: #3a2e17;
  --fundo-ok: #173225;
  --fundo-chat: #0b1016;
  --msg-dele: #1d2430;
  --msg-nossa: #1f3a6b;
  --sombra: rgba(0,0,0,.4);
  --sombra-cartao: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.35);
  --fundo-heroi: linear-gradient(160deg, #142038 0%, #0f141b 60%);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--texto);
  background: var(--fundo);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--azul); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
img { max-width: 100%; }
.container { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
:focus-visible { outline: 3px solid var(--azul); outline-offset: 2px; }

/* Topo */
.topo { background: var(--branco); border-bottom: 1px solid var(--borda); position: sticky; top: 0; z-index: 20; }
.topo .container { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 12px; }
.marca { font-weight: 800; font-size: 1.15rem; color: var(--azul); text-decoration: none; white-space: nowrap; }
.marca span { color: var(--texto); font-weight: 600; }
.topo nav { display: flex; gap: 18px; align-items: center; min-width: 0; }
.topo nav a { text-decoration: none; color: var(--texto); font-weight: 500; white-space: nowrap; }
.topo nav a:hover { color: var(--azul); }

/* Botões */
.botao {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 10px; cursor: pointer;
  background: var(--azul); color: #fff; padding: 12px 20px; font-size: 1rem; font-family: inherit;
  font-weight: 600; text-decoration: none; text-align: center; line-height: 1.2;
  transition: background .15s, transform .05s;
  box-shadow: 0 1px 2px rgba(16,24,40,.12);
}
.botao:hover { background: var(--azul-escuro); }
.botao:active { transform: translateY(1px); }
.botao:disabled { opacity: .55; cursor: default; transform: none; }
.botao.claro { background: var(--azul-claro); color: var(--azul); box-shadow: none; }
.botao.claro:hover { filter: brightness(.96); }
.botao.perigo { background: var(--fundo-perigo); color: var(--vermelho); box-shadow: none; }
.botao.pequeno { padding: 7px 12px; font-size: .9rem; }

/* Página inicial */
.heroi { padding: 64px 0 56px; background: var(--fundo-heroi); }
.heroi .container { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: start; }
.heroi h1 { font-size: clamp(1.8rem, 4.2vw, 2.7rem); font-weight: 800; letter-spacing: -.02em; }
.heroi p.sub { font-size: 1.15rem; color: var(--suave); }
.lista-check { list-style: none; padding: 0; margin: 20px 0; }
.lista-check li { padding: 5px 0 5px 32px; position: relative; }
.lista-check li::before { content: "✓"; position: absolute; left: 0; top: 6px; width: 22px; height: 22px; border-radius: 50%; background: var(--fundo-ok); color: var(--verde); font-weight: 800; font-size: .75rem; display: grid; place-items: center; }

.cartao { background: var(--branco); border: 1px solid var(--borda); border-radius: var(--raio); padding: 24px; box-shadow: var(--sombra-cartao); }
.secao { padding: 56px 0; }
.secao h2 { font-size: clamp(1.5rem, 3vw, 1.9rem); text-align: center; }
.secao p.centro { text-align: center; color: var(--suave); max-width: 640px; margin: 0 auto 28px; }

.grade { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); }
.recurso h3 { font-size: 1.05rem; }
.recurso p { color: var(--suave); margin: 0; }
.recurso { transition: transform .15s; }
.recurso:hover { transform: translateY(-2px); }

.plano { text-align: center; position: relative; display: flex; flex-direction: column; }
.plano.destaque { border: 2px solid var(--azul); }
.plano .selo { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--azul); color: #fff; font-size: .8rem; padding: 3px 12px; border-radius: 99px; white-space: nowrap; }
.plano .preco { font-size: 2.1rem; font-weight: 800; margin: 8px 0 0; letter-spacing: -.02em; }
.plano .mes { color: var(--suave); margin-bottom: 12px; }
.plano ul { list-style: none; padding: 0; margin: 0 0 16px; text-align: left; flex: 1; }
.plano li { padding: 6px 0; border-bottom: 1px solid var(--borda); }

/* Formulários */
form .campo, .campo { margin-bottom: 14px; }
form label, .campo label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 4px; }
input, select, textarea {
  width: 100%; padding: 11px 12px; border: 1px solid var(--borda); border-radius: 10px;
  font-size: 1rem; font-family: inherit; background: var(--campo); color: var(--texto);
  transition: border-color .15s, box-shadow .15s;
}
input[type="checkbox"], input[type="radio"] { width: auto; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--azul); box-shadow: 0 0 0 3px var(--azul-claro); }
textarea { resize: vertical; }
.erro { color: var(--vermelho); font-size: .92rem; min-height: 1.2em; margin: 6px 0; }
.ok { color: var(--verde); }

.faq details { background: var(--branco); border: 1px solid var(--borda); border-radius: 12px; padding: 14px 16px; margin-bottom: 10px; }
.faq summary { font-weight: 600; cursor: pointer; }
.faq p { color: var(--suave); margin: 10px 0 0; }
details > summary { list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details > summary::after { content: "+"; float: right; margin-left: 8px; color: var(--suave); font-weight: 700; }
details[open] > summary::after { content: "–"; }
details.cartao[open] > summary { margin-bottom: 12px; }

.rodape { padding: 32px 0; text-align: center; color: var(--suave); font-size: .9rem; border-top: 1px solid var(--borda); }

.caixa-login { max-width: 420px; margin: 48px auto; }

/* Painel */
.painel { display: grid; grid-template-columns: 230px 1fr; min-height: calc(100vh - 64px); min-height: calc(100dvh - 64px); }
.menu { background: var(--branco); border-right: 1px solid var(--borda); padding: 16px 10px; position: sticky; top: 64px; align-self: start; height: calc(100vh - 64px); height: calc(100dvh - 64px); overflow-y: auto; }
.menu a { display: flex; justify-content: space-between; align-items: center; gap: 6px; padding: 10px 12px; border-radius: 10px; color: var(--texto); text-decoration: none; margin-bottom: 2px; font-weight: 500; transition: background .12s; }
.menu a.ativo, .menu a:hover { background: var(--azul-claro); color: var(--azul); }
.menu a.ativo { font-weight: 700; }
.menu .breve { font-size: .7rem; background: var(--fundo); color: var(--suave); padding: 1px 7px; border-radius: 99px; }
.conteudo { padding: 28px; min-width: 0; max-width: 1200px; width: 100%; }
.conteudo h1 { font-weight: 800; }
.aviso { padding: 12px 16px; border-radius: 12px; margin-bottom: 16px; }
.aviso.teste { background: var(--fundo-aviso); color: var(--amarelo); }
.aviso.vencida { background: var(--fundo-perigo); color: var(--vermelho); }
.etiqueta { display: inline-block; font-size: .78rem; font-weight: 600; padding: 2px 9px; border-radius: 99px; background: var(--fundo); }
.etiqueta.verde { background: var(--fundo-ok); color: var(--verde); }
.etiqueta.vermelha { background: var(--fundo-perigo); color: var(--vermelho); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--borda); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
th { font-size: .78rem; color: var(--suave); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.tabela-rolagem { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.pix { text-align: center; }
.pix #qr { display: inline-block; padding: 12px; background: #fff; border: 1px solid var(--borda); border-radius: 12px; margin: 12px 0; }
.pix #qr img, .pix #qr canvas { max-width: 100%; height: auto; }
.pix textarea { font-family: monospace; font-size: .8rem; padding: 8px; resize: none; }
.oculto { display: none !important; }

/* Conversas */
.chat { display: grid; grid-template-columns: 320px 1fr; height: calc(100vh - 64px - 56px); height: calc(100dvh - 64px - 56px); min-height: 420px; background: var(--branco); border: 1px solid var(--borda); border-radius: var(--raio); overflow: hidden; box-shadow: var(--sombra-cartao); }
.chat-lista { border-right: 1px solid var(--borda); overflow-y: auto; }
.chat-filtros { padding: 10px; border-bottom: 1px solid var(--borda); position: sticky; top: 0; background: var(--branco); z-index: 1; }
.chat-item { display: block; padding: 11px 12px; border-bottom: 1px solid var(--borda); color: var(--texto); text-decoration: none; }
.chat-item:hover, .chat-item.ativo { background: var(--azul-claro); }
.chat-item-topo, .chat-item-baixo { display: flex; justify-content: space-between; gap: 8px; min-width: 0; }
.chat-item-topo strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-item-topo span { font-size: .75rem; color: var(--suave); white-space: nowrap; }
.chat-item .previa { font-size: .88rem; color: var(--suave); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-item-quem { font-size: .75rem; color: var(--suave); }
.bolinha { background: var(--verde); color: #fff; border-radius: 99px; font-size: .72rem; padding: 0 7px; height: 18px; line-height: 18px; }
.chat-janela { display: flex; flex-direction: column; min-width: 0; }
.chat-vazio { margin: auto; color: var(--suave); padding: 24px; text-align: center; }
.chat-cabeca { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 12px; border-bottom: 1px solid var(--borda); background: var(--branco); }
.chat-mensagens { flex: 1; overflow-y: auto; padding: 16px; background: var(--fundo-chat); display: flex; flex-direction: column; gap: 6px; }
.msg { max-width: min(75%, 560px); padding: 8px 11px; border-radius: 12px; background: var(--msg-dele); box-shadow: 0 1px 1px var(--sombra); }
.msg.nossa { align-self: flex-end; background: var(--msg-nossa); border-bottom-right-radius: 4px; }
.msg.dele { align-self: flex-start; border-bottom-left-radius: 4px; }
.msg-texto { white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-info { font-size: .72rem; color: var(--suave); text-align: right; margin-top: 2px; }
.msg-tag { font-size: .7rem; color: var(--azul); font-weight: 700; }
.msg-erro { font-size: .75rem; color: var(--vermelho); }
.chat-envio { display: flex; gap: 8px; padding: 10px; padding-bottom: max(10px, env(safe-area-inset-bottom)); border-top: 1px solid var(--borda); background: var(--branco); }
.chat-envio textarea { flex: 1; resize: none; padding: 9px 11px; }
.so-celular { display: none; }
.menu .breve:not(.oculto) { background: var(--verde); color: #fff; }
.menu a[href="#robo"] .breve { background: var(--fundo); color: var(--suave); }

/* Botão do tema (🌙/☀️) no topo */
.botao-tema { display: inline-flex; align-items: center; gap: 6px; background: var(--azul-claro); border: 1px solid var(--borda); border-radius: 99px; padding: 8px 14px; cursor: pointer; font-size: .9rem; font-family: inherit; font-weight: 600; line-height: 1; color: var(--azul); white-space: nowrap; flex-shrink: 0; }
.botao-tema:hover { filter: brightness(.97); }
code { background: var(--azul-claro); padding: 1px 5px; border-radius: 5px; font-size: .9em; }

/* Tablet e celular */
@media (max-width: 900px) {
  .heroi { padding: 40px 0 36px; }
  .heroi .container { grid-template-columns: 1fr; gap: 28px; }
  .topo nav .so-pc { display: none; }
  .painel { grid-template-columns: 1fr; }
  .menu {
    display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none;
    position: sticky; top: 64px; z-index: 15; height: auto;
    border-right: 0; border-bottom: 1px solid var(--borda); padding: 8px 12px;
  }
  .menu::-webkit-scrollbar { display: none; }
  .menu a { white-space: nowrap; margin: 0; padding: 8px 14px; border-radius: 99px; border: 1px solid var(--borda); flex-shrink: 0; }
  .menu a.ativo { border-color: var(--azul); }
  .conteudo { padding: 18px 16px 32px; }
  .chat { grid-template-columns: 1fr; height: calc(100dvh - 64px - 58px - 40px); }
  .chat-janela { display: none; }
  .chat-janela.aberta { display: flex; position: fixed; inset: 0; z-index: 30; background: var(--branco); }
  .so-celular { display: inline-flex; }
}
@media (max-width: 600px) {
  .container { padding: 0 16px; }
  .topo .container { height: 56px; }
  .menu { top: 56px; }
  .chat { height: calc(100dvh - 56px - 58px - 36px); }
  .topo nav { gap: 10px; }
  .marca { font-size: 1.05rem; }
  .botao-tema { padding: 8px 10px; }
  .botao-tema .rotulo-tema { display: none; }
  .cartao { padding: 18px; border-radius: 12px; }
  .secao { padding: 40px 0; }
  .heroi p.sub { font-size: 1.05rem; }
  .conteudo h1 { font-size: 1.3rem !important; }
  .conteudo .cartao[style*="max-width"] { max-width: none !important; }
  .msg { max-width: 88%; }
  th, td { padding: 9px 8px; font-size: .92rem; }
  form .botao[type="submit"] { width: 100%; }
  .caixa-login { margin: 24px auto; }
}
@media (max-width: 380px) {
  .marca span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
