:root {
  --roxo-escuro: #2A0052;
  --roxo-texto: #3C096C;
  --roxo: #52168D;
  --roxo-medio: #752AB7;
  --lilas: #CA85FF;
  --lilas-claro: #F0D6FF;
  --papel: #F1ECE6;
  --linha: #E9E2DE;
  --branco: #FFFFFF;
  --topo-seguro: env(safe-area-inset-top, 0px);
  --base-segura: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--roxo-escuro);
  background-color: var(--papel);
  background-image: linear-gradient(var(--linha) 1px, transparent 1px), linear-gradient(90deg, var(--linha) 1px, transparent 1px);
  background-size: 16px 16px;
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
button, input { font-family: inherit; }
a { color: var(--roxo); }
img { display: block; }

.tela {
  max-width: 520px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  padding: calc(28px + var(--topo-seguro)) 20px calc(110px + var(--base-segura)) 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.tela.sem-menu { padding-bottom: calc(32px + var(--base-segura)); }

h1 { margin: 0; font-size: 28px; line-height: 1.2; font-weight: 800; }
h2 { margin: 4px 0 0 0; font-size: 20px; font-weight: 800; }
.sub { margin: -8px 0 0 0; font-size: 16px; line-height: 1.45; color: var(--roxo-texto); }

/* ---------- Entrar ---------- */
.entrar { justify-content: flex-start; padding-top: calc(72px + var(--topo-seguro)); }
.entrar .marca { display: flex; flex-direction: column; align-items: center; gap: 20px; margin-top: 30px; }
.entrar .marca img { width: 210px; height: auto; }
.entrar .marca p { margin: 0; font-size: 18px; line-height: 1.45; text-align: center; color: var(--roxo-texto); }
.form { display: flex; flex-direction: column; gap: 12px; margin-top: 36px; }
.recado { background: var(--lilas-claro); border-radius: 16px; padding: 14px 16px; display: flex; gap: 12px; align-items: flex-start; }
.recado p { margin: 0; font-size: 16px; line-height: 1.45; font-weight: 700; }
.recado svg { flex-shrink: 0; margin-top: 1px; }
label.rotulo { font-size: 16px; font-weight: 700; margin-top: 8px; }
.campo { height: 56px; border-radius: 16px; border: 2px solid var(--lilas); background: var(--branco); padding: 0 18px; font-size: 17px; color: var(--roxo-escuro); width: 100%; outline: none; }
.campo:focus { border-color: var(--roxo-medio); }
.erro { margin: 0; font-size: 15px; line-height: 1.45; color: #9B1C4B; font-weight: 600; }
.rodape-entrar { margin-top: auto; padding-top: 32px; font-size: 14px; line-height: 1.5; color: var(--roxo-texto); text-align: center; }
.rodape-entrar a { font-weight: 700; }

/* ---------- Botões ---------- */
.botao {
  min-height: 56px; border-radius: 16px; border: none; background: var(--roxo); color: var(--branco);
  font-size: 18px; font-weight: 800; display: flex; align-items: center; justify-content: center; gap: 10px;
  text-decoration: none; cursor: pointer; padding: 0 18px; width: 100%;
}
.botao:active { transform: translateY(1px); }
.botao[disabled] { opacity: 0.6; }
.botao.claro { background: var(--branco); color: var(--roxo); border: 2px solid var(--lilas-claro); }
.botao.lilas { background: var(--lilas-claro); color: var(--roxo); }
.voltar {
  width: 48px; height: 48px; flex: 0 0 48px; align-self: flex-start; border-radius: 50%; background: var(--branco);
  border: 2px solid var(--lilas-claro); display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0;
}

/* ---------- Início ---------- */
.topo { display: flex; align-items: center; justify-content: space-between; }
.topo img { height: 30px; width: auto; }
.redondo { width: 44px; height: 44px; border-radius: 22px; border: 2px solid var(--lilas); background: var(--branco); display: flex; align-items: center; justify-content: center; padding: 0; cursor: pointer; }
.busca { height: 52px; border-radius: 16px; background: rgba(255,255,255,0.55); border: 2px solid var(--lilas-claro); display: flex; align-items: center; gap: 10px; padding: 0 16px; }
.busca input { border: none; outline: none; flex-grow: 1; font-size: 16px; color: var(--roxo-escuro); background: transparent; min-width: 0; }
.busca input::placeholder { color: var(--roxo-texto); opacity: 0.7; }
.novidade { border-radius: 20px; background: var(--roxo); color: var(--branco); text-decoration: none; display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; gap: 12px; cursor: pointer; border: none; text-align: left; width: 100%; }
.novidade .txt { display: flex; flex-direction: column; gap: 4px; }
.novidade small { font-size: 13px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--lilas-claro); }
.novidade strong { font-size: 22px; font-weight: 800; line-height: 1.2; }
.novidade span { font-size: 15px; color: var(--lilas-claro); }
.novidade img { width: 64px; height: 64px; flex-shrink: 0; }

.grade-cat { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.cat { background: var(--branco); border-radius: 18px; padding: 14px 8px 12px 8px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-decoration: none; border: 2px solid var(--lilas-claro); cursor: pointer; }
.cat .ico { width: 52px; height: 52px; border-radius: 14px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.cat .ico img { width: 46px; height: 46px; object-fit: contain; }
.cat span { font-size: 14px; font-weight: 700; color: var(--roxo-escuro); text-align: center; line-height: 1.2; }

/* ---------- Categoria / busca ---------- */
.lista-temas { display: flex; flex-direction: column; gap: 10px; }
.tema { background: var(--branco); border-radius: 18px; border: 2px solid var(--lilas-claro); padding: 14px 16px; display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--roxo-escuro); cursor: pointer; }
.tema .nome { flex-grow: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tema .nome strong { font-size: 17px; font-weight: 800; }
.tema .nome small { font-size: 13px; color: var(--roxo-texto); }
.tema .amostra { display: flex; gap: 4px; flex-shrink: 0; }
.tema .amostra img { width: 40px; height: 40px; object-fit: contain; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { background: var(--branco); border: 2px solid var(--lilas); border-radius: 999px; padding: 8px 14px; font-size: 15px; font-weight: 700; color: var(--roxo); cursor: pointer; }
.vazio { margin: 12px 0; font-size: 16px; line-height: 1.5; color: var(--roxo-texto); text-align: center; }

/* ---------- Tema ---------- */
.grade-fig { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.fig { aspect-ratio: 1 / 1; background: var(--branco); border-radius: 16px; border: 2px solid var(--lilas-claro); padding: 8px; display: flex; align-items: center; justify-content: center; cursor: pointer; position: relative; }
.fig img { width: 100%; height: 100%; object-fit: contain; }
.mais { margin-top: 6px; }

/* ---------- Figurinha ---------- */
.palco { background: var(--branco); border-radius: 24px; border: 2px solid var(--lilas-claro); aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center; padding: 22px;
  background-image: linear-gradient(45deg, #F6F2F9 25%, transparent 25%), linear-gradient(-45deg, #F6F2F9 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #F6F2F9 75%), linear-gradient(-45deg, transparent 75%, #F6F2F9 75%);
  background-size: 24px 24px; background-position: 0 0, 0 12px, 12px -12px, -12px 0; }
.palco img { max-width: 100%; max-height: 100%; object-fit: contain; }
.acoes { display: flex; flex-direction: column; gap: 10px; }
.dica { margin: 0; font-size: 15px; line-height: 1.5; color: var(--roxo-texto); text-align: center; }

/* ---------- Como usar ---------- */
.passo { background: var(--branco); border-radius: 18px; border: 2px solid var(--lilas-claro); padding: 16px; display: flex; gap: 14px; align-items: flex-start; }
.passo .n { width: 36px; height: 36px; border-radius: 12px; background: var(--roxo); color: var(--branco); font-size: 18px; font-weight: 800; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.passo .t { display: flex; flex-direction: column; gap: 4px; }
.passo strong { font-size: 17px; font-weight: 800; }
.passo span { font-size: 15px; line-height: 1.45; color: var(--roxo-texto); }
.caixa-roxa { background: var(--roxo); border-radius: 20px; padding: 18px; display: flex; flex-direction: column; gap: 10px; color: var(--branco); }
.caixa-roxa .cab { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 800; }
.caixa-roxa p { margin: 0; font-size: 15px; line-height: 1.5; color: var(--lilas-claro); }
.caixa-roxa p strong { color: var(--branco); }
.conta { background: var(--branco); border-radius: 18px; border: 2px solid var(--lilas-claro); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.conta p { margin: 0; font-size: 15px; line-height: 1.5; color: var(--roxo-texto); }
.pe { margin: 0; font-size: 14px; line-height: 1.5; color: var(--roxo-texto); text-align: center; }

/* ---------- Menu de baixo ---------- */
.menu { position: fixed; left: 0; right: 0; bottom: 0; background: var(--branco); border-top: 1px solid var(--lilas-claro); padding-bottom: var(--base-segura); z-index: 10; }
.menu nav { max-width: 520px; margin: 0 auto; height: 70px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.menu a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-decoration: none; color: var(--roxo-medio); font-size: 13px; font-weight: 700; }
.menu a.ativo { color: var(--roxo); font-weight: 800; }

/* ---------- Aviso ---------- */
#aviso {
  position: fixed; left: 50%; bottom: calc(92px + var(--base-segura)); transform: translateX(-50%); z-index: 20;
  background: var(--roxo-escuro); color: var(--branco); padding: 14px 18px; border-radius: 16px; font-size: 15px; font-weight: 700;
  line-height: 1.4; width: calc(100% - 40px); max-width: 480px; text-align: center; box-shadow: 0 10px 30px rgba(42,0,82,0.3);
}

.carregando { margin: 40px 0; text-align: center; color: var(--roxo-texto); font-size: 16px; }
