:root {
  --bg: #f6f6f3;
  --surface: #ffffff;
  --surface-2: #f0f0ec;
  --text: #15171a;
  --muted: #676b73;
  --line: #e6e6e1;
  --accent: #7a5c16;
  --accent-soft: #f4eddc;
  --botao: #15171a;
  --botao-texto: #ffffff;
  --danger: #b42318;
  --radius: 18px;
  --shadow: 0 1px 2px rgb(20 20 20 / .04), 0 8px 24px rgb(20 20 20 / .05);
  --veu: rgb(246 246 243 / .8);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1113;
    --surface: #17191c;
    --surface-2: #1f2226;
    --text: #eceef0;
    --muted: #9aa0a8;
    --line: #2a2d32;
    --accent: #d4b05a;
    --accent-soft: #2b2415;
    --botao: #d4b05a;
    --botao-texto: #17140c;
    --danger: #f97066;
    --shadow: none;
    --veu: rgb(15 17 19 / .86);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0f1113;
  --surface: #17191c;
  --surface-2: #1f2226;
  --text: #eceef0;
  --muted: #9aa0a8;
  --line: #2a2d32;
  --accent: #d4b05a;
  --accent-soft: #2b2415;
  --botao: #d4b05a;
  --botao-texto: #17140c;
  --danger: #f97066;
  --shadow: none;
  --veu: rgb(15 17 19 / .86);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.5 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
}
/* Imagem de fundo: desfocada e coberta por um véu da cor do tema */
body::before, body::after { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; }
body::before { background: url("/img/fundo.jpg") center / cover no-repeat; filter: blur(3px); transform: scale(1.06); }
body::after { background: var(--veu); }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; letter-spacing: -.02em; line-height: 1.15; }
.ic { width: 20px; height: 20px; flex: none; }

/* Topo */
.topo {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px max(16px, calc((100% - 960px) / 2));
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.marca { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -.01em; }
.marca img { border-radius: 10px; background: #fff; box-shadow: 0 0 0 1px var(--line); }
.topo-acoes { display: flex; align-items: center; gap: 8px; }
.tema {
  display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 50%;
  background: var(--surface); color: var(--text); cursor: pointer;
}
.tema:hover { border-color: var(--accent); color: var(--accent); }
.tema .ic { width: 18px; height: 18px; }
.menu { display: none; gap: 4px; }
.menu a { padding: 8px 14px; border-radius: 999px; color: var(--muted); font-weight: 500; font-size: 15px; }
.menu a:hover { color: var(--text); }
.menu a.ativo { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

main { max-width: 960px; margin: 0 auto; padding: 0 16px; outline: none; }

/* Abas inferiores (celular) */
.abas {
  position: fixed; inset: auto 0 0 0; z-index: 10;
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  background: var(--surface);
  border-top: 1px solid var(--line);
}
.abas a {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 7px 4px; border-radius: 12px;
  color: var(--muted); font-size: 11px; font-weight: 500; white-space: nowrap;
}
.abas a.ativo { color: var(--accent); background: var(--accent-soft); }

@media (min-width: 760px) {
  body { padding-bottom: 0; }
  .menu { display: flex; }
  .abas { display: none; }
}

/* Início */
.hero { padding: 48px 0 28px; }
.selo {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
  font-size: 13px; font-weight: 600;
}
.selo .ic { width: 15px; height: 15px; }
.hero h1 { margin-top: 18px; font-size: clamp(32px, 7vw, 52px); font-weight: 700; }
.hero p { max-width: 520px; margin: 14px 0 0; color: var(--muted); font-size: 17px; }
.instalar-app { margin-top: 20px; }

.opcoes { display: grid; gap: 12px; }
@media (min-width: 760px) { .opcoes { grid-template-columns: repeat(2, 1fr); } }
.opcao {
  position: relative; display: flex; flex-direction: column; gap: 14px;
  padding: 22px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
  transition: transform .15s ease, border-color .15s ease;
}
.opcao:hover { transform: translateY(-2px); border-color: var(--accent); }
.opcao-icone, .cabecalho-icone {
  display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px;
  background: var(--accent-soft); color: var(--accent);
}
.opcao-icone .ic, .cabecalho-icone .ic { width: 22px; height: 22px; }
.opcao-texto { display: grid; gap: 6px; }
.opcao-texto strong { font-size: 17px; letter-spacing: -.01em; }
.opcao-texto small { color: var(--muted); font-size: 14px; }
.opcao-qtd { margin-top: auto; color: var(--muted); font-size: 13px; font-weight: 500; }
.opcao-seta { position: absolute; right: 22px; bottom: 22px; color: var(--accent); }

.passos { margin: 40px 0 24px; }
.passos h2 { font-size: 20px; margin-bottom: 14px; }
.passos ol { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
@media (min-width: 760px) { .passos ol { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); } }
.passos li { display: flex; gap: 14px; padding: 18px; border-radius: var(--radius); background: var(--surface-2); }
.passos b {
  display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 50%;
  background: var(--text); color: var(--bg); font-size: 14px;
}
.passos div { display: grid; gap: 2px; }
.passos span { color: var(--muted); font-size: 14px; }

/* Categoria */
.cabecalho { display: flex; gap: 16px; align-items: flex-start; padding: 36px 0 22px; }
.cabecalho h1 { font-size: clamp(24px, 5vw, 34px); }
.cabecalho p { margin: 6px 0 0; color: var(--muted); }

.subabas {
  display: flex; gap: 6px; overflow-x: auto; margin: 0 -16px 18px; padding: 0 16px 2px;
  scrollbar-width: none;
}
.subabas::-webkit-scrollbar { display: none; }
.subabas a {
  flex: none; padding: 9px 16px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface);
  color: var(--muted); font-size: 14px; font-weight: 500; white-space: nowrap;
}
.subabas a.ativo { background: var(--text); border-color: var(--text); color: var(--bg); }

.lista { display: grid; gap: 12px; padding-bottom: 24px; }
.doc {
  display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between;
  padding: 20px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.doc-corpo { flex: 1 1 320px; }
.doc h3 { font-size: 17px; }
.doc p { margin: 6px 0 12px; color: var(--muted); font-size: 14.5px; }
.formatos { display: flex; gap: 6px; }
.formatos span {
  padding: 3px 9px; border-radius: 7px; background: var(--surface-2);
  color: var(--muted); font-size: 12px; font-weight: 600;
}
.doc-acao { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-left: auto; }
.doc-acao strong { margin-right: 4px; }
.doc-acao strong { font-size: 17px; }
.vazio { color: var(--muted); padding: 24px 0; }
.doc-em-breve { box-shadow: none; background: color-mix(in srgb, var(--surface) 70%, transparent); }
.doc-em-breve h3, .doc-em-breve p { opacity: .7; }
.etiqueta {
  padding: 6px 12px; border-radius: 999px; background: var(--surface-2);
  color: var(--muted); font-size: 13px; font-weight: 600;
}

/* Botões */
.botao {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px; border: 0; border-radius: 12px;
  background: var(--botao); color: var(--botao-texto);
  font-family: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
  transition: filter .15s ease, transform .1s ease;
}
.botao:hover { filter: brightness(1.08); }
.botao:active { transform: scale(.98); }
.botao:disabled { opacity: .6; cursor: progress; }
.botao-sec { background: var(--accent-soft); color: var(--accent); }
.botao-largo { width: 100%; min-height: 50px; }
.botao .ic { width: 18px; height: 18px; }

/* Modal */
dialog {
  width: min(440px, calc(100% - 24px)); max-height: calc(100dvh - 24px);
  padding: 0; border: 0; border-radius: 24px;
  background: var(--surface); color: var(--text);
  box-shadow: 0 24px 64px rgb(0 0 0 / .25);
}
dialog::backdrop { background: rgb(10 12 14 / .5); backdrop-filter: blur(3px); }
dialog[open] { animation: subir .22s ease; }
@keyframes subir { from { opacity: 0; transform: translateY(12px); } }
.modal { position: relative; padding: 26px 22px 22px; }
.fechar {
  position: absolute; top: 14px; right: 14px; display: grid; place-items: center;
  width: 36px; height: 36px; border: 0; border-radius: 50%;
  background: var(--surface-2); color: var(--muted); cursor: pointer;
}
.fechar .ic { width: 18px; height: 18px; }
.modal-tipo { margin: 0 44px 6px 0; color: var(--accent); font-size: 13px; font-weight: 600; }
.modal h2 { font-size: 26px; }
.modal h2 small { color: var(--muted); font-size: 15px; font-weight: 500; letter-spacing: 0; }
.modal-texto { margin: 8px 0 20px; color: var(--muted); font-size: 15px; }
.modal label { display: block; margin: 0 0 6px; font-size: 14px; font-weight: 600; }
.modal input {
  width: 100%; min-height: 48px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--bg); color: var(--text); font: inherit;
}
.modal input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.ajuda { display: block; margin: 8px 0 18px; color: var(--muted); font-size: 13px; }
.erro { margin: -6px 0 14px; color: var(--danger); font-size: 14px; font-weight: 500; }

.qr { display: grid; place-items: center; margin: 18px 0; }
.qr img { width: 220px; height: 220px; padding: 10px; border-radius: 16px; background: #fff; }
.qr-demo {
  display: grid; place-items: center; width: 220px; height: 220px; padding: 20px;
  border: 2px dashed var(--line); border-radius: 16px;
  color: var(--muted); font-weight: 600; text-align: center;
}
.qr-demo small { font-weight: 400; }
.copia { display: flex; gap: 8px; }
.copia input { min-width: 0; font-size: 13px; color: var(--muted); }
.aguardando { display: flex; align-items: center; gap: 10px; margin: 18px 0 0; font-weight: 500; font-size: 15px; }
#tempo { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }
.pulso { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); animation: pulso 1.2s ease-in-out infinite; }
@keyframes pulso { 50% { opacity: .25; transform: scale(.7); } }

.sucesso {
  display: grid; place-items: center; width: 56px; height: 56px; margin: 6px 0 16px;
  border-radius: 50%; background: var(--accent-soft); color: var(--accent);
}
.sucesso .ic { width: 28px; height: 28px; stroke-width: 2.5; }
.downloads { display: grid; gap: 10px; }
.ajuda-whatsapp {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: 4px; padding: 12px; border-radius: 12px;
  background: #e8f8ee; color: #136c3a; font-size: 14.5px; font-weight: 600;
}
.ajuda-whatsapp:hover { filter: brightness(.97); }
.ajuda-whatsapp .ic { width: 18px; height: 18px; }
:root[data-theme="dark"] .ajuda-whatsapp { background: #12301f; color: #6ee7a0; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ajuda-whatsapp { background: #12301f; color: #6ee7a0; } }
.instrucoes { display: grid; gap: 14px; margin: 20px 0 4px; padding: 0; list-style: none; }
.instrucoes li { display: flex; align-items: center; gap: 14px; }
.instrucoes span {
  display: grid; place-items: center; flex: none; width: 40px; height: 40px;
  border-radius: 12px; background: var(--accent-soft); color: var(--accent);
}
.instrucoes p { margin: 0; font-size: 15px; }

/* Formulário */
.faixa-whatsapp {
  display: flex; align-items: center; gap: 14px; margin-bottom: 14px;
  padding: 14px 16px; border-radius: var(--radius);
  background: #e8f8ee; color: #0f5130; border: 1px solid #bfe9cf; font-size: 14.5px;
}
.faixa-whatsapp strong { display: block; font-size: 15px; }
.faixa-whatsapp > .ic { margin-left: auto; flex: none; }
.faixa-icone { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 50%; background: #25d366; color: #fff; }
.faixa-whatsapp:hover { filter: brightness(.98); }
:root[data-theme="dark"] .faixa-whatsapp { background: #12301f; color: #b7f0cd; border-color: #1f4d33; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .faixa-whatsapp { background: #12301f; color: #b7f0cd; border-color: #1f4d33; } }
.cabecalho-form { flex-direction: column; gap: 10px; }
.voltar { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 14px; font-weight: 500; }
.voltar:hover { color: var(--text); }
.voltar .ic { width: 18px; height: 18px; }
#formulario { display: grid; gap: 14px; padding-bottom: 24px; }
.secao {
  padding: 20px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.secao h2 { font-size: 18px; margin-bottom: 14px; }
.secao-ajuda { margin: -6px 0 14px; color: var(--muted); font-size: 14px; }
.grade { display: grid; gap: 14px; }
@media (min-width: 600px) {
  .grade { grid-template-columns: 1fr 1fr; }
  .campo:not(.meia) { grid-column: 1 / -1; }
}
.campo label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 600; }
.campo label small { color: var(--muted); font-weight: 400; }
.campo input, .campo select, .campo textarea {
  width: 100%; min-height: 46px; padding: 10px 14px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--bg); color: var(--text); font: inherit; font-size: 16px;
}
.campo textarea { resize: vertical; min-height: 70px; }
.campo input:focus, .campo select:focus, .campo textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.entrada.com-prefixo { position: relative; }
.prefixo { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 15px; pointer-events: none; }
.com-prefixo input { padding-left: 42px; }
.entrada.com-sufixo { position: relative; }
.sufixo { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 15px; pointer-events: none; }
.com-sufixo input { padding-right: 44px; }
.ajuda-campo { display: block; margin-top: 5px; color: var(--muted); font-size: 12.5px; }
.campo.invalido input, .campo.invalido select, .campo.invalido textarea { border-color: var(--danger); }
.erro-campo { display: block; margin-top: 5px; color: var(--danger); font-size: 13px; font-weight: 500; }

.pessoa { position: relative; margin: 0 0 12px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; }
.pessoa legend { padding: 0 6px; font-size: 13px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .04em; }
.remover {
  position: absolute; top: -6px; right: 10px; display: grid; place-items: center;
  width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 50%;
  background: var(--surface); color: var(--muted); cursor: pointer;
}
.remover:hover { color: var(--danger); border-color: var(--danger); }
.remover .ic { width: 16px; height: 16px; }
.importar { margin-bottom: 16px; }
.importar-btn { width: 100%; min-height: 46px; font-size: 14.5px; border: 1px dashed var(--accent); }
.importar-btn .pulso { margin-right: 4px; }
.importar-msg { margin: 8px 0 0; font-size: 13.5px; font-weight: 500; color: var(--accent); }
.importar-msg.erro { color: var(--danger); }
.conjuge { margin-top: 16px; padding-top: 16px; border-top: 1px dashed var(--line); }
.conjuge h3 { font-size: 15px; margin-bottom: 12px; }
.conjuge h3 small { color: var(--muted); font-weight: 400; }
.adicionar { min-height: 40px; font-size: 14px; }

.form-fim {
  position: sticky; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); box-shadow: 0 8px 30px rgb(0 0 0 / .12);
}
.form-fim div { display: grid; }
.form-fim strong { font-size: 18px; }
.form-fim small { color: var(--muted); font-size: 12.5px; }
@media (min-width: 760px) { .form-fim { bottom: 16px; } }

.rodape { max-width: 960px; margin: 0 auto; padding: 24px 16px 32px; color: var(--muted); font-size: 13px; text-align: center; }
.rodape-seo { max-width: 680px; margin: 0 auto 20px; padding-top: 20px; border-top: 1px solid var(--line); text-align: left; line-height: 1.6; }
.rodape-seo h2 { font-size: 14px; margin: 0 0 8px; color: var(--text); }
.rodape-seo p { margin: 0 0 8px; }
.rodape-seo a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
