/* ============================================================
   APP FM CONECTA — TELAS DE AUTENTICAÇÃO
   Entrar (#/entrar) · Convite (#/convite) · Cadastro (#/cadastro)
   Consome as variáveis de tokens.css. Mobile-first, dark-first.
   Gradiente da marca só no CTA principal — o resto é sóbrio.
   ============================================================ */

/* ---------- Formulário e campos ---------- */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.auth-label {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-2);
}

.auth-input,
.auth-select {
  min-height: 44px;
  width: 100%;
  padding: 0 var(--sp-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.auth-input::placeholder { color: var(--text-disabled); }
.auth-input:focus,
.auth-select:focus {
  outline: none;
  border-color: var(--roxo);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--roxo) 22%, transparent);
}

.auth-input-mono {
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  letter-spacing: .04em;
}

/* Campo com ícone à esquerda (e-mail, senha) */
.auth-field-icon { position: relative; }
.auth-field-icon > .icon {
  position: absolute;
  left: var(--sp-3);
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
}
.auth-field-icon .auth-input { padding-left: 40px; }
.auth-field-icon .auth-input-com-peek { padding-right: 44px; }

/* Botão de mostrar/ocultar senha */
.auth-peek {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--text-muted);
  background: transparent;
  border: 0;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.auth-peek:hover { color: var(--text); background: var(--overlay-hover); }
.auth-peek .icon { width: 18px; height: 18px; }

.auth-hint {
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

/* ---------- Mensagens de estado (erro / sucesso) ---------- */
.auth-msg {
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-md);
  font-size: var(--fs-sm);
  font-weight: 500;
  line-height: 1.4;
}
.auth-msg.is-erro {
  background: var(--error-bg);
  color: var(--error);
}
.auth-msg.is-sucesso {
  background: var(--success-bg);
  color: var(--success);
}

/* ---------- Botões ---------- */
.auth-btn-block { width: 100%; }
.auth-btn-flex { flex: 1; }

.auth-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .4);
  border-top-color: var(--on-brand);
  animation: auth-girar .7s linear infinite;
}
.btn.is-loading {
  pointer-events: none;
  opacity: .85;
}
.btn.is-loading .auth-spinner { display: inline-block; }
.btn.is-loading > span:first-child { opacity: .6; }

@keyframes auth-girar {
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .auth-spinner { animation: none; }
}

/* ---------- Divisor "ou" ---------- */
.auth-divisor {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  color: var(--text-disabled);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.auth-divisor::before,
.auth-divisor::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ---------- Card "tenho um convite" ---------- */
.auth-invite-cta {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  text-align: left;
  transition: all var(--t-fast) var(--ease);
}
.auth-invite-cta:hover { border-color: var(--border-strong); background: var(--surface-2); }
.auth-invite-icon {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: var(--r-md);
  padding: 11px;
  background: color-mix(in srgb, var(--magenta) 13%, transparent);
  color: var(--ink-accent);
}
.auth-invite-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.auth-invite-body strong {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-sm);
  color: var(--text);
}
.auth-invite-cta > .icon:last-child { flex: none; color: var(--text-muted); }

/* ---------- Link "esqueci minha senha" ---------- */
.auth-link-esqueci {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  min-height: 44px;
  padding: var(--sp-2) var(--sp-3);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-muted);
  transition: color var(--t-fast) var(--ease);
}
.auth-link-esqueci:hover { color: var(--text); }

/* ---------- Link "voltar" ---------- */
.auth-link-voltar {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  align-self: center;
  min-height: 44px;
  padding: var(--sp-2) var(--sp-3);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-muted);
  transition: color var(--t-fast) var(--ease);
}
.auth-link-voltar:hover { color: var(--text); }
.auth-link-voltar .icon { width: 18px; height: 18px; }

/* ---------- Contexto do convite validado ---------- */
.auth-contexto,
.auth-confirma {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.auth-contexto-linha,
.auth-confirma-linha {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-2) 0;
  border-top: 1px solid var(--border);
}
.auth-contexto-linha:first-of-type,
.auth-confirma-linha:first-of-type { border-top: none; }
.auth-confirma-linha strong,
.auth-contexto-linha strong {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--text);
  text-align: right;
}
.auth-contexto-ok {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  color: var(--success);
}
.auth-contexto-ok .icon { width: 16px; height: 16px; color: var(--success); }

/* ---------- Cabeçalho de passo (cadastro) ---------- */
.auth-step-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-3);
}
.auth-step-head-texto { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.auth-step-numero {
  flex: none;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-xs);
  color: var(--ink-brand);
  white-space: nowrap;
  padding-top: 2px;
}

/* ---------- Barra de progresso do stepper ---------- */
.auth-progress {
  height: 4px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  overflow: hidden;
}
.auth-progress-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--grad-brand);
  transition: width var(--t-med) var(--ease-out);
}

/* ---------- Passos do cadastro ---------- */
.auth-step {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}
.auth-step-nav {
  display: flex;
  gap: var(--sp-3);
}
.auth-btn-voltar {
  flex: none;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-2);
}
.auth-btn-voltar:hover { border-color: var(--border-strong); }
.auth-btn-voltar .icon { width: 18px; height: 18px; }

/* ---------- Passo 2: foto do perfil ---------- */
.auth-foto {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
}
.auth-foto-preview {
  flex: none;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  background-size: cover;
  background-position: center;
}
.auth-foto-preview.tem-foto { border-color: var(--border-strong); }
.auth-foto-texto {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}
.auth-foto-texto strong { font-size: var(--fs-sm); font-weight: 600; color: var(--text); }
.auth-foto-btn {
  margin-top: var(--sp-1);
  min-height: 36px;
  padding: 7px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: var(--fs-xs);
}
.auth-foto-btn:hover { border-color: var(--border-strong); }
.auth-foto-btn .icon { width: 16px; height: 16px; }

/* Input de arquivo nativo escondido, mas acessível via a label associada */
.auth-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Tela "confirme seu e-mail" ---------- */
.auth-confirma-email {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--sp-3);
  padding: var(--sp-7) var(--sp-5);
}
.auth-confirma-email-icon {
  width: 56px;
  height: 56px;
  padding: 14px;
  border-radius: 50%;
  background: var(--grad-brand);
  color: var(--on-brand);
  box-shadow: 0 12px 32px -10px var(--glow-purple);
}

/* O atributo hidden SEMPRE vence qualquer display definido acima
   (sem isto, .btn/.card com display proprio apareciam mesmo com hidden). */
[hidden] { display: none !important; }
