/**
 * Show/hide control for password fields. The wrapper is added by
 * assets/js/password-toggle.js, so nothing here applies until it runs.
 */

.pw-field {
    position: relative;
    display: block;
}

/* The input keeps whatever the form already gave it; only room for the button
   is added, so this works with .p-form-control and any other field style. */
.pw-field > input {
    width: 100%;
    padding-right: 44px !important;
}

.pw-field__eye {
    position: absolute;
    top: 0;
    bottom: 0;
    right: 4px;
    width: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    background: none;
    color: rgba(148, 163, 184, .8);
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    border-radius: 8px;
    transition: color .15s, background .15s;
}

.pw-field__eye:hover,
.pw-field__eye:focus-visible {
    color: #facc15;
    background: rgba(250, 204, 21, .1);
}

/* Pressed means the password is currently readable — worth showing plainly. */
.pw-field__eye[aria-pressed="true"] { color: #facc15; }

.pw-field__eye i { pointer-events: none; }

/* Edge and IE add their own reveal control, which would sit under ours. */
.pw-field > input::-ms-reveal,
.pw-field > input::-ms-clear { display: none; }

@media (prefers-reduced-motion: reduce) {
    .pw-field__eye { transition: none; }
}
