
/* Shared password visibility controls */

.password-field {
    position: relative;

    display: block;

    width: 100%;
    min-width: 0;
}


/* Preserve the existing input appearance */

.password-field > input {
    width: 100%;
    min-width: 0;

    padding-right: 46px !important;
}


/* Password visibility button */

.password-toggle-btn {
    position: absolute;

    top: 50%;
    right: 6px;

    transform: translateY(-50%);

    display: inline-grid;
    place-items: center;

    width: 34px;
    height: 34px;

    padding: 0;

    border: none;
    border-radius: 7px;

    background: transparent;

    color: var(
        --muted-color,
        var(--bs-secondary-color, #6b7280)
    );

    cursor: pointer;

    transition:
        background-color 0.15s ease,
        color 0.15s ease;
}

.password-toggle-btn svg {
    display: block;

    flex-shrink: 0;

    pointer-events: none;
}

.password-toggle-btn:not(:disabled):hover {
    background: rgba(128, 128, 128, 0.10);

    color: var(
        --text-color,
        var(--bs-body-color, #202124)
    );
}

.password-toggle-btn[aria-pressed="true"] {
    color: var(
        --text-color,
        var(--bs-body-color, #202124)
    );
}

.password-toggle-btn:focus-visible {
    outline: 2px solid
        var(--primary-color, #fbbc04);

    outline-offset: 1px;
}

.password-toggle-btn:disabled {
    opacity: 0.45;

    cursor: not-allowed;
}


/* Prevent duplicate native password visibility controls */

.password-field > input::-ms-reveal,
.password-field > input::-ms-clear {
    display: none;
}


/* Preserve validation icons */

.password-field > input.is-valid,
.password-field > input.is-invalid,
.was-validated .password-field > input:valid,
.was-validated .password-field > input:invalid {
    padding-right: 76px !important;

    background-position: right 46px center;
}


/* Reduced motion accessibility */

@media (prefers-reduced-motion: reduce) {
    .password-toggle-btn {
        transition: none;
    }
}