/**
 * Reign sign-in/register popup - themed password show/hide eye.
 *
 * Matches the look of the login form's .password-eye but positions relative to
 * the wrapped input so it lines up on the BuddyPress register fields (whose
 * label/markup differs from the theme login form).
 */

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

.reign-pw-eye-wrap .reign-pw-eye {
	position: absolute;
	right: 8px;
	top: 50%;
	transform: translateY(-50%);
	z-index: 9;
	height: 32px;
	width: 32px;
	padding: 0;
	margin: 0;
	border: 0;
	background: none;
	color: #888da8;
	font-size: 16px;
	line-height: 1;
	cursor: pointer;
}

.reign-pw-eye-wrap .reign-pw-eye:hover,
.reign-pw-eye-wrap .reign-pw-eye:focus-visible {
	color: var(--reign-colors-theme, #0073aa);
}

.reign-pw-eye-wrap .reign-pw-eye:focus-visible {
	outline: 2px solid var(--reign-colors-theme, #0073aa);
	outline-offset: 2px;
}

/* Keep room for the eye so the toggled text doesn't sit under it, and make the
 * wrapped input fill the row (BuddyPress signup inputs are not 100% by default,
 * so the wrap would otherwise shrink them). */
.reign-pw-eye-wrap input {
	width: 100%;
	box-sizing: border-box;
	padding-right: 40px;
}

/* -------------------------------------------------------------------------
 * Harmonize the BuddyPress register popup with the Reign login form.
 * The register tab renders BuddyPress' signup form; these rules trim the
 * BuddyPress-only chrome that the clean login tab doesn't have, so the two
 * tabs read as one consistent form.
 * ---------------------------------------------------------------------- */

/* xprofile per-field visibility note ("This field may be seen by: ...") -
 * not relevant in a quick sign-up popup and absent from the login tab. */
.registration-login-form-popup .field-visibility-settings-notoggle,
.registration-login-form-popup .field-visibility-settings-toggle,
.registration-login-form-popup .field-visibility-settings {
	display: none;
}

/* Match the login form's field rhythm. */
.registration-login-form-popup form#signup-form .editfield,
.registration-login-form-popup #register-page .reign-pw-eye-wrap {
	margin-bottom: 17px;
}

/* Mute the password hint so it reads as helper text, like the login form. */
.registration-login-form-popup #register-page .description.indicator-hint {
	font-size: 12px;
	opacity: 0.7;
}

/* -------------------------------------------------------------------------
 * Orphaned-label fix (card 9947646906).
 *
 * The register tab renders the BuddyPress signup form. BuddyPress prints the
 * account-detail fields as bare `<label for="x">` + `<input id="x">` siblings
 * (no shared row wrapper), and xprofile fields inside `.editfield`. When a
 * register field is disabled, its control is hidden but the matching `<label>`
 * / `<legend>` is left behind as an orphan. These rules hide the label
 * together with its hidden field. Strictly scoped to the popup container so
 * the standalone BuddyPress register page is unaffected.
 * ---------------------------------------------------------------------- */

/* xprofile field row whose only control is hidden -> hide the whole row
 * (label/legend + input). */
.registration-login-form-popup .editfield:has( > fieldset > legend:only-child ),
.registration-login-form-popup .editfield:has( input[type="hidden"]:only-child ),
.registration-login-form-popup .editfield:not(:has( input:not([type="hidden"]), select, textarea )) {
	display: none;
}

/* Account-detail orphan: a label immediately followed by a hidden input, or a
 * label whose paired control is display:none, has nothing to describe. */
.registration-login-form-popup #basic-details-section > label:has( + input[type="hidden"] ),
.registration-login-form-popup #basic-details-section > label:has( + input[style*="display:none"] ),
.registration-login-form-popup #basic-details-section > label:has( + input[style*="display: none"] ) {
	display: none;
}

