/* Estilos para a Política e Feedback Visual de Senhas Fortes */

.password-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.password-input-wrapper input {
  width: 100%;
  box-sizing: border-box;
  padding-right: 42px !important; /* Espaço para o botão de mostrar/ocultar */
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1.5px solid var(--border);
}

.btn-toggle-password {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 8px;
  min-width: 36px;
  min-height: 36px;
  color: #64748b;
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  z-index: 2;
}

.btn-toggle-password:hover {
  color: #1e293b;
  background: rgba(0, 0, 0, 0.05);
}

.password-feedback-box {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 16px;
  margin-top: 10px;
  font-family: inherit;
  box-sizing: border-box;
  animation: fadeInFeedback 0.2s ease-out;
}

@keyframes fadeInFeedback {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.password-meter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  margin-bottom: 6px;
  font-weight: 600;
  color: #475569;
}

.password-strength-badge {
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  transition: all 0.3s ease;
}

.strength-0 {
  background: #f1f5f9;
  color: #64748b;
}

.strength-1 {
  background: #fee2e2;
  color: #b91c1c;
}

.strength-2 {
  background: #ffedd5;
  color: #c2410c;
}

.strength-3 {
  background: #fef9c3;
  color: #a16207;
}

.strength-4 {
  background: #dbeafe;
  color: #1d4ed8;
}

.strength-5 {
  background: #dcfce7;
  color: #15803d;
}

.password-meter-track {
  height: 6px;
  background: #e2e8f0;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 12px;
}

.password-meter-bar {
  height: 100%;
  width: 0%;
  border-radius: 6px;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s ease;
}

.bar-0 { width: 0%; background-color: #cbd5e1; }
.bar-1 { width: 20%; background-color: #ef4444; }
.bar-2 { width: 40%; background-color: #f97316; }
.bar-3 { width: 60%; background-color: #eab308; }
.bar-4 { width: 80%; background-color: #3b82f6; }
.bar-5 { width: 100%; background-color: #16a34a; }

.password-checklist {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

@media (min-width: 520px) {
  .password-checklist.cols-2 {
    grid-template-columns: 1fr 1fr;
  }
}

.password-check-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #64748b;
  transition: all 0.2s ease;
}

.check-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 800;
  background: #e2e8f0;
  color: #94a3b8;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.password-check-item.valid {
  color: #15803d;
  font-weight: 600;
}

.password-check-item.valid .check-icon {
  background: #16a34a;
  color: #ffffff;
}

.password-error-alert {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 8px;
  margin-top: 8px;
  display: none;
  align-items: center;
  gap: 6px;
}

.password-error-shake {
  animation: shakeInput 0.35s ease-in-out;
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2) !important;
}

@keyframes shakeInput {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-5px); }
  40%, 80% { transform: translateX(5px); }
}

/* ==============================================================================
   DARK MODE - FEEDBACK DE POLÍTICA DE SENHAS
   ============================================================================== */
[data-mode="dark"] .password-input-wrapper input {
  background: var(--bg-surface) !important;
  color: var(--text-primary) !important;
  border-color: var(--border) !important;
}

[data-mode="dark"] .password-input-wrapper input:-webkit-autofill,
[data-mode="dark"] .password-input-wrapper input:-webkit-autofill:hover,
[data-mode="dark"] .password-input-wrapper input:-webkit-autofill:focus,
[data-mode="dark"] .password-input-wrapper input:-webkit-autofill:active {
  -webkit-text-fill-color: var(--text-primary) !important;
  -webkit-box-shadow: 0 0 0 1000px var(--bg-surface) inset !important;
  box-shadow: 0 0 0 1000px var(--bg-surface) inset !important;
  border-color: var(--border) !important;
}

[data-mode="dark"] .password-feedback-box {
  background: var(--bg-surface);
  border-color: var(--border);
  color: var(--text-primary);
}

[data-mode="dark"] .password-meter-header {
  color: var(--text-secondary);
}

[data-mode="dark"] .password-meter-track {
  background: var(--border);
}

[data-mode="dark"] .password-check-item {
  color: var(--text-secondary);
}

[data-mode="dark"] .check-icon {
  background: var(--bg-subtle);
  color: var(--text-muted);
}

[data-mode="dark"] .password-check-item.valid {
  color: #4ade80;
}

[data-mode="dark"] .password-check-item.valid .check-icon {
  background: #22c55e;
  color: #ffffff;
}

[data-mode="dark"] .password-error-alert {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

[data-mode="dark"] .btn-toggle-password {
  color: var(--text-secondary);
}

[data-mode="dark"] .btn-toggle-password:hover {
  color: var(--text-primary);
  background: var(--bg-subtle);
}

[data-mode="dark"] .strength-0 {
  background: var(--bg-subtle);
  color: var(--text-muted);
}

[data-mode="dark"] .strength-1 {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}

[data-mode="dark"] .strength-2 {
  background: rgba(249, 115, 22, 0.2);
  color: #fdba74;
}

[data-mode="dark"] .strength-3 {
  background: rgba(234, 179, 8, 0.2);
  color: #fde047;
}

[data-mode="dark"] .strength-4 {
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
}

[data-mode="dark"] .strength-5 {
  background: rgba(34, 197, 94, 0.2);
  color: #86efac;
}
