/* Passo a passo do cadastro. Usa as variáveis de styles.css. */
.instructions-page { min-height: 100vh; background: var(--paper); color: var(--ink); }

.instructions-header {
  width: var(--page);
  height: 84px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* O botão de compartilhar entra por JS como terceiro item e encostava no
     "Voltar". Sem este gap eles ficam com 0px entre si. */
  gap: 26px;
  border-bottom: 1px solid var(--line);
}

.instructions-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  transition: border-color .2s ease, color .2s ease;
}
.instructions-back:hover { border-color: var(--blue); color: var(--blue); }
/* Mesmo motivo do .check-back: no celular o texto encolhe e a seta responde
   sozinha pelo botão, então precisa de contraste de texto. */
.instructions-back span { color: inherit; font-size: 17px; }

/* ---------- Estrutura do passo a passo ---------- */

.wizard {
  width: min(560px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 26px 0 30px;
}

.wizard-progress { position: sticky; top: 0; z-index: 15; padding: 12px 0 14px; background: var(--paper); }
.wizard-progress-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.wizard-count b { font-size: 14px; font-weight: 700; color: var(--ink); }
/* O destaque da fase vem do peso, não da cor: em texto pequeno nenhum tom de
   marca chega aos 4.5 de contraste sobre o branco sem virar outra cor. */
.wizard-phase { color: var(--ink); font-weight: 600; }

.wizard-bar { height: 8px; border-radius: 99px; background: var(--paper-deep); overflow: hidden; }
.wizard-bar i {
  display: block;
  width: 4%;
  height: 100%;
  border-radius: 99px;
  background: var(--blue);
  transition: width .3s ease;
}

/* Só aparece via <noscript>, quando o passo a passo vira uma lista simples. */
.wizard-noscript {
  display: none;
  margin: 16px 0 0;
  padding: 13px 15px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
}

.wizard-steps { list-style: none; margin: 22px 0 0; padding: 0; }

.wizard-step {
  display: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--white);
  box-shadow: var(--shadow);
  overflow: hidden;
}
/* O texto vem antes da imagem (ver .wizard-figure), para a instrução
   aparecer logo de cara e a imagem servir de confirmação. */
.wizard-steps > .wizard-step.is-current {
  display: flex;
  flex-direction: column;
  animation: step-in .26s ease both;
}

@keyframes step-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.wizard-figure {
  order: 2; /* Desce a imagem para baixo do texto. */
  margin: 0;
  padding: 16px;
  display: grid;
  place-items: center;
  border-top: 1px solid var(--line);
  background: var(--paper-deep);
}
/* Os prints são verticais: a altura é o limite real, então deixamos
   a imagem crescer até quase encher a tela para os detalhes ficarem legíveis. */
.wizard-figure img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 62vh;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--white);
}

.wizard-step-body { padding: 22px 20px 24px; }
.wizard-kicker {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .1em;
}
.wizard-step-body h2 {
  margin: 0 0 10px;
  font-family: var(--body);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.03em;
}
.wizard-step-body > p { margin: 0; font-size: 15px; line-height: 1.55; color: #334155; }
.wizard-step-body > p + p { margin-top: 10px; }

/* Bloco do código ORG. Ele é público e fixo — aparece na página da HUB até em
   janela anônima, sem login —, então dá para escrever aqui e poupar a ida.
   Monoespaçado e espaçado: quem preferir digitar precisa distinguir cada
   caractere. */
.org-code {
  width: 100%;
  margin: 16px 0;
  padding: 14px 16px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  align-items: center;
  border: 1px solid var(--acid);
  border-radius: var(--radius);
  background: var(--acid-soft);
  text-align: left;
  cursor: pointer;
  transition: border-color .18s ease, background-color .18s ease;
}
.org-code:hover { border-color: var(--blue); background: var(--acid); }
.org-code-label { font-size: 12px; font-weight: 600; color: var(--blue-deep); letter-spacing: .04em; }
.org-code-value {
  grid-column: 1;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: .14em;
  color: var(--ink);
}
.org-code-action {
  grid-column: 2;
  grid-row: 1 / 3;
  padding: 9px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--white);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.wizard-tip {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  border-left: 3px solid var(--blue);
  background: var(--acid-soft);
  font-size: 13px;
  font-weight: 500;
  color: #1e293b;
}

/* Peso maior que o do .wizard-tip: não é um detalhe da tela, é uma saída para
   quem ia parar aqui esperando o kit chegar. */
.wizard-alt {
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid #fcd34d;
  border-radius: var(--radius);
  background: var(--orange);
  color: #78350f;
  font-size: 13px;
  line-height: 1.6;
}
.wizard-alt b {
  display: block;
  margin-bottom: 5px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.01em;
  color: #78350f;
}

/* Link dentro de dica ou aviso: mantém a cor do texto (que já contrasta no fundo
   claro), mas ganha peso e sublinhado para não se confundir com o resto. */
.wizard-tip a,
.wizard-alt a {
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* O endereço fica monoespaçado dentro do próprio aviso: conferir endereço só
   funciona se der para comparar caractere por caractere. */
.wizard-alt code {
  display: inline-block;
  margin-top: 3px;
  padding: 4px 8px;
  border: 1px solid #fcd34d;
  border-radius: 7px;
  background: var(--white);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
  font-weight: 600;
  color: #78350f;
  overflow-wrap: anywhere;
}

/* ---------- Passo 1: link da HUB ---------- */

.wizard-hub .wizard-step-body h2 { font-size: 26px; }

.wizard-cta {
  min-height: 60px;
  margin: 20px 0 18px;
  padding: 0 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-radius: 12px;
  background: var(--blue);
  color: var(--white);
  box-shadow: var(--shadow-sm);
  font-size: 15px;
  font-weight: 600;
  transition: background-color .18s ease, transform .18s ease;
}
.wizard-cta span { font-size: 18px; }
.wizard-cta:hover { background: var(--blue-deep); transform: translateY(-2px); }

/* ---------- Passo 23: lojas de aplicativo ---------- */

/* Dois botões lado a lado: a pessoa está em uma das plataformas e escolhe a dela
   de relance. Empilham sozinhos se a largura não der. */
.store-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 10px;
  margin: 18px 0;
}
.store-link {
  min-height: 62px;
  padding: 11px 13px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--white);
  transition: border-color .18s ease, background-color .18s ease;
}
.store-link:hover { border-color: var(--blue); background: var(--acid-soft); }
.store-link span { font-size: 11px; font-weight: 600; letter-spacing: .08em; color: var(--muted); }
/* 14px e não 15: em 320px "Google Play" quebrava em duas linhas. */
.store-link b { font-size: 14px; font-weight: 700; letter-spacing: -.02em; white-space: nowrap; }
.store-link i { font-style: normal; font-size: 13px; color: var(--blue); }

.wizard-warn {
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid #fcd34d;
  border-radius: var(--radius);
  background: var(--orange);
  color: #78350f;
}
.wizard-warn b { display: block; font-size: 14px; font-weight: 700; letter-spacing: -.01em; }
.wizard-warn p { margin: 6px 0 0; font-size: 13px; line-height: 1.55; font-weight: 500; }
.wizard-warn p b { display: inline; font-size: inherit; }

.wizard-returned {
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid var(--acid);
  border-radius: var(--radius);
  background: var(--acid-soft);
  color: #1e293b;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.55;
}

.wizard-note {
  margin: 18px 0 0;
  padding-top: 15px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

/* ---------- Tela final ---------- */

.wizard-done { margin-top: 22px; }
.wizard-done-card {
  padding: 30px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--white);
  box-shadow: var(--shadow);
  text-align: center;
}
.wizard-done-mark {
  width: 54px;
  aspect-ratio: 1;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #dcfce7;
  color: #15803d;
  font-size: 24px;
  font-weight: 700;
}
.wizard-done-card h2 {
  margin: 0 0 8px;
  font-family: var(--body);
  font-size: 23px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.03em;
}
.wizard-done-card > p { margin: 0 0 20px; font-size: 14px; color: var(--muted); }
.wizard-done-actions { display: grid; gap: 10px; }

.wizard-restart,
.wizard-done-hub {
  min-height: 52px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: .18s ease;
}
.wizard-done-hub { border-color: transparent; background: var(--blue); color: var(--white); box-shadow: var(--shadow-sm); order: -1; }
.wizard-done-hub:hover { background: var(--blue-deep); }
.wizard-restart { background: var(--white); }
.wizard-restart:hover { border-color: var(--blue); color: var(--blue); }

/* ---------- Navegação ---------- */

.wizard-nav {
  position: sticky;
  bottom: 0;
  z-index: 15;
  margin-top: 26px;
  padding: 14px 0 max(14px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  background: var(--paper);
  border-top: 1px solid var(--line);
}

.wizard-prev,
.wizard-next {
  min-height: 52px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: .18s ease;
}
.wizard-prev { background: var(--white); }
.wizard-prev:hover:not([disabled]) { border-color: var(--blue); color: var(--blue); }
.wizard-next { border-color: transparent; background: var(--blue); color: var(--white); box-shadow: var(--shadow-sm); }
.wizard-next:hover { background: var(--blue-deep); }
.wizard-prev[disabled] { opacity: .34; cursor: not-allowed; }

/* Destaque quando o usuário volta da janela da HUB. */
.wizard-next.is-ready { animation: next-pulse 1.4s ease-in-out 3; }
@keyframes next-pulse {
  0%, 100% { box-shadow: var(--shadow-sm); }
  50% { box-shadow: 0 0 0 5px rgba(29, 78, 216, .28); }
}

.wizard-dots { display: flex; align-items: center; gap: 5px; }
.wizard-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--line-strong);
}
.wizard-dots i.is-done { background: var(--muted); }
.wizard-dots i.is-current { background: var(--blue); transform: scale(1.5); }

.wizard-live {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.instructions-footer {
  width: var(--page);
  min-height: 70px;
  margin: 0 auto;
  padding: 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
}
.instructions-footer p { margin: 0; }

@media (max-width: 620px) {
  .instructions-header { height: 74px; }
  .instructions-back { font-size: 0; gap: 0; padding: 0 12px; }
  .instructions-back span { font-size: 19px; }
  .wizard { padding-top: 18px; }
  .wizard-figure { padding: 12px; }
  .wizard-step-body h2 { font-size: 20px; }
  .wizard-hub .wizard-step-body h2 { font-size: 23px; }
  .wizard-dots { display: none; }
  .wizard-nav { grid-template-columns: 1fr 1fr; }
  .instructions-footer { flex-direction: column; align-items: flex-start; gap: 5px; }
}

@media (min-width: 900px) {
  .wizard { width: min(620px, calc(100vw - 48px)); }
  .wizard-figure img { max-height: 68vh; }
}

@media (prefers-reduced-motion: reduce) {
  .js-on .wizard-steps > .wizard-step.is-current { animation: none; }
  .wizard-next.is-ready { animation: none; }
  .wizard-bar i { transition: none; }
}
