/*
 * password-toggle.css — the show/hide-password (eye) button.
 * Used with password-toggle.js, which inserts the button into every
 * <input type="password"> that sits inside .input-items.
 *
 * v2 — the eye sits on the LEFT edge of the field, clear of the key icon and
 * the text.
 *
 * v1 placed it at the logical "end" of the field (inset-inline-end). In
 * main.css .input-items lays out left-to-right, with the text right-aligned and
 * the key icon on the right — so "end" resolved to the RIGHT, and the eye landed
 * on top of the key icon and the typed characters. Physical left/right now:
 * every page using this is Arabic, the text runs from the right, and the left
 * edge of the field is the free side.
 *
 * The input gets left padding equal to the button plus a gap, so a long
 * password stops before the eye instead of running under it.
 */

.input-items.has-pw-toggle {
    position: relative;
}

/* Room for the eye: 8px edge + 32px button + 8px gap. */
.input-items.has-pw-toggle input {
    padding-left: 48px !important;
    box-sizing: border-box;
}

.input-items .pw-toggle {
    position: absolute;
    top: 50%;
    left: 8px !important;
    right: auto !important;
    transform: translateY(-50%);
    z-index: 2;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin: 0;
    padding: 0;

    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #6B6B6B;
    cursor: pointer;
    line-height: 0;
    -webkit-tap-highlight-color: transparent;
}

.input-items .pw-toggle:hover {
    color: #333333;
    background: rgba(0, 0, 0, .05);
}

/* Keyboard focus must be visible; mouse clicks do not leave a ring. */
.input-items .pw-toggle:focus {
    outline: none;
}
.input-items .pw-toggle:focus-visible {
    outline: 2px solid #0E7C66;
    outline-offset: 1px;
}

.input-items .pw-toggle svg {
    display: block;
    width: 20px;
    height: 20px;
    pointer-events: none;
}

/* Edge/IE draw their own reveal eye inside password fields — one eye is enough. */
input::-ms-reveal,
input::-ms-clear {
    display: none;
}
