.password-input-wrapper {
    position: relative;
    width: 100%;
    min-width: 0;
}

.password-input-wrapper > input {
    width: 100%;
    padding-right: 2.75rem !important;
}

/* 隐藏浏览器自带的密码显示按钮，避免与右侧统一按钮重复。 */
.password-input-wrapper > input::-ms-reveal,
.password-input-wrapper > input::-ms-clear {
    display: none;
}

.password-input-wrapper > input::-webkit-credentials-auto-fill-button {
    position: absolute;
    right: 0;
    visibility: hidden;
    pointer-events: none;
}

.password-visibility-toggle {
    position: absolute;
    top: 50%;
    right: 0.4rem;
    z-index: 3;
    display: inline-flex;
    width: 2rem;
    height: 2rem;
    align-items: center;
    justify-content: center;
    padding: 0;
    transform: translateY(-50%);
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted, #6b7280);
    cursor: pointer;
}

.password-visibility-toggle:hover,
.password-visibility-toggle:focus-visible {
    background: rgba(34, 211, 238, 0.12);
    color: var(--primary-color, #0f766e);
}

.password-visibility-toggle:focus-visible {
    outline: 2px solid var(--primary-color, #0f766e);
    outline-offset: 1px;
}

.password-visibility-toggle .bi {
    font-size: 1rem;
    line-height: 1;
}

.password-input-wrapper > .form-control-sm + .password-visibility-toggle {
    right: 0.3rem;
    width: 1.75rem;
    height: 1.75rem;
}

html[data-theme="dark"] .password-visibility-toggle {
    color: var(--text-secondary, #c2d0df);
}
