/* =====================================================================
   VISUAL DO SITE
   As CORES ficam logo abaixo (modo claro e modo escuro). Trocar uma cor
   aqui muda o site inteiro.
   ===================================================================== */
:root {
  --fundo: #f7f4ee;
  --superficie: #ffffff;
  --superficie-2: #f1ece2;
  --texto: #1c1f1e;
  --texto-2: #5c615c;
  --borda: #e5ded0;
  --primaria: #1f5b51;
  --primaria-forte: #163f39;
  --sobre-primaria: #ffffff;
  --dourado: #8f6318;   /* dourado mais escuro: letras pequenas ficam legíveis */
  --dourado-suave: #f7edd7;
  --sucesso: #2f7a4f;
  --perigo: #b3412e;
  --sombra: 0 1px 2px rgba(30, 40, 35, .06), 0 6px 20px rgba(30, 40, 35, .06);

  --fonte: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --fonte-titulo: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --largura: 1080px;
  --raio: 16px;
  --raio-p: 10px;
  --topo-h: 60px;
  --barra-h: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-tema="claro"]) {
    --fundo: #0e1513; --superficie: #16211e; --superficie-2: #1d2a27; --texto: #ecebe6; --texto-2: #a6aea9;
    --borda: #2a3733; --primaria: #6cc0ae; --primaria-forte: #9adccd; --sobre-primaria: #0e1513;
    --dourado: #e2b866; --dourado-suave: #2a2416; --sucesso: #6cc08f; --perigo: #ef8a74;
    --sombra: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25); color-scheme: dark;
  }
}
:root[data-tema="escuro"] {
  --fundo: #0e1513; --superficie: #16211e; --superficie-2: #1d2a27; --texto: #ecebe6; --texto-2: #a6aea9;
  --borda: #2a3733; --primaria: #6cc0ae; --primaria-forte: #9adccd; --sobre-primaria: #0e1513;
  --dourado: #e2b866; --dourado-suave: #2a2416; --sucesso: #6cc08f; --perigo: #ef8a74;
  --sombra: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25); color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--topo-h) + 12px); }
body {
  margin: 0; background: var(--fundo); color: var(--texto);
  font: 17px/1.65 var(--fonte); -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent; overflow-x: hidden;
}
img, svg { max-width: 100%; }
a { color: var(--primaria); text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--fonte-titulo); line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: clamp(1.75rem, 5.5vw, 2.6rem); margin: .3rem 0 .7rem; }
h2 { font-size: clamp(1.35rem, 3.6vw, 1.75rem); margin: 2.4rem 0 .8rem; }
h3 { font-size: 1.15rem; margin: 1.6rem 0 .5rem; }
p { margin: 0 0 1rem; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--dourado); outline-offset: 2px; border-radius: 6px; }
.ico { width: 22px; height: 22px; flex: none; }
.pular { position: absolute; left: -999px; top: 8px; background: var(--primaria); color: var(--sobre-primaria); padding: .5rem 1rem; border-radius: 8px; z-index: 99; }
.pular:focus { left: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.container { max-width: var(--largura); margin: 0 auto; padding: 0 16px; }
.leitura { max-width: 70ch; }
.principal { min-height: 60vh; }

/* Transição suave entre páginas (Chrome/Android) */
@view-transition { navigation: auto; }
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Topo ---------- */
.topo {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--fundo) 82%, transparent);
  backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--borda);
  padding-top: env(safe-area-inset-top);
}
.topo-in { max-width: var(--largura); margin: 0 auto; height: var(--topo-h); padding: 0 12px 0 16px; display: flex; align-items: center; gap: .75rem; }
.topo-voltar { display: grid; place-items: center; width: 40px; height: 40px; margin-left: -8px; border-radius: 50%; color: var(--texto); }
.topo-voltar:hover { background: var(--superficie-2); }
.marca { display: flex; align-items: center; gap: .55rem; text-decoration: none; color: var(--texto); }
.marca img { border-radius: 10px; }
.marca-txt { display: flex; flex-direction: column; line-height: 1.05; }
.marca-txt strong { font-family: var(--fonte-titulo); font-size: 1.15rem; }
.marca-txt small { font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--dourado); font-weight: 700; }
.menu { display: flex; gap: .25rem; margin-left: auto; }
.menu a { padding: .45rem .8rem; border-radius: 999px; text-decoration: none; color: var(--texto-2); font-size: .95rem; font-weight: 500; }
.menu a:hover { color: var(--texto); background: var(--superficie-2); }
.menu a[aria-current="page"] { color: var(--primaria); background: var(--dourado-suave); }
.topo-acoes { display: flex; align-items: center; gap: .35rem; }
.btn-ico { display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; color: var(--texto); cursor: pointer; }
.btn-ico:hover { background: var(--superficie-2); }
.ico-sol { display: none; }
:root[data-tema="escuro"] .ico-sol { display: block; } :root[data-tema="escuro"] .ico-lua { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-tema="claro"]) .ico-sol { display: block; } :root:not([data-tema="claro"]) .ico-lua { display: none; } }
.btn-instalar { display: inline-flex; align-items: center; gap: .4rem; border: 0; cursor: pointer; background: var(--primaria); color: var(--sobre-primaria); padding: .5rem .9rem; border-radius: 999px; font-size: .88rem; font-weight: 650; }
.btn-instalar .ico { width: 18px; height: 18px; }
.btn-instalar[hidden] { display: none; }
@media (max-width: 899px) { .so-desktop { display: none; } .btn-instalar { padding: .45rem .8rem; } }

@media (max-width: 899px) {
  .menu { display: none; }
  .topo-acoes { margin-left: auto; }
  .marca img { width: 30px; height: 30px; }
  body:has(.topo-voltar) .marca-txt small { display: none; }
}

/* ---------- Barra inferior (celular) ---------- */
.barra-app { display: none; }
@media (max-width: 899px) {
  .principal { padding-bottom: calc(var(--barra-h) + 24px + env(safe-area-inset-bottom)); }
  .barra-app {
    display: flex; position: fixed; z-index: 45; left: 0; right: 0; bottom: 0;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--superficie) 90%, transparent);
    backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
    border-top: 1px solid var(--borda);
  }
  .barra-app a, .barra-app button {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px;
    text-decoration: none; color: var(--texto-2); font-size: .7rem; font-weight: 600; border: 0; background: none; cursor: pointer; border-radius: 12px;
  }
  .barra-app button[hidden] { display: none; }
  .barra-app .ico { width: 24px; height: 24px; padding: 2px; border-radius: 999px; transition: background .2s; box-sizing: content-box; padding: 3px 14px; }
  .barra-app [aria-current="page"] { color: var(--primaria); }
  .barra-app [aria-current="page"] .ico { background: var(--dourado-suave); }
  .barra-app button { color: var(--dourado); }
  .rodape { padding-bottom: calc(var(--barra-h) + env(safe-area-inset-bottom)); }
}

/* ---------- Botões e campos ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  border: 0; border-radius: 999px; padding: .72rem 1.25rem; min-height: 46px;
  background: var(--primaria); color: var(--sobre-primaria); font-weight: 650; font-size: .95rem;
  text-decoration: none; cursor: pointer; transition: transform .12s, filter .2s; white-space: nowrap;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(.97); }
.btn .ico { width: 19px; height: 19px; }
.btn-sec { background: var(--superficie); color: var(--texto); box-shadow: inset 0 0 0 1.5px var(--borda); }
.btn-sec:hover { box-shadow: inset 0 0 0 1.5px var(--primaria); filter: none; }
.btn-claro { background: rgba(255,255,255,.12); color: #fff; }
.btn-largo { width: 100%; }
.btn-p { min-height: 38px; padding: .45rem .9rem; font-size: .86rem; }
.btn:disabled { opacity: .55; cursor: default; }

.campo { display: grid; gap: .35rem; font-size: .85rem; font-weight: 650; color: var(--texto-2); }
.campo input, .campo select, .campo textarea, .entrada {
  font: inherit; font-size: 1rem; font-weight: 400; color: var(--texto); width: 100%;
  padding: .7rem .85rem; border: 1.5px solid var(--borda); border-radius: var(--raio-p); background: var(--superficie);
  transition: border-color .2s;
}
.campo input:focus, .campo select:focus, .campo textarea:focus, .entrada:focus { outline: none; border-color: var(--primaria); }

.chips { display: flex; gap: .4rem; overflow-x: auto; scrollbar-width: none; padding: 2px; margin: 0 -2px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1.5px solid var(--borda); background: var(--superficie); color: var(--texto); padding: .42rem .9rem; border-radius: 999px; font-size: .86rem; font-weight: 600; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--primaria); border-color: var(--primaria); color: var(--sobre-primaria); }

/* ---------- Cartões ---------- */
.cartao { background: var(--superficie); border: 1px solid var(--borda); border-radius: var(--raio); padding: 1.25rem; box-shadow: var(--sombra); }

.grade-ferr { display: grid; gap: .7rem; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.ferr {
  display: flex; align-items: center; gap: .9rem; padding: .95rem 1rem; text-decoration: none; color: var(--texto);
  background: var(--superficie); border: 1px solid var(--borda); border-radius: var(--raio); box-shadow: var(--sombra);
  transition: transform .15s, border-color .2s;
}
.ferr:hover { border-color: var(--dourado); }
.ferr:active { transform: scale(.98); }
.ferr-ico { display: grid; place-items: center; width: 50px; height: 50px; flex: none; border-radius: 14px; background: linear-gradient(145deg, var(--primaria), var(--primaria-forte)); color: var(--dourado-suave); }
:root[data-tema="escuro"] .ferr-ico { color: #10201c; }
.ferr-ico .ico { width: 26px; height: 26px; }
.ferr-txt { display: flex; flex-direction: column; min-width: 0; }
.ferr-txt strong { font-size: 1.02rem; }
.ferr-txt span { font-size: .87rem; color: var(--texto-2); line-height: 1.4; }
.ferr-seta { width: 20px; height: 20px; margin-left: auto; color: var(--texto-2); flex: none; }
/* "Em breve": borda tracejada e ícone apagado, mas o texto continua legível */
.ferr.breve { box-shadow: none; background: transparent; border-style: dashed; }
.ferr.breve strong { color: var(--texto-2); }
.ferr.breve .ferr-ico { background: var(--superficie-2); color: var(--texto-2); opacity: .7; }

/* ---------- Conteúdo ---------- */
.trilha { display: flex; flex-wrap: wrap; gap: .35rem; font-size: .82rem; color: var(--texto-2); padding-top: 1rem; }
.trilha a { color: var(--texto-2); }
.cabeca-pagina { padding: .4rem 0 .4rem; }
.resumo-ia {
  border-left: 4px solid var(--dourado); background: var(--dourado-suave); padding: .95rem 1.1rem;
  border-radius: 0 var(--raio-p) var(--raio-p) 0; margin: .4rem 0 1.4rem;
}
.resumo-ia p { margin: 0; }
.artigo { margin-top: 1rem; }
.artigo ul, .artigo ol { padding-left: 1.2rem; }
.artigo li { margin-bottom: .35rem; }
.tabela-rolagem { overflow-x: auto; border: 1px solid var(--borda); border-radius: var(--raio-p); }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { text-align: left; padding: .6rem .75rem; border-bottom: 1px solid var(--borda); }
th { background: var(--superficie-2); font-weight: 650; }
tr:last-child td { border-bottom: 0; }

.faq details { background: var(--superficie); border: 1px solid var(--borda); border-radius: var(--raio-p); margin-bottom: .55rem; }
.faq summary { cursor: pointer; font-weight: 650; padding: .9rem 1rem; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--dourado); font-size: 1.3rem; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 0; padding: 0 1rem 1rem; color: var(--texto-2); }
.outras { margin-top: 2.5rem; }

/* ---------- Anúncios ---------- */
.anuncio { margin: 1.5rem auto; text-align: center; max-width: var(--largura); padding: 0 16px; overflow: hidden; }
.anuncio-rotulo { display: block; font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; color: var(--texto-2); margin-bottom: .3rem; }

/* ---------- Rodapé ---------- */
.rodape { background: #12302b; color: #d9e2dd; margin-top: 3.5rem; }
.rodape-in { max-width: var(--largura); margin: 0 auto; padding: 2.6rem 16px 1.6rem; display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 2rem; }
.rodape .marca { color: #fff; margin-bottom: .8rem; }
.rodape p { font-size: .93rem; line-height: 1.6; max-width: 40ch; color: #b9c6c0; }
.marca-rodape .marca-txt small { color: #e2c27e; }   /* dourado claro sobre o rodapé escuro */
.rodape-tit { font-family: var(--fonte); font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: #e2c27e; margin: .3rem 0 .8rem; }
.rodape ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .55rem; }
.rodape a { color: #d9e2dd; text-decoration: none; font-size: .93rem; }
.rodape a:hover { color: #fff; text-decoration: underline; }
.rodape-sociais { display: flex; gap: 1rem; margin-bottom: 1rem; }
.rodape-dir { text-align: center; font-size: .78rem; padding: 1rem 16px 1.4rem; margin: 0; border-top: 1px solid rgba(255,255,255,.1); color: #8fa39b; }
@media (max-width: 720px) { .rodape-in { grid-template-columns: 1fr 1fr; } .rodape-sobre { grid-column: 1 / -1; } }

/* ---------- Instalação ---------- */
.faixa-instalar {
  position: fixed; z-index: 44; left: 12px; right: 12px; bottom: calc(16px + env(safe-area-inset-bottom));
  max-width: 520px; margin: 0 auto; display: flex; align-items: center; gap: .7rem;
  background: var(--superficie); border: 1px solid var(--borda); border-radius: 18px; padding: .7rem .6rem .7rem .8rem;
  box-shadow: 0 12px 40px rgba(0,0,0,.18); animation: subir .35s ease-out;
}
.faixa-instalar[hidden] { display: none; }
.faixa-instalar img { border-radius: 12px; }
.faixa-instalar div { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; flex: 1; }
.faixa-instalar strong { font-size: .92rem; }
.faixa-instalar span { font-size: .78rem; color: var(--texto-2); }
.faixa-instalar .btn { min-height: 38px; padding: .4rem 1rem; }
@media (max-width: 899px) { .faixa-instalar { bottom: calc(var(--barra-h) + 18px + env(safe-area-inset-bottom)); } }
@keyframes subir { from { transform: translateY(20px); opacity: 0; } }

.folha { border: 0; padding: 0; background: transparent; max-width: 460px; width: calc(100% - 24px); color: var(--texto); }
.folha::backdrop { background: rgba(10, 20, 18, .55); backdrop-filter: blur(3px); }
.folha-in { position: relative; background: var(--superficie); border-radius: 22px; padding: 1.6rem 1.4rem 1.3rem; text-align: center; }
.folha-fechar { position: absolute; top: 10px; right: 10px; }
.folha-ico { border-radius: 18px; box-shadow: var(--sombra); }
.folha h2 { margin: .8rem 0 .3rem; font-size: 1.35rem; }
.folha-sub { color: var(--texto-2); font-size: .93rem; }
.folha-passos { display: none; text-align: left; background: var(--superficie-2); border-radius: 14px; padding: .8rem 1rem .8rem 2.2rem; margin: 0 0 1rem; }
.folha-passos ol { margin: 0; padding: 0; } .folha-passos li { margin: .35rem 0; font-size: .95rem; }
.folha[data-sistema="ios"] [data-sistema="ios"], .folha[data-sistema="outro"] [data-sistema="outro"] { display: block; }
.tecla { display: inline-block; padding: 0 .4rem; border-radius: 6px; background: var(--superficie); border: 1px solid var(--borda); font-weight: 700; }
@media (max-width: 600px) {
  .folha { margin: auto auto 0; width: 100%; max-width: none; }
  .folha-in { border-radius: 22px 22px 0 0; padding-bottom: calc(1.3rem + env(safe-area-inset-bottom)); }
  .folha[open] { animation: subir .3s ease-out; }
}

/* ---------- Aviso rápido (toast) ---------- */
.aviso-toast {
  position: fixed; z-index: 60; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translate(-50%, 30px);
  background: #1c2a27; color: #fff; padding: .7rem 1.1rem; border-radius: 999px; font-size: .9rem; font-weight: 600;
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; max-width: calc(100% - 32px); text-align: center;
}
.aviso-toast.mostrar { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 899px) { .aviso-toast { bottom: calc(var(--barra-h) + 22px + env(safe-area-inset-bottom)); } }

/* ---------- App instalado (sem barra do navegador) ---------- */
@media (display-mode: standalone) {
  .js-instalar, .js-instalar-sempre, .faixa-instalar, .cartao-instalar { display: none !important; }
  body { user-select: none; -webkit-user-select: none; }
  .principal :is(p, li, td, article, pre, input, textarea) { user-select: text; -webkit-user-select: text; }
}

/* ---------- Impressão ---------- */
@media print {
  .topo, .rodape, .barra-app, .anuncio, .trilha, .faixa-instalar, .nao-imprimir { display: none !important; }
  body { background: #fff; color: #000; font-size: 12pt; }
  .principal { padding: 0 !important; }
  .cartao { box-shadow: none; border: 0; padding: 0; }
}
