/* Base: reset leve, tipografia, componentes mínimos. Cores só via tokens.css. */

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--fonte);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--texto);
  background: var(--fundo);
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3, p, ul, ol, figure {
  margin: 0;
}

h1 { font-size: 1.5rem; line-height: 1.25; }
h2 { font-size: 1.25rem; line-height: 1.3; }
h3 { font-size: 1.0625rem; line-height: 1.35; }

img, svg {
  display: block;
  max-width: 100%;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

.texto-2 {
  color: var(--texto-2);
}

/* Área segura do iPhone (requer viewport-fit=cover no meta viewport) */
.app {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-top: env(safe-area-inset-top);
  padding-right: max(16px, env(safe-area-inset-right));
  padding-bottom: env(safe-area-inset-bottom);
  padding-left: max(16px, env(safe-area-inset-left));
}

.conteudo {
  flex: 1;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 16px 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Botão em pílula */
.botao {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 24px;
  border: 0;
  border-radius: var(--raio-botao);
  background: var(--primaria);
  color: var(--primaria-texto);
  font-weight: bold;
  text-decoration: none;
  cursor: pointer;
}

.botao:focus-visible {
  outline: 3px solid var(--texto);
  outline-offset: 2px;
}

.botao:disabled {
  opacity: 0.5;
  cursor: default;
}

.botao--secundario {
  background: var(--suave);
  color: var(--texto);
}

/* Cartão */
.cartao {
  background: var(--superficie);
  color: var(--texto);
  border: 1px solid var(--borda);
  border-radius: var(--raio-cartao);
  padding: 16px;
}

/* Aviso de nova versão (js/sw-registro.js) */
.aviso-versao {
  position: fixed;
  left: max(16px, env(safe-area-inset-left));
  right: max(16px, env(safe-area-inset-right));
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 10;
  max-width: 448px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 12px 12px 16px;
  background: var(--superficie);
  color: var(--texto);
  border: 2px solid var(--primaria);
  border-radius: var(--raio-cartao);
}

.aviso-versao[hidden] {
  display: none;
}

/* Rodapé fixo de uma linha */
.rodape {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 8px 0;
  font-size: 0.8125rem;
  text-align: center;
  color: var(--texto-2);
  border-top: 1px solid var(--borda);
}
