/* Shared, progressively enhanced password visibility control. */
.sw-password-field {
  position: relative;
  display: block;
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
}

.sw-password-field > input {
  width: 100%;
  padding-inline-end: 3rem !important;
}

.sw-password-field--with-lock-icon > input {
  padding-inline-start: 2.5rem !important;
}

.sw-password-lock-icon {
  position: absolute;
  z-index: 3;
  top: 50%;
  inset-inline-start: .75rem;
  display: block;
  width: 1rem;
  height: 1rem;
  color: var(--brand-muted-text, #64748b);
  pointer-events: none;
  transform: translateY(-50%);
}

/* Keep an authored Lucide lock/keyhole above the enhanced input background. */
.sw-input-group--password > .sw-input-group__icon:first-child {
  z-index: 5;
}

.sw-password-toggle {
  appearance: none;
  position: absolute;
  z-index: 4;
  top: 50%;
  inset-inline-end: .25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  max-height: calc(100% - .25rem);
  padding: 0;
  border: 0;
  border-radius: .45rem;
  background: transparent;
  color: var(--brand-muted-text, #64748b);
  line-height: 1;
  cursor: pointer;
  transform: translateY(-50%);
  transition: background-color .15s ease, color .15s ease;
}

.sw-password-toggle:hover {
  background: rgba(100, 116, 139, .12);
  color: var(--brand-heading-text, #0f172a);
}

.sw-password-toggle:focus-visible {
  outline: 2px solid var(--brand-input-focus-border, var(--brand-primary, #2563eb));
  outline-offset: 1px;
}

.sw-password-toggle:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.sw-password-toggle svg {
  display: block;
  width: 1.15rem;
  height: 1.15rem;
  pointer-events: none;
}

.sw-password-toggle svg[hidden] {
  display: none !important;
}

.sw-password-field > input::-ms-clear,
.sw-password-field > input::-ms-reveal {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .sw-password-toggle {
    transition: none;
  }
}
