/* The eye of ./PasswordReveal.js sits at the end of the field like the X of ./SearchClear.css.
   The field keeps room for it at all times, so no character ever runs below the eye and nothing
   moves when it appears. */
.tnx-password-control {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: center;
    min-width: 0;
    width: 100%;
}
.tnx-password-control > input[data-tnx-secret] {
    grid-area: 1 / 1;
    width: 100%;
    min-width: 0;
    margin-top: 0;
    margin-bottom: 0;
    padding-inline-end: 2.25rem !important;
    box-sizing: border-box;
}
/* Edge draws an eye of its own into password fields. */
.tnx-password-control > input::-ms-reveal,
.tnx-password-control > input::-ms-clear { display: none; }
.tnx-password-control > button.tnx-password-reveal[type="button"] {
    grid-area: 1 / 1;
    justify-self: end;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    min-width: 0;
    min-height: 0;
    margin: 0;
    margin-inline-end: 0.25rem;
    padding: 0;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: var(--text-color, inherit);
    box-shadow: none;
    font-size: 0;
    line-height: 0;
    cursor: pointer;
    opacity: 0.6;
    filter: none;
    /* Appearing and hiding with the value is immediate, unlike the fade of other buttons. */
    transition: opacity 0.2s ease;
}
.tnx-password-control > button.tnx-password-reveal svg {
    width: 1.1rem;
    height: 1.1rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
}
.tnx-password-control > button.tnx-password-reveal:hover,
.tnx-password-control > button.tnx-password-reveal:focus-visible { opacity: 1; background: transparent; filter: none; }
.tnx-password-control > button.tnx-password-reveal:focus-visible {
    outline: 2px solid var(--accent-color, currentColor);
    outline-offset: -2px;
}
/* Only a field with something in it has something to show. */
.tnx-password-control > input:is(:placeholder-shown, :disabled) ~ .tnx-password-reveal,
.tnx-password-control.is-kept > .tnx-password-reveal { visibility: hidden; }
.tnx-password-control:has(> input[hidden]) { display: none; }
