/* ================================================================
   PRECIFIKA — AUTH SECURITY STYLES
   Estilos para:
   - Esqueci minha senha
   - Redefinição de senha
   - Confirmação de e-mail
   - Modal de token
   - Alterar senha (configurações)
   - Indicadores de força de senha
   - Badges de e-mail no admin
   ================================================================ */

/* ── Link "Esqueci minha senha" no login ── */
.auth-forgot-link {
  text-align: center;
  margin: 10px 0 2px;
}
.auth-link-subtle {
  font-size: 13px;
  color: #64748b;
  text-decoration: none;
  transition: color .15s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.auth-link-subtle:hover { color: #2563eb; }

/* ── Botão voltar nos formulários de auth ── */
.auth-back-btn,
.af-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  margin-bottom: 20px;
  padding: 6px 0;
  transition: color .15s;
  border: none;
  background: none;
}
.auth-back-btn:hover,
.af-back-btn:hover { color: #2563eb; }

/* ================================================================
   COMPONENTES DOS FORMULÁRIOS DE AUTENTICAÇÃO (af-*)
   Usados em: Esqueci Senha, Redefinir Senha, Confirmar E-mail
   ================================================================ */

/* ── Ícone centralizado no topo ── */
.af-icon-wrap {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  margin: 0 auto 16px;
  background: #f1f5f9;
  color: #64748b;
}
.af-icon-wrap--blue   { background: #dbeafe; color: #2563eb; }
.af-icon-wrap--green  { background: #dcfce7; color: #16a34a; }
.af-icon-wrap--amber  { background: #fef3c7; color: #d97706; }
.af-icon-wrap--red    { background: #fee2e2; color: #dc2626; }

/* Pulsar animação para o ícone de confirmação */
.af-icon-wrap--pulse {
  animation: af-pulse 2s ease-in-out infinite;
}
@keyframes af-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(217,119,6,.3); }
  50%       { transform: scale(1.06); box-shadow: 0 0 0 8px rgba(217,119,6,0); }
}

/* ── Passos visuais (steps) ── */
.af-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 20px;
  padding: 12px 14px;
  background: #f8fafc;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
}
.af-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  opacity: .5;
  transition: opacity .2s;
}
.af-step--active { opacity: 1; }
.af-step--done   { opacity: .8; }
.af-step-num {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s, color .2s;
}
.af-step--active .af-step-num {
  background: #2563eb;
  color: #fff;
}
.af-step--done .af-step-num {
  background: #16a34a;
  color: #fff;
  font-size: 10px;
}
.af-step span {
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  white-space: nowrap;
}
.af-step--active span { color: #1e40af; }
.af-step--done   span { color: #166534; }
.af-step-line {
  flex: 1;
  height: 2px;
  background: #e2e8f0;
  border-radius: 1px;
  min-width: 20px;
  max-width: 40px;
}
.af-step-line--done { background: #16a34a; }

/* ── Banner de instrução / dica ── */
.af-token-hint {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 16px;
  font-size: 13px;
  color: #1e40af;
  line-height: 1.4;
}
.af-token-hint i { flex-shrink: 0; margin-top: 1px; }
.af-token-hint--amber {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

/* ── Input de token grande ── */
.af-token-input {
  font-size: 24px !important;
  letter-spacing: 6px;
  text-align: center;
  font-weight: 800;
  text-transform: uppercase;
}

/* ── Badge com e-mail destino ── */
.af-email-display {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13.5px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 14px;
  word-break: break-all;
}
.af-email-display i { color: #2563eb; flex-shrink: 0; }

/* ── Linha de reenvio ── */
.af-resend-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.af-resend-label {
  font-size: 13px;
  color: #64748b;
}
.af-resend-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 700;
  color: #2563eb;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 8px;
  transition: background .15s, color .15s;
}
.af-resend-btn:hover    { background: #eff6ff; }
.af-resend-btn:disabled { color: #94a3b8; cursor: default; background: none; }

/* ── Ícone centralizado no topo dos formulários ── */
.auth-icon-header {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}
.auth-icon-circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}
.auth-icon-circle--blue   { background: #dbeafe; color: #2563eb; }
.auth-icon-circle--green  { background: #dcfce7; color: #16a34a; }
.auth-icon-circle--amber  { background: #fef3c7; color: #d97706; }
.auth-icon-circle--red    { background: #fee2e2; color: #dc2626; }

/* ── Mensagens de feedback nos formulários ── */
.auth-msg {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 500;
  margin: 12px 0;
  line-height: 1.45;
}
.auth-msg.hidden { display: none !important; }
.auth-msg--error   { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.auth-msg--success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.auth-msg--info    { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.auth-msg--warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }

/* ── Badge de e-mail no fluxo de confirmação ── */
.auth-email-badge {
  background: #f1f5f9;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 8px;
  text-align: center;
  margin-bottom: 16px;
  border: 1px solid #e2e8f0;
  word-break: break-all;
}

/* ── Link de reenvio ── */
.auth-resend-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 12px 0 4px;
  font-size: 13px;
  color: #64748b;
}
.auth-resend-btn {
  background: none;
  border: none;
  color: #2563eb;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  transition: color .15s;
  font-family: inherit;
}
.auth-resend-btn:hover  { color: #1d4ed8; }
.auth-resend-btn:disabled { color: #94a3b8; cursor: default; }

/* ── Input de token grande ── */
.confirm-token-input {
  font-size: 20px !important;
  letter-spacing: 4px;
  text-align: center;
  font-weight: 800;
  text-transform: uppercase;
}

/* ================================================================
   MODAL DE TOKEN — novo design ATM (Auth Token Modal)
   ================================================================ */

/* Overlay de fundo */
.auth-token-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 16px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity .2s ease;
}
.auth-token-modal-overlay.atm-visible { opacity: 1; }

/* Painel principal */
.atm-panel {
  background: #ffffff;
  border-radius: 24px;
  max-width: 440px;
  width: 100%;
  box-shadow: 0 24px 64px rgba(0,0,0,.22), 0 4px 16px rgba(0,0,0,.1);
  overflow: hidden;
  transform: translateY(20px) scale(.97);
  transition: transform .25s ease;
}
.atm-visible .atm-panel {
  transform: translateY(0) scale(1);
}

/* Header colorido */
.atm-header {
  padding: 24px 24px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid #f1f5f9;
}
.atm-icon-circle {
  width: 52px; height: 52px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.atm-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  letter-spacing: .3px;
}

/* Corpo */
.atm-body { padding: 20px 24px; }

.atm-title {
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 6px;
}
.atm-subtitle {
  font-size: 13.5px;
  color: #64748b;
  margin: 0 0 16px;
  line-height: 1.5;
}

/* Linha de e-mail destino */
.atm-email-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #475569;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 9px 12px;
  margin-bottom: 16px;
  word-break: break-all;
}

/* Caixa do token */
.atm-token-box {
  border: 2px solid #e2e8f0;
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 16px;
  background: #f8fafc;
}
.atm-token-label {
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: .8px;
  margin-bottom: 10px;
}
.atm-token-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.atm-token-val {
  font-size: 32px;
  font-weight: 900;
  letter-spacing: 7px;
  font-family: 'Courier New', Courier, monospace;
  user-select: all;
  cursor: text;
  flex: 1;
  text-align: center;
}
.atm-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  transition: opacity .15s, transform .1s;
}
.atm-copy-btn:hover  { opacity: .88; }
.atm-copy-btn:active { transform: scale(.96); }
.atm-copy-btn:disabled { opacity: .7; cursor: default; }

.atm-token-ttl {
  font-size: 11.5px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Próximo passo */
.atm-next-step {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 12px;
}
.atm-next-icon {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
  margin-top: 1px;
}
.atm-next-step p {
  margin: 0;
  font-size: 13px;
  color: #374151;
  line-height: 1.5;
}

/* Aviso modo demo */
.atm-demo-notice {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  font-size: 11.5px;
  color: #94a3b8;
  line-height: 1.4;
  padding: 0 2px;
}
.atm-demo-notice i { flex-shrink: 0; margin-top: 2px; }

/* Footer / botão */
.atm-footer {
  padding: 0 24px 22px;
}
.atm-ok-btn {
  width: 100%;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  padding: 13px 20px;
  border-radius: 12px;
  border: none !important;
}

/* ── Responsivo mobile (bottom-sheet) ── */
@media (max-width: 600px) {
  .auth-token-modal-overlay {
    align-items: flex-end;
    padding: 0;
  }
  .atm-panel {
    border-radius: 24px 24px 0 0;
    max-width: 100%;
    transform: translateY(40px);
    max-height: 92vh;
    overflow-y: auto;
  }
  .atm-visible .atm-panel {
    transform: translateY(0);
  }
  .atm-header { padding: 20px 18px 16px; }
  .atm-body   { padding: 16px 18px; }
  .atm-footer { padding: 0 18px 20px; }
  .atm-token-val { font-size: 26px; letter-spacing: 5px; }
  .atm-copy-btn  { padding: 8px 12px; font-size: 12px; }
}

/* Legado — mantido para retrocompatibilidade */
.auth-token-modal { display: none; }
.auth-token-value { font-size: 28px; font-weight: 900; letter-spacing: 6px; font-family: monospace; }
.auth-token-copy-btn { display: none; }
.auth-token-ttl { font-size: 12px; color: #94a3b8; }
.auth-token-ok-btn { width: 100%; justify-content: center; }

/* ================================================================
   INDICADOR DE FORÇA DE SENHA
   ================================================================ */
.password-strength {
  margin-top: 6px;
}

.pw-strength-bar {
  height: 5px;
  background: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 5px;
}

.pw-strength-fill {
  height: 100%;
  border-radius: 3px;
  transition: width .3s ease, background .3s ease;
}

.pw-strength-label {
  font-size: 11.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ================================================================
   CONFIGURAÇÕES — SEÇÃO DE SEGURANÇA
   ================================================================ */
.settings-card--security {
  margin-top: 20px;
}

/* Status de e-mail */
.security-email-status {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: #f8fafc;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  margin-bottom: 4px;
}

.security-email-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.security-email-info {
  flex: 1;
  min-width: 0;
}

.security-email-label {
  font-size: 14px;
  font-weight: 700;
  color: #1e293b;
}

.security-email-sub {
  font-size: 12px;
  color: #64748b;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Divisor */
.security-divider {
  height: 1px;
  background: #f1f5f9;
  margin: 20px 0;
}

/* Seção de alterar senha */
.security-section-title {
  font-size: 14px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.security-section-title i { color: #6366f1; }

/* ================================================================
   ADMIN — Badges de e-mail e row de confirmação
   ================================================================ */
.adm-badge--email-ok {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
  font-size: 11px;
  padding: 3px 8px;
}

.adm-badge--email-pend {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
  font-size: 11px;
  padding: 3px 8px;
}

/* Row de confirmação de e-mail no modal do admin */
.adm2-email-confirm-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 10px;
  padding: 12px 14px;
  margin: 0 0 16px;
  flex-wrap: wrap;
}

.adm2-email-confirm-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #92400e;
  flex: 1;
  min-width: 0;
}

/* ================================================================
   RESPONSIVO MOBILE
   ================================================================ */
@media (max-width: 600px) {
  .auth-token-modal {
    padding: 24px 18px 20px;
    border-radius: 20px 20px 0 0;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 100%;
    border-radius: 24px 24px 0 0;
  }

  .auth-token-modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .auth-token-value {
    font-size: 22px;
    letter-spacing: 4px;
  }

  .confirm-token-input {
    font-size: 18px !important;
    letter-spacing: 3px;
  }

  .security-email-status {
    flex-wrap: wrap;
    gap: 10px;
  }

  .adm2-email-confirm-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ================================================================
   CARD ALTERAR SENHA — regras de força e correspondência
   ================================================================ */

/* Botão de submit do card de alterar senha */
.chpw-btn {
  width: 100%;
  justify-content: center;
  margin-top: 4px;
}

/* Lista de regras de força */
.chpw-rules {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 8px;
}

.chpw-rule {
  font-size: 11.5px;
  font-weight: 600;
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color .2s;
}

.chpw-rule i {
  font-size: 10px;
  transition: color .2s;
}

/* Regra satisfeita */
.chpw-rule--ok {
  color: #16a34a;
}
.chpw-rule--ok i {
  color: #16a34a;
}

/* Indicador de correspondência (confirmar senha) */
.chpw-match-hint {
  font-size: 12px;
  font-weight: 600;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.chpw-match-hint.hidden { display: none; }

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

@media (max-width: 600px) {
  .chpw-rules { gap: 4px 8px; }
  .chpw-rule  { font-size: 11px; }
}
