:root {
  --azul: #2b3a72;
  --primaria: #405189;
  --primaria-escura: #34436f;
  --texto: #212529;
  --suave: #5c6670;
  --fundo: #f3f6f9;
  --cartao: #ffffff;
  --borda: #dfe4ea;
  --erro: #b3261e;
  --erro-fundo: #fdecea;
  --aviso: #8a5a00;
  --raio: 6px;
  color-scheme: light;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  color: var(--texto);
  background: var(--fundo);
}

.topo {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  padding-top: max(10px, env(safe-area-inset-top));
  background: var(--azul);
  color: #fff;
}
.topo img { border-radius: 50%; background: #fff; }
.marca { font-weight: 600; font-size: 1.05rem; }
.selo {
  font-size: .72rem;
  padding: 2px 6px;
  border-radius: 999px;
  background: #ffd36a;
  color: #3d2b00;
  font-weight: 600;
}
.usuario { margin-left: auto; font-size: .85rem; opacity: .9; max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

main { flex: 1; width: 100%; max-width: 640px; margin: 0 auto; padding: 16px; outline: none; }

h1 { font-size: 1.3rem; margin: 8px 0 12px; }
h2 { font-size: 1.05rem; margin: 20px 0 8px; }

label { display: block; font-weight: 500; margin: 12px 0 4px; }
input, textarea {
  width: 100%;
  font: inherit;
  padding: 10px 12px;
  min-height: 44px;
  border: 1px solid #b8c0c9;
  border-radius: var(--raio);
  background: #fff;
  color: var(--texto);
}
input:focus-visible, textarea:focus-visible, button:focus-visible {
  outline: 3px solid #8ea4e6;
  outline-offset: 2px;
}
textarea { resize: vertical; }

.botao {
  display: block;
  width: 100%;
  margin-top: 16px;
  min-height: 46px;
  font: inherit;
  font-weight: 600;
  color: #fff;
  background: var(--primaria);
  border: 0;
  border-radius: var(--raio);
  cursor: pointer;
}
.botao:hover { background: var(--primaria-escura); }
.botao[disabled] { opacity: .6; cursor: progress; }
.botao.secundario { background: #fff; color: var(--primaria); border: 1px solid var(--primaria); }

.link {
  font: inherit;
  color: var(--primaria);
  background: none;
  border: 0;
  padding: 8px 0;
  min-height: 44px;
  text-decoration: underline;
  cursor: pointer;
}
.link.claro { color: #fff; padding: 8px 4px; }
.usuario + .link.claro, .link.claro { margin-left: 0; }

.info { color: var(--suave); font-size: .92rem; }
.erro { color: var(--erro); background: var(--erro-fundo); padding: 10px 12px; border-radius: var(--raio); margin: 12px 0 0; }

.abas { display: flex; gap: 8px; margin-bottom: 8px; }
.aba {
  flex: 1;
  min-height: 44px;
  font: inherit;
  font-weight: 500;
  background: #fff;
  color: var(--suave);
  border: 1px solid var(--borda);
  border-radius: var(--raio);
  cursor: pointer;
}
.aba[aria-pressed="true"] { color: #fff; background: var(--primaria); border-color: var(--primaria); }

.lista { list-style: none; margin: 0; padding: 0; }
.lista li + li { margin-top: 8px; }

.cartao {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  background: var(--cartao);
  border: 1px solid var(--borda);
  border-radius: var(--raio);
  padding: 12px 14px;
}
button.cartao { cursor: pointer; }
button.cartao:hover { border-color: var(--primaria); }
.cartao .linha { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.cartao .titulo { font-weight: 600; overflow-wrap: anywhere; }
.cartao .valor { font-weight: 600; white-space: nowrap; }
.cartao .detalhe { color: var(--suave); font-size: .88rem; overflow-wrap: anywhere; }
.vence-logo { color: var(--aviso); font-weight: 600; }

.dados { display: grid; grid-template-columns: max-content 1fr; gap: 6px 12px; margin: 0; background: #fff; border: 1px solid var(--borda); border-radius: var(--raio); padding: 12px 14px; }
.dados dt { color: var(--suave); font-size: .9rem; }
.dados dd { margin: 0; overflow-wrap: anywhere; }

.resposta { margin-top: 16px; white-space: pre-wrap; }
.resposta ul { margin: 8px 0 0; padding-left: 20px; white-space: normal; color: var(--suave); font-size: .92rem; }

.voltar { margin-bottom: 4px; }

.rodape { padding: 12px 16px; padding-bottom: max(12px, env(safe-area-inset-bottom)); text-align: center; color: var(--suave); font-size: .78rem; }
.rodape p { margin: 0; }

[hidden] { display: none !important; }
