/* Show/hide ("eye") button on every password input in the admin.
   Paired with ../js/password_toggle.js, which wraps each input in
   .passwordFieldWrap and adds the .passwordToggle button. */

/* The wrapper is what the button is positioned against. Inline-block on change
   forms, so the input keeps the width the admin gives it. */
.passwordFieldWrap {
    position: relative;
    display: inline-block;
    max-width: 100%;
    vertical-align: middle;
}

/* The login form lays its inputs out full width. */
#login-form .passwordFieldWrap {
    display: block;
}

/* Room for the button, so a long password does not run underneath it. */
.passwordFieldWrap input {
    padding-right: 2.6rem;
}

.passwordToggle {
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    width: 2.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    border: none;
    background: none;
    cursor: pointer;
    /* Follows the admin's own text colour, so this works in dark mode and under
       the admin_interface theme without knowing either. */
    color: var(--body-quiet-color, #666);
}

.passwordToggle:hover {
    color: var(--link-fg, #417690);
    background: none;
}

/* Keyboard users must be able to see where they are. */
.passwordToggle:focus-visible {
    outline: 2px solid var(--link-fg, #417690);
    outline-offset: -2px;
}

.passwordToggle svg {
    width: 1.15rem;
    height: 1.15rem;
    display: block;
}
