/**
 * Eye toggle for input[type="password"] — paired with js/password-toggle.js.
 *
 * The wrapper is inline-flex so it inherits the input's block-level
 * width without disrupting the surrounding form field rhythm. The
 * button sits inside the input's right padding visually, but stays a
 * sibling in the DOM so the input retains all of Drupal's existing
 * focus/error styling.
 */

.np-password-wrap {
  display: inline-flex;
  align-items: stretch;
  position: relative;
  width: 100%;
}

.np-password-wrap > input[type="password"],
.np-password-wrap > input[type="text"] {
  /* Reserve space on the right for the toggle so the entered text
   * doesn't slide under the eye icon. The input itself stays the
   * full width of its container; the visual padding gives the icon
   * room to live inside the input's box. */
  flex: 1 1 auto;
  padding-right: calc(var(--np-space-7, 36px) + var(--np-space-2, 8px));
  min-width: 0;
}

.np-password-toggle {
  position: absolute;
  inset-block: 0;
  inset-inline-end: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--np-space-7, 36px);
  background: transparent;
  border: 0;
  padding: 0;
  margin: 0;
  color: var(--np-text-tertiary);
  cursor: pointer;
  transition: color var(--np-duration-base, 150ms) var(--np-ease-standard, ease);
}

.np-password-toggle:hover,
.np-password-toggle:focus-visible {
  color: var(--np-color-accent-deep);
}

.np-password-toggle:focus-visible {
  outline: 2px solid var(--np-border-focus, currentColor);
  outline-offset: 2px;
  border-radius: 2px;
}

.np-password-toggle__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
}

.np-password-toggle .np-password-toggle__eye-off { display: none; }
.np-password-toggle[aria-pressed="true"] .np-password-toggle__eye { display: none; }
.np-password-toggle[aria-pressed="true"] .np-password-toggle__eye-off { display: inline-block; }
