/* Estados visuales comunes de formularios. La logica vive en
   form-validation.js; estas clases solo pintan el estado. */
.form-field--invalid,
.form-field--invalid:focus {
  border-color: #dc2626 !important;
  background-color: #fef2f2 !important;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, .12) !important;
}
.form-field--valid,
.form-field--valid:focus {
  border-color: #16a34a !important;
  background-color: #f0fdf4 !important;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, .12) !important;
}
.form-validation-message {
  margin-top: .25rem;
  font-size: .75rem;
  line-height: 1rem;
}
.form-validation-message--invalid { color: #b91c1c; }
.form-validation-message--valid { color: #15803d; }
.form-validation-message[hidden] { display: none; }
.password-field {
  position: relative;
}
.password-field > input {
  padding-right: 3rem;
}
.password-toggle {
  position: absolute;
  top: 50%;
  right: .65rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  transform: translateY(-50%);
  border: 0;
  border-radius: .6rem;
  color: #64748b;
  background: transparent;
  cursor: pointer;
}
.password-toggle:hover {
  color: #0f766e;
  background: #ecfeff;
}
.password-toggle:focus-visible {
  outline: 2px solid #0f766e;
  outline-offset: 2px;
}
.password-toggle--changed .password-toggle-icon {
  animation: password-toggle-pop .18s ease-out;
}
.password-toggle-icon {
  width: 1.15rem;
  height: 1.15rem;
  transition: opacity .15s ease, transform .15s ease;
}
@keyframes password-toggle-pop {
  0% { opacity: .45; transform: scale(.75); }
  100% { opacity: 1; transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .password-toggle--changed .password-toggle-icon { animation: none; }
}

.form-submit--blocked { cursor: not-allowed; opacity: .6; }
