/* =========================================================================
   IDD Escola — estilos principais
   Visual jovem, mobile-first, cantos arredondados, cores vivas.
   ========================================================================= */

:root {
  --azul: #3b82f6;
  --azul-escuro: #2563eb;
  --roxo: #8b5cf6;
  --verde: #22c55e;
  --amarelo: #eab308;
  --laranja: #f97316;
  --vermelho: #ef4444;
  --vermelho-escuro: #b91c1c;

  --fundo: #f4f6fb;
  --cartao: #ffffff;
  --texto: #1f2937;
  --texto-suave: #6b7280;
  --borda: #e5e7eb;

  --raio: 22px;
  --raio-pequeno: 14px;
  --sombra: 0 10px 30px rgba(30, 41, 59, 0.08);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: linear-gradient(160deg, #eef2ff 0%, #f4f6fb 40%, #fdf4ff 100%);
  font-family: "Poppins", "Nunito", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--texto);
}

.tela {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-height: 100vh;
  padding: 24px 14px 48px;
}

.app-shell {
  width: 100%;
  max-width: 460px;
  background: var(--cartao);
  border-radius: 28px;
  box-shadow: var(--sombra);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.6);
}

/* ---------- Barra superior estilo "app" ---------- */
.app-topbar {
  background: linear-gradient(120deg, var(--azul) 0%, var(--roxo) 100%);
  color: #fff;
  padding: 18px 20px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.app-topbar .logo {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.app-topbar .titulos { line-height: 1.15; }
.app-topbar h1 { margin: 0; font-size: 17px; font-weight: 700; }
.app-topbar p { margin: 2px 0 0; font-size: 12px; opacity: 0.9; }

/* ---------- Barra de progresso (sem timer, só etapas) ---------- */
.progresso {
  display: flex;
  gap: 6px;
  padding: 14px 20px 0;
}
.progresso .passo {
  flex: 1;
  height: 6px;
  border-radius: 99px;
  background: var(--borda);
  transition: background .25s;
}
.progresso .passo.ativo,
.progresso .passo.concluido { background: var(--azul); }

.progresso-label {
  padding: 6px 20px 0;
  font-size: 12px;
  color: var(--texto-suave);
  font-weight: 600;
}

/* ---------- Conteúdo das etapas ---------- */
.etapa { display: none; padding: 22px 22px 24px; animation: entra .25s ease; }
.etapa.ativa { display: block; }

@keyframes entra {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.etapa h2 {
  font-size: 19px;
  margin: 0 0 6px;
  font-weight: 750;
}
.etapa .subtitulo {
  color: var(--texto-suave);
  font-size: 13.5px;
  margin: 0 0 18px;
  line-height: 1.5;
}

/* ---------- Cartão de boas-vindas ---------- */
.hero-emoji {
  font-size: 46px;
  text-align: center;
  margin-bottom: 6px;
}
.lista-consentimento {
  background: #f8fafc;
  border: 1px solid var(--borda);
  border-radius: var(--raio-pequeno);
  padding: 14px 16px;
  font-size: 13px;
  color: var(--texto-suave);
  line-height: 1.6;
  margin: 14px 0 4px;
}
.lista-consentimento b { color: var(--texto); }

/* ---------- Campos de formulário ---------- */
.campo { margin-bottom: 18px; }
.campo label.rotulo-campo {
  display: block;
  font-weight: 700;
  font-size: 13.5px;
  margin-bottom: 8px;
}

input[type="number"], select {
  width: 100%;
  padding: 13px 14px;
  border-radius: var(--raio-pequeno);
  border: 1.5px solid var(--borda);
  font-size: 15px;
  font-family: inherit;
  background: #fff;
  color: var(--texto);
}
input[type="number"]:focus, select:focus {
  outline: none;
  border-color: var(--azul);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
}

.grupo-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  position: relative;
}
.pill input { position: absolute; opacity: 0; pointer-events: none; }
.pill span {
  display: inline-flex;
  align-items: center;
  padding: 10px 16px;
  border-radius: 99px;
  border: 1.5px solid var(--borda);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--texto-suave);
  cursor: pointer;
  transition: all .15s;
  user-select: none;
}
.pill input:checked + span {
  background: var(--azul);
  border-color: var(--azul);
  color: #fff;
}

/* ---------- Opções de pergunta (descrição, não número) ---------- */
.opcoes-pergunta { display: flex; flex-direction: column; gap: 10px; }
.opcao {
  position: relative;
}
.opcao input { position: absolute; opacity: 0; pointer-events: none; }
.opcao span {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 14px;
  border-radius: var(--raio-pequeno);
  border: 1.5px solid var(--borda);
  font-size: 14px;
  color: var(--texto);
  cursor: pointer;
  transition: all .15s;
}
.opcao span::before {
  content: "";
  width: 18px;
  height: 18px;
  min-width: 18px;
  border-radius: 50%;
  border: 2px solid var(--borda);
  transition: all .15s;
}
.opcao input:checked + span {
  background: #eff6ff;
  border-color: var(--azul);
}
.opcao input:checked + span::before {
  border-color: var(--azul);
  background: var(--azul);
  box-shadow: inset 0 0 0 3px #fff;
}

/* ---------- Botões ---------- */
.acoes-etapa {
  display: flex;
  gap: 10px;
  margin-top: 22px;
}
.btn {
  flex: 1;
  border: none;
  border-radius: var(--raio-pequeno);
  padding: 14px 16px;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: transform .1s, opacity .15s;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn-primario { background: var(--azul); color: #fff; }
.btn-primario:hover:not(:disabled) { background: var(--azul-escuro); }
.btn-secundario { background: #f1f5f9; color: var(--texto); flex: 0 0 auto; padding-left: 20px; padding-right: 20px; }
.btn-bloco { width: 100%; }

.erro-form {
  color: var(--vermelho-escuro);
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--raio-pequeno);
  padding: 10px 12px;
  font-size: 13px;
  margin-top: 12px;
  display: none;
}
.erro-form.visivel { display: block; }

/* ---------- Resultado / feedback ---------- */
.resultado-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 99px;
  font-weight: 700;
  font-size: 12.5px;
  letter-spacing: .2px;
}

.resultado-card {
  border-radius: 20px;
  padding: 22px 18px;
  text-align: center;
  margin-bottom: 18px;
}
.resultado-card .rotulo { font-size: 12.5px; font-weight: 700; opacity: .8; text-transform: uppercase; letter-spacing: .4px; }
.resultado-card .valor { font-size: 46px; font-weight: 800; line-height: 1.1; margin: 4px 0; }
.resultado-card .nivel { font-size: 16px; font-weight: 700; }

.feedback-card {
  border-radius: var(--raio-pequeno);
  padding: 16px;
  margin-bottom: 14px;
}
.feedback-card h3 { margin: 0 0 6px; font-size: 15.5px; }
.feedback-card p { margin: 0; font-size: 13.5px; line-height: 1.6; }

.dicas-lista {
  margin: 0;
  padding-left: 18px;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--texto);
}
.dicas-titulo { font-weight: 700; font-size: 13.5px; margin: 16px 0 8px; }

.aviso-apoio {
  margin-top: 16px;
  font-size: 12px;
  color: var(--texto-suave);
  background: #f8fafc;
  border-radius: var(--raio-pequeno);
  padding: 12px 14px;
  line-height: 1.6;
}

.rodape-marca {
  text-align: center;
  font-size: 11.5px;
  color: #9ca3af;
  padding: 14px 0 4px;
}

/* Spinner simples de carregamento */
.spinner {
  width: 20px; height: 20px;
  border: 3px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  display: inline-block;
  animation: girar .7s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
}
@keyframes girar { to { transform: rotate(360deg); } }

@media (max-width: 380px) {
  .app-shell { border-radius: 20px; }
  .etapa { padding: 18px; }
}
