/* ============================================================================
   password-toggle — the eye that sits inside a password field
   ============================================================================
   The markup is built by shared/utils/password-toggle.js: each
   input[type="password"] is wrapped in `.password-field` with one
   `.password-toggle` button. Nothing here touches a field that was not wrapped,
   so a page that does not load the module looks exactly as it did before.

   The right padding is !important on purpose: the login and reset pages size
   their inputs with inline styles, and a stylesheet rule alone would lose to
   them - the button would sit on top of the text. It applies only inside a
   field this module created.
   ========================================================================== */

.password-field {
  position: relative;
  display: block;
  width: 100%;
}

.password-field > input {
  width: 100%;
  box-sizing: border-box;
  padding-right: 44px !important;
}

/* Edge draws its own reveal control inside password fields. Two eyes in one
   field is one too many, and this is the one Chrome and phones get too. */
.password-field > input::-ms-reveal {
  display: none;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #6b6b6b;
  cursor: pointer;
  line-height: 0;
}

.password-toggle:hover {
  color: #1a1a1a;
  background: rgba(0, 0, 0, 0.06);
}

.password-toggle:focus-visible {
  outline: 2px solid #007aff;
  outline-offset: 1px;
}

.password-toggle svg {
  display: block;
  width: 20px;
  height: 20px;
  pointer-events: none;
}

/* Password hidden: the open eye invites a look. Revealed: the struck eye
   says the next tap hides it again. */
.password-toggle .password-toggle-off {
  display: none;
}

.password-toggle[aria-pressed="true"] .password-toggle-on {
  display: none;
}

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