/**
 * Popup form fields, set like the checkout's.
 *
 * The checkout gave up stacked labels for a label that starts where the value
 * will be and floats up the moment the field is in use: one line of screen per
 * field instead of two, and — unlike a placeholder — the label is still there
 * once the field is filled in. The popups were the last forms on the site still
 * doing it the old way, and most of them had no label at all, only a
 * placeholder that vanished as soon as anyone typed.
 *
 * Everything is scoped to .modal-box, so no other form on the site is touched.
 * The labels themselves are made by assets/js/popup-forms.js, because the CF7
 * forms render none and their markup lives in the database rather than in git.
 *
 * @package BuddyBoss Theme Child (Adorno)
 */

.modal-box .adorno-ff {
	position: relative;
	/* Room above the value for the label to float into. */
	padding: 18px 0 0;
	margin: 0 0 14px;
}

.modal-box .adorno-ff__label {
	position: absolute;
	left: 0;
	top: 18px;
	z-index: 1;
	display: block;
	width: auto;
	max-width: 100%;
	margin: 0;
	padding: 0;
	font-size: 15px;
	font-weight: 400;
	line-height: 24px;
	color: #a3a5a9;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	pointer-events: none;
	transition: top 0.16s ease, font-size 0.16s ease, line-height 0.16s ease, color 0.16s ease;
}

.modal-box .adorno-ff:focus-within > .adorno-ff__label,
.modal-box .adorno-ff.is-filled > .adorno-ff__label {
	top: 0;
	font-size: 12px;
	line-height: 16px;
	color: #6e7075;
}

/* Without JavaScript the filled state still reads correctly. Kept in its own
   rule because an unsupported :has() would invalidate the whole selector list. */
.modal-box .adorno-ff:has(select) > .adorno-ff__label,
.modal-box .adorno-ff:has(input:not(:placeholder-shown)) > .adorno-ff__label,
.modal-box .adorno-ff:has(textarea:not(:placeholder-shown)) > .adorno-ff__label {
	top: 0;
	font-size: 12px;
	line-height: 16px;
	color: #6e7075;
}

.modal-box .adorno-ff input[type="text"],
.modal-box .adorno-ff input[type="email"],
.modal-box .adorno-ff input[type="tel"],
.modal-box .adorno-ff input[type="url"],
.modal-box .adorno-ff input[type="number"],
.modal-box .adorno-ff input[type="date"],
.modal-box .adorno-ff textarea,
.modal-box .adorno-ff select {
	width: 100% !important;
	max-width: 100%;
	box-sizing: border-box;
	margin: 0;
	padding: 0 0 6px;
	background: none;
	border: 0 !important;
	border-bottom: 1px solid #e7e9ec !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	font-size: 15px;
	line-height: 24px;
	color: #000;
	height: auto;
	min-height: 30px;
}

.modal-box .adorno-ff textarea {
	min-height: 80px !important;
	height: 80px !important;
	resize: vertical;
}

.modal-box .adorno-ff input:focus,
.modal-box .adorno-ff textarea:focus,
.modal-box .adorno-ff select:focus {
	border-bottom-color: #000 !important;
	outline: none;
}

/* The real placeholder is a hint, not a label, so it waits until the label has
   moved out of its way. */
.modal-box .adorno-ff input::placeholder,
.modal-box .adorno-ff textarea::placeholder {
	color: transparent !important;
	transition: color 0.16s ease;
}

.modal-box .adorno-ff:focus-within input::placeholder,
.modal-box .adorno-ff:focus-within textarea::placeholder {
	color: #a3a5a9 !important;
}

/* CF7 puts its own validation text straight after the control. */
.modal-box .adorno-ff .wpcf7-not-valid-tip {
	display: block;
	margin: 6px 0 0;
	font-size: 12px;
	line-height: 1.45;
	color: #c0392b;
}

.modal-box .adorno-ff:has(.wpcf7-not-valid) input,
.modal-box .adorno-ff:has(.wpcf7-not-valid) textarea {
	border-bottom-color: #c0392b !important;
}

/* The control wrapper CF7 puts between the row and the field must not become a
   box of its own, or the underline sits away from the text. */
.modal-box .adorno-ff .wpcf7-form-control-wrap {
	display: block;
	margin: 0;
}
