/* Reusable password input helpers: show/hide toggle + rules checklist.
   Used by signup, login, password reset, change-password.
   Activated by adding data-pw-toggle (eye button) and optionally
   data-pw-rules (live rules checklist) to a password input. */

.pw-wrap {
    position: relative;
    display: block;
    width: 100%;
}

.pw-wrap input[type="password"],
.pw-wrap input[type="text"] {
    width: 100%;
    padding-right: 42px !important; /* room for the eye button */
    box-sizing: border-box;
}

.pw-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    color: rgba(255, 255, 255, 0.55);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
    z-index: 2;
    line-height: 0;
}
.pw-toggle:hover {
    color: rgba(255, 255, 255, 0.95);
    background: rgba(255, 255, 255, 0.06);
}
.pw-toggle:focus-visible {
    outline: 2px solid #10b981;
    outline-offset: 1px;
}
.pw-toggle svg {
    width: 18px;
    height: 18px;
    display: block;
    pointer-events: none;
}

/* Rules checklist below the input */
.pw-rules {
    list-style: none;
    padding: 8px 12px;
    margin: 6px 0 0 0;
    font-size: 0.72rem;
    line-height: 1.5;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
}

.pw-rule {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 2px 0;
    color: rgba(255, 255, 255, 0.5);
    transition: color 0.18s;
}

.pw-rule.pw-pass {
    color: #10b981;
}

.pw-rule.pw-fail {
    color: rgba(255, 255, 255, 0.55);
}

.pw-rule.pw-optional {
    opacity: 0.75;
    font-style: italic;
}

.pw-rule-icon {
    display: inline-flex;
    width: 16px;
    height: 16px;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
    border-radius: 50%;
    border: 1.5px solid currentColor;
    font-size: 10px;
    line-height: 1;
}

.pw-rule.pw-pass .pw-rule-icon {
    background: #10b981;
    color: #fff;
    border-color: #10b981;
}
