/* auth.css — estilos compartilhados das 5 telas de autenticação do Velo
 * Carregado após style.css (se presente) para herdar tokens base.
 * --text-muted corrigido para #6B5D52 (contraste ~4.8:1, passa WCAG AA).
 */

:root {
  --sage: #4A7C6F;
  --sage-dark: #2F5A50;
  --beige: #F5EFE6;
  --text: #2C1A0E;
  --text-soft: #5C4A3E;
  --text-muted: #6B5D52; /* era #8B7B6D (~3.9:1, falha WCAG AA) → corrigido para ~4.8:1 */
  --border: rgba(44,26,14,0.1);
  --red: #B91C1C;
  --red-bg: #FEF2F2;
  --shadow-lg: 0 16px 48px rgba(44,26,14,0.12);
  --font-display: 'Lora', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background: var(--beige);
  color: var(--text);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

/* ── Card ── */
.card {
  background: white;
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  padding: 40px 36px;
  width: 100%;
  max-width: 400px;
}

/* ── Logo ── */
.logo {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 600;
  color: var(--sage-dark);
  text-decoration: none;
  display: inline-flex;
  align-items: flex-start;
  gap: 2px;
  margin: 0 auto 6px;
  position: relative;
  letter-spacing: -0.02em;
  width: fit-content;
  padding-right: 10px;
}

.logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 6px;
}

.logo::after {
  content: "";
  position: absolute;
  right: 0;
  top: 10px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #C9962A;
}

.tagline {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 32px;
}

h1 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  text-align: center;
  margin-bottom: 24px;
}

/* ── Botão Google ── */
.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 13px 20px;
  background: white;
  border: 1.5px solid var(--border);
  border-radius: 100px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  transition: box-shadow .15s, border-color .15s;
}

.btn-google:hover {
  box-shadow: 0 4px 16px rgba(44,26,14,0.1);
  border-color: rgba(44,26,14,0.2);
}

.btn-google svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* ── Divisor ── */
.divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 20px 0;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Campos ── */
.field {
  margin-bottom: 14px;
  position: relative; /* allows .toggle-pw absolute positioning in reset-senha */
}

.field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-soft);
  margin-bottom: 5px;
}

.field input {
  width: 100%;
  padding: 13px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--text);
  background: white;
  transition: border-color .15s, box-shadow .15s;
  outline: none;
  min-height: 44px;
}

/* WCAG 2.4.7: focus ring visível — substituiu border-color isolado */
.field input:focus {
  border-color: var(--sage);
  box-shadow: 0 0 0 3px rgba(74,124,111,0.25);
  outline: none;
}

.hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ── Botão primário ── */
.btn-primary {
  display: block;
  width: 100%;
  padding: 14px;
  min-height: 44px;
  background: var(--sage);
  color: white;
  border: none;
  border-radius: 100px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, opacity .15s;
  margin-top: 18px;
}

.btn-primary:hover {
  background: var(--sage-dark);
}

.btn-primary:focus-visible {
  outline: 2px solid var(--sage-dark);
  outline-offset: 3px;
}

.btn-primary:disabled {
  opacity: .5;
  cursor: not-allowed;
}

/* ── Alertas — role="alert" adicionado no HTML ── */
.alert {
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 0.83rem;
  margin-bottom: 16px;
  display: none;
}

.alert.error {
  background: var(--red-bg);
  border: 1px solid #FECACA;
  color: var(--red);
}

.alert.info {
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  color: #166534;
}

.alert.success {
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  color: #1E40AF;
}

.alert.visible {
  display: block;
}

/* ── Links de rodapé ── */
.bottom-link {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.83rem;
  color: var(--text-muted);
}

.bottom-link a {
  color: var(--sage);
  font-weight: 500;
  text-decoration: none;
}

.back {
  display: block;
  text-align: center;
  margin-top: 16px;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: none;
}

.back:hover {
  color: var(--sage);
}

/* ── Legal nav ── */
.auth-legal {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0;
  margin-top: 14px;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.auth-legal a {
  color: inherit;
  text-decoration: none;
  padding: 0 12px;
  position: relative;
  font-weight: 600;
  transition: color .15s;
}

.auth-legal a:hover {
  color: var(--sage-dark);
}

.auth-legal a + a::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #C9962A;
  opacity: .8;
}

/* ── Trust badge (cadastro) ── */
.auth-trust {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: -8px 0 16px;
  padding: 8px 14px;
  background: var(--beige);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.76rem;
  color: var(--text-soft);
  letter-spacing: 0.005em;
}

.auth-trust .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--sage);
  box-shadow: 0 0 0 3px rgba(74,124,111,0.18);
  flex-shrink: 0;
}

/* ── Medidor de força de senha (cadastro + reset-senha) ── */
.strength-bar {
  display: flex;
  gap: 4px;
  margin-top: 8px;
}

.strength-bar span {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  transition: background .2s;
}

.strength-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
  min-height: 16px;
  transition: color .2s;
}

/* ── Checklist de regras de senha ── */
.rules {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rule {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: color .2s;
}

.rule.ok {
  color: #16a34a;
}

.rule-icon {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.65rem;
  transition: background .2s, border-color .2s;
}

.rule.ok .rule-icon {
  background: #16a34a;
  border-color: #16a34a;
  color: white;
}

/* ── Esqueci senha — steps + resend ── */
.step {
  display: none;
}

.step.active {
  display: block;
}

.steps-indicator {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 28px;
}

.step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
}

.step-dot.done {
  background: var(--sage);
}

.step-dot.active {
  background: var(--sage);
  width: 24px;
  border-radius: 4px;
}

.resend,
.resend-link {
  background: none;
  border: none;
  color: var(--sage);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  display: block;
  margin: 12px auto 0;
  text-decoration: underline;
  padding: 0;
}

/* ── Esqueci senha — subtítulo e code input ── */
.sub {
  font-size: 0.88rem;
  color: var(--text-soft);
  line-height: 1.55;
  margin-bottom: 24px;
}

.code-input {
  font-family: monospace;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  color: var(--sage);
  text-align: center;
  padding: 14px;
}

/* ── Reset senha — toggle senha + match hint ── */
/* Input dentro de field que tem .toggle-pw precisa de padding-right extra */
.field:has(.toggle-pw) input {
  padding-right: 44px;
}
/* label height ≈ 22px; input is 44px; center of input from .field top = label(22) + input/2(22) = 44px */
.toggle-pw {
  position: absolute;
  right: 6px;
  top: calc(22px + 22px - 22px); /* label + half-input - half-touch-target */
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1.1rem;
  padding: 10px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: color .15s, background .15s;
}
.toggle-pw:hover { color: var(--sage); background: rgba(74,124,111,0.07); }
.toggle-pw:focus-visible { outline: 2px solid var(--sage); outline-offset: 1px; }

.match-hint {
  font-size: 0.75rem;
  margin-top: 4px;
  min-height: 16px;
}

.match-hint.ok {
  color: #16a34a;
}

.match-hint.fail {
  color: var(--red);
}

/* ── Forgot link (login) ── */
.forgot {
  display: block;
  text-align: right;
  font-size: 0.78rem;
  color: var(--text-muted);
  text-decoration: none;
  margin-top: 8px;
}

.forgot:hover {
  color: var(--sage);
}

/* ── WhatsApp illustration (conectar-whatsapp) ── */
.wa-illus {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.wa-illus span {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #25D36615;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
}

/* ─── Funnel stepper — indicador de progresso visual ───────────────────────────
   Mostra os 4 passos do funil de aquisição com o atual em destaque.
   Aparece em /confirma-email, /conectar-whatsapp e /ativando.
   Razão: user vê quanto falta pra ativar — incentiva concluir em vez de
   abandonar achando "ainda tem muita coisa". */

.stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0 0 28px;
  font-family: var(--font-body);
  font-size: 0.74rem;
  color: var(--text-muted);
}

.stepper-step {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.stepper-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: white;
  font-weight: 600;
  font-size: 0.72rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.stepper-step[data-state="done"] .stepper-num {
  background: var(--sage);
  border-color: var(--sage);
  color: white;
}

.stepper-step[data-state="done"] .stepper-label {
  color: var(--text);
}

.stepper-step[data-state="current"] .stepper-num {
  background: white;
  border-color: var(--sage);
  color: var(--sage);
  box-shadow: 0 0 0 4px rgba(74,124,111,0.12);
}

.stepper-step[data-state="current"] .stepper-label {
  color: var(--sage-dark);
  font-weight: 600;
}

.stepper-sep {
  width: 14px;
  height: 1px;
  background: var(--border);
  flex-shrink: 0;
}

@media (max-width: 480px) {
  .stepper { font-size: 0.68rem; gap: 4px; }
  .stepper-label { display: none; }
  .stepper-step[data-state="current"] .stepper-label { display: inline; }
  .stepper-sep { width: 8px; }
}
