/*
 * widget-password.css
 *
 * Reusable password input widget with visibility toggle button.
 * Works with any input styling — just wraps and adds the toggle overlay.
 */

.widget-password {
    position: relative;
    width: 100%;
}

/* Lock all dimensions to prevent any shifts when toggle changes state */
.widget-password .widget-password-input {
    height: 48px;                        /* fixed height — no reflow on type toggle */
    padding: 14px 46px 14px 16px;        /* explicit on all 4 sides */
    box-sizing: border-box;
    width: 100%;
    line-height: 1;                      /* consistent line-height across type=password and type=text */
}

/* Toggle button — positioned inside the field on the right */
.widget-password-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.35);
    transition: color 0.2s ease, transform 0.2s ease;
    /* Fixed dimensions prevent layout shifts */
    width: 34px;
    height: 34px;
}

.widget-password-toggle:hover {
    color: rgba(255, 255, 255, 0.65);
    transform: translateY(-50%) scale(1.1);
}

.widget-password-toggle:active {
    transform: translateY(-50%) scale(0.95);
}

/* Icon pair — stacked absolutely so swapping them causes no reflow */
.widget-password-icon {
    width: 20px;
    height: 20px;
    pointer-events: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: opacity 0.15s ease, visibility 0.15s ease;
}

.widget-password-icon.hidden {
    opacity: 0;
    visibility: hidden;
}
