/* Show/hide password button, shared by every password field on the website and
   the admin sign-in pages. Markup: a wrapper with class "pw-field" (it may also be
   the page's own field shell), the input with class "pw-input", then
   <x-password-toggle for="inputId"/>. Behaviour lives in /assets/js/pw-toggle.js. */

.pw-field { position: relative; }

/* Room for the button so typed text never runs under it. The selector is kept
   specific (and !important) because the admin theme pads its inputs with !important. */
html .pw-field input.pw-input { padding-right: 52px !important; }

/* The browser's own reveal and clear buttons would sit next to ours. */
.pw-field input.pw-input::-ms-reveal,
.pw-field input.pw-input::-ms-clear { display: none; }

.pw-toggle {
    position: absolute; top: 50%; right: 4px; z-index: 3;
    transform: translateY(-50%);
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; margin: 0; padding: 0;
    border: 0; border-radius: 9px; background: transparent;
    color: #7d7469; line-height: 0; cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: color .15s, background-color .15s;
}
/* The hit area stays 44px; the visible hover and focus shape is a smaller inset
   square, so it never crowds the field's own border. */
.pw-toggle::before {
    content: ""; position: absolute; inset: 4px; border-radius: 8px;
    background: transparent; transition: background-color .15s;
}
.pw-toggle svg { position: relative; display: block; width: 20px; height: 20px; flex: 0 0 auto; pointer-events: none; }
.pw-toggle svg[hidden] { display: none; }
.pw-toggle:hover { color: #241e18; }
.pw-toggle:hover::before { background-color: #f6f3ee; }
.pw-toggle[aria-pressed="true"] { color: #1f8f46; }
.pw-toggle:focus { outline: 0; }
.pw-toggle:focus-visible { color: #1f8f46; }
.pw-toggle:focus-visible::before { background-color: #e9f9f0; box-shadow: 0 0 0 2px #1f8f46; }
