/* ==========================================================================
   Cadastro em etapas (dados → senha → confirmação)
   Complementa o CSS base do layout auth. Prefixo .sw- = signup wizard.
   ========================================================================== */

.auth-card-signup { max-width: 560px; }

/* O atributo [hidden] vem da folha do navegador e perde para qualquer classe
   que defina `display` — sem esta regra, elementos marcados como escondidos
   (stepper, resumo, erro dos termos, botão voltar) apareceriam mesmo assim. */
.sw-steps[hidden],
.sw-summary[hidden],
.sw-field-error[hidden],
.sw-back[hidden],
.sw-nav[hidden],
.sw-panel[hidden],
.sw-strength[hidden] { display: none; }

/* --------------------------------------------------------------------------
   Indicador de etapas
   -------------------------------------------------------------------------- */

.sw-steps {
  display: flex;
  align-items: flex-start;
  margin: 4px 0 26px;
  counter-reset: etapa;
}

.sw-step {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  position: relative;
  min-width: 0;
}

/* Linha que liga um passo ao anterior */
.sw-step + .sw-step::before {
  content: '';
  position: absolute;
  top: 16px;
  right: 50%;
  left: -50%;
  height: 2px;
  background: #DCE8E2;
  transition: background 0.35s ease;
}
.sw-step.is-done::before,
.sw-step.is-current::before { background: var(--brand-accent); }

.sw-step-dot {
  position: relative;
  z-index: 1;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fff;
  border: 2px solid #DCE8E2;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 800;
  transition: border-color 0.3s, background 0.3s, color 0.3s, transform 0.3s;
}
.sw-step-dot svg { width: 16px; height: 16px; display: none; }

.sw-step.is-current .sw-step-dot {
  border-color: var(--brand-accent);
  color: var(--brand-accent);
  transform: scale(1.08);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.14);
}
.sw-step.is-done .sw-step-dot {
  background: var(--brand-accent);
  border-color: var(--brand-accent);
  color: #fff;
}
.sw-step.is-done .sw-step-dot span { display: none; }
.sw-step.is-done .sw-step-dot svg { display: block; }

.sw-step-label {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.25;
  transition: color 0.3s;
}
.sw-step.is-current .sw-step-label { color: var(--brand-primary); }
.sw-step.is-done .sw-step-label { color: var(--brand-accent); }

/* Passos já concluídos são clicáveis para revisão */
.sw-step.is-clickable { cursor: pointer; }
.sw-step.is-clickable:hover .sw-step-dot { border-color: var(--brand-accent); }

/* --------------------------------------------------------------------------
   Painéis das etapas
   -------------------------------------------------------------------------- */

.sw-panel { border: 0; padding: 0; margin: 0; min-width: 0; }

/* Entrada suave ao trocar de etapa (respeitando quem prefere menos movimento) */
.sw-panel.is-entering { animation: sw-in 0.32s cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes sw-in {
  from { opacity: 0; transform: translateX(14px); }
  to   { opacity: 1; transform: translateX(0); }
}
.sw-panel.is-entering-back { animation: sw-in-back 0.32s cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes sw-in-back {
  from { opacity: 0; transform: translateX(-14px); }
  to   { opacity: 1; transform: translateX(0); }
}
@media (prefers-reduced-motion: reduce) {
  .sw-panel.is-entering,
  .sw-panel.is-entering-back { animation: none; }
  .sw-step-dot { transition: none; }
}

.sw-panel-title {
  font-size: 1.05rem;
  color: var(--brand-dark);
  margin-bottom: 4px;
  letter-spacing: -0.3px;
}
.sw-panel-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 18px;
  line-height: 1.5;
}

/* Campo inválido sinalizado após tentativa de avançar */
.auth-field.has-error input { border-color: #E5484D; }
.auth-field.has-error input:focus { box-shadow: 0 0 0 3px rgba(229, 72, 77, 0.12); }
.sw-field-error {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #B3261E;
  margin-top: 5px;
}
.sw-field-error svg { width: 13px; height: 13px; flex-shrink: 0; }

/* --------------------------------------------------------------------------
   Senha: olho, força e requisitos
   -------------------------------------------------------------------------- */

.auth-input-wrap .sw-eye {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: none;
  background: none;
  border-radius: 10px;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0;
}
.auth-input-wrap .sw-eye:hover { color: var(--brand-primary); background: rgba(6, 40, 31, 0.05); }
.auth-input-wrap .sw-eye svg { width: 17px; height: 17px; }
.auth-input-wrap:has(.sw-eye) input { padding-right: 46px; }

.sw-strength { margin-top: 10px; }
.sw-strength-bars { display: flex; gap: 5px; }
.sw-strength-bars span {
  flex: 1;
  height: 5px;
  border-radius: 50px;
  background: #E7EFEA;
  transition: background 0.3s;
}
.sw-strength-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.76rem;
  font-weight: 700;
  margin-top: 7px;
  color: var(--text-muted);
}
.sw-strength[data-level="1"] .sw-strength-bars span:nth-child(-n+1) { background: #E5484D; }
.sw-strength[data-level="2"] .sw-strength-bars span:nth-child(-n+2) { background: #F59E0B; }
.sw-strength[data-level="3"] .sw-strength-bars span:nth-child(-n+3) { background: #84CC16; }
.sw-strength[data-level="4"] .sw-strength-bars span { background: var(--brand-accent); }
.sw-strength[data-level="1"] .sw-strength-value { color: #B3261E; }
.sw-strength[data-level="2"] .sw-strength-value { color: #92600A; }
.sw-strength[data-level="3"] .sw-strength-value { color: #4D7C0F; }
.sw-strength[data-level="4"] .sw-strength-value { color: #0B6B4F; }

.sw-rules {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: grid;
  gap: 7px;
}
.sw-rules li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
  transition: color 0.25s;
}
.sw-rules li .sw-rule-icon {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 1px;
  display: grid;
  place-items: center;
  background: #E7EFEA;
  color: #9CB3AB;
  transition: background 0.25s, color 0.25s;
}
.sw-rules li .sw-rule-icon svg { width: 10px; height: 10px; }
.sw-rules li.is-ok { color: var(--text-main); }
.sw-rules li.is-ok .sw-rule-icon { background: rgba(16, 185, 129, 0.16); color: var(--brand-accent); }

/* --------------------------------------------------------------------------
   Etapa final: resumo e indicação
   -------------------------------------------------------------------------- */

.sw-summary {
  background: #F6FAF8;
  border: 1px solid #DCE8E2;
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 18px;
  display: grid;
  gap: 9px;
}
.sw-summary-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 0.85rem;
  min-width: 0;
}
.sw-summary-row dt {
  color: var(--text-muted);
  font-weight: 600;
  flex-shrink: 0;
  min-width: 62px;
}
.sw-summary-row dd {
  margin: 0;
  font-weight: 700;
  color: var(--text-main);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.sw-referral-ok {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 9px 12px;
  border-radius: 10px;
  background: rgba(16, 185, 129, 0.1);
  color: #0B6B4F;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.4;
}
.sw-referral-ok svg { width: 15px; height: 15px; flex-shrink: 0; }

/* --------------------------------------------------------------------------
   Navegação entre etapas
   -------------------------------------------------------------------------- */

.sw-nav {
  display: flex;
  gap: 10px;
  margin-top: 22px;
}
.sw-nav .auth-submit { margin-top: 0; }

.sw-back {
  flex: 0 0 auto;
  min-height: 52px;
  padding: 0 20px;
  border-radius: 50px;
  border: 1.5px solid #DCE8E2;
  background: none;
  color: var(--text-muted);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: border-color 0.25s, color 0.25s;
}
.sw-back:hover { border-color: var(--brand-primary); color: var(--brand-primary); }
.sw-back svg { width: 16px; height: 16px; }

/* --------------------------------------------------------------------------
   Responsivo
   -------------------------------------------------------------------------- */

@media (max-width: 460px) {
  .sw-steps { margin-bottom: 22px; }
  .sw-step-dot { width: 30px; height: 30px; font-size: 0.78rem; }
  .sw-step + .sw-step::before { top: 14px; }
  .sw-step-label { font-size: 0.68rem; }
  .sw-back { padding: 0 15px; }
  .sw-back span { display: none; }   /* só a seta, para o botão principal respirar */
  .sw-summary-row { flex-direction: column; gap: 1px; }
  .sw-summary-row dt { min-width: 0; font-size: 0.72rem; }
}

/* Telas muito baixas: menos respiro vertical */
@media (max-height: 700px) {
  .sw-steps { margin-bottom: 18px; }
  .sw-panel-hint { margin-bottom: 14px; }
}
