/* Cadastro e login por etapas.
   (A ordem dos arquivos no index.html importa: veja o comentário lá.) */

/* ===================================================================
   CADASTRO POR ETAPAS
   =================================================================== */
/* Tela cheia como a atividade: barra de progresso em cima, o mascote
   "perguntando" num balão, o campo e o botão grande embaixo. */
.onboard { display: grid; grid-template-rows: auto 1fr; max-width: 640px; min-height: calc(100vh / var(--zoom) - 120px); margin: 0 auto; } /* "/ zoom": em monitor grande a tela é ampliada (escala), e sem isso o botão Continuar fica abaixo da tela */
.onboard-top { display: flex; align-items: center; gap: 14px; padding: 4px 0 18px; }
.onboard-top small { color: var(--muted); font-size: 14px; font-weight: 700; white-space: nowrap; }
.onboard-progress { flex: 1; height: 16px; overflow: hidden; border-radius: 99px; background: var(--surface-soft); }
.onboard-progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--hero-from), var(--hero-to)); transition: width 300ms ease; }
.onboard-body { display: flex; flex-direction: column; gap: 18px; }
.onboard-ask { display: flex; align-items: center; gap: 16px; margin-top: 12px; }
.onboard-mascot { width: 88px; height: 88px; flex: none; display: block; overflow: hidden; border: 4px solid var(--surface); border-radius: 50%; box-shadow: 0 5px 0 var(--hero-shadow); }
.onboard-mascot .mascot-svg { width: 100%; height: 100%; }
.onboard-bubble {
  position: relative;
  margin: 0;
  padding: 16px 20px;
  border: 2px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 4px 0 var(--line);
  font-family: "Manrope", sans-serif;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.3;
}
.onboard-bubble::before { content: ""; position: absolute; top: 50%; left: -9px; width: 16px; height: 16px; border-bottom: 2px solid var(--line); border-left: 2px solid var(--line); background: var(--surface); transform: translateY(-50%) rotate(45deg); }
.onboard-fields { display: grid; gap: 14px; }
.onboard .field-label { gap: 8px; font-size: 15px; }
.onboard .field-label input { min-height: 56px; padding: 0 16px; border: 2px solid var(--line); border-radius: 16px; background: var(--surface); font-size: 18px; }
.onboard .field-label input:focus { border-color: var(--hero-from); outline: none; box-shadow: 0 0 0 4px var(--primary-soft); }
.onboard .field-hint { display: flex; gap: 8px; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
.onboard .field-hint .bi { flex: none; margin-top: 2px; color: var(--accent); }
.onboard .form-error { min-height: 22px; margin: 0; color: #c24a3c; font-size: 15px; font-weight: 700; }
.onboard-footer { display: grid; gap: 12px; margin-top: auto; padding: 18px 0 8px; }
.onboard-next { width: 100%; min-height: 56px; font-size: 16px; }
.onboard-login { margin: 0; color: var(--muted); font-size: 15px; text-align: center; }
.onboard-login .text-button { font-size: 15px; text-decoration: underline; }

/* Meta diária: três cartões grandes, o escolhido em degradê */
.onboard-goals { display: grid; gap: 12px; }
.onboard-goal {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  border: 2px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 4px 0 var(--line);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  text-align: left;
}
.onboard-goal:active { transform: translateY(4px); box-shadow: 0 0 0 transparent; }
.onboard-goal > span:last-child { display: grid; }
.onboard-goal strong { font-family: "Manrope", sans-serif; font-size: 18px; font-weight: 800; }
.onboard-goal small { color: var(--muted); font-size: 14px; }
.onboard-goal-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; background: var(--primary-soft); color: var(--primary); font-size: 22px; }
.onboard-goal.is-active { border-color: var(--hero-from); background: var(--primary-soft); box-shadow: 0 4px 0 var(--hero-shadow); }
.onboard-goal.is-active .onboard-goal-icon { background: linear-gradient(135deg, var(--hero-from), var(--hero-to)); color: #ffffff; }

/* Login: o mascote "pensando" (reticências piscando) e o "Me lembrei!" */
.onboard-done .onboard-kicker { margin: 10px 0 0; color: var(--accent); font-family: "Manrope", sans-serif; font-size: 20px; font-weight: 800; }
.thinking-dots span { animation: thinking 1.2s infinite both; }
.thinking-dots span:nth-child(2) { animation-delay: 0.2s; }
.thinking-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes thinking { 0%, 80%, 100% { opacity: 0.2; } 40% { opacity: 1; } }

/* "Tudo pronto!" */
.onboard-done { grid-template-rows: none; align-content: center; justify-items: center; gap: 14px; text-align: center; }
.onboard-done .welcome-mascot { width: min(260px, 70vw); }
.onboard-done h2 { margin: 18px 0 0; font-family: "Manrope", sans-serif; font-size: clamp(28px, 4vw, 38px); font-weight: 800; }
.onboard-done p { max-width: 460px; margin: 0; color: var(--muted); font-size: 17px; line-height: 1.6; }
.onboard-done .onboard-next { max-width: 380px; margin-top: 14px; }

@media (max-width: 1000px) {
  /* altura da tela menos o respiro da tela (40px) e o rodapé (45px), para não rolar */
  .onboard { min-height: calc((100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom)) / var(--zoom) - 85px); }
  .onboard-ask { align-items: flex-start; margin-top: 4px; }
  .onboard-mascot { width: 64px; height: 64px; border-width: 3px; box-shadow: 0 4px 0 var(--hero-shadow); }
  .onboard-bubble { padding: 12px 16px; font-size: 19px; }
  .onboard-bubble::before { top: 30px; }
}

/* Senha com olhinho para mostrar/esconder */
.password-field { position: relative; display: block; }
.onboard .password-field input { width: 100%; padding-right: 58px; }
.password-field input::-ms-reveal { display: none; } /* o Edge tem um olhinho próprio */
.password-toggle { position: absolute; top: 50%; right: 8px; transform: translateY(-50%); display: grid; place-items: center; width: 42px; height: 42px; padding: 0; border: 0; border-radius: 12px; background: transparent; color: var(--muted); font-size: 20px; cursor: pointer; }
.password-toggle:hover, .password-toggle[aria-pressed="true"] { background: var(--surface-soft); color: var(--text); }
.password-toggle:focus-visible { outline: 3px solid var(--primary-soft); }
