/*
 * Stay Connected: what Fluent Forms' markup needs on top of the design system's own form CSS (components.css), which applies
 * as written because the adapter (inc/stay-connected.php) puts unifor-field, unifor-fieldset, unifor-formrow and unifor-form
 * classes on it. Fluent Forms' own stylesheets are switched off.
 */

/* Fluent Forms wraps each label and control in a div; display: contents makes label, control and error direct children of
   .unifor-field, so the field's own 6px gap and order apply. */
.unifor-form .ff-el-input--label,
.unifor-form .ff-el-input--content {
	display: contents;
}

/* Fluent Forms' own fieldset (its hidden legend is the form title) is the form's column. */
.unifor-form > fieldset {
	display: flex;
	flex-direction: column;
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
}

.unifor-form .ff-el-group {
	margin: 0;
}

/* Fluent Forms' own error and success styling is replaced by the design's summary, inline errors and Notice. */
.unifor-form .ff-el-group .error,
.unifor-formblock .ff-errors-in-stack,
.unifor-formblock [id$="_errors"].ff-errors-in-stack {
	display: none;
}

.unifor-formblock .ff-message-success {
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
}

.unifor-form .unifor-form__actions .ff-el-group {
	margin: 0;
}

.unifor-form .unifor-form__actions .cf-turnstile {
	max-width: 100%;
}

/* The sent state: the success Notice, the help line, then Return home, 24px apart. */
.unifor-sent {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: var(--space-3, 24px);
}

.unifor-sent .unifor-notice {
	align-self: stretch;
}

.unifor-sent__help {
	margin: 0;
	font: 400 18px/1.4 var(--font-family);
	color: var(--text-body, var(--ink-black));
}

.unifor-form-missing {
	margin: 0;
	font: var(--type-meta);
	color: var(--text-muted);
}

/* The summary sits inside Fluent Forms' wrapper, so the form block's own gap doesn't reach it. */
.unifor-formblock__errors {
	margin-bottom: var(--related-gap, 24px);
}

/* An error on the picker's field must not colour the open list's own search box, and its icon keeps its room. */
.unifor-wp__panel .unifor-field__control {
	padding: 11px 14px 11px 46px;
	border-width: 1px;
	border-color: var(--warm-charcoal);
}

/* Warm Charcoal "Area N" on the hover fill is under 4.5:1 (axe color-contrast), so the highlighted rows print it in ink. A fix for
   design-system/ (picker row states); this keeps the form accessible until the next /design-sync. */
.unifor-wp__row:hover .unifor-wp__area,
.unifor-wp__row[data-active="true"] .unifor-wp__area,
.unifor-wp__row[data-selected="true"] .unifor-wp__area {
	color: var(--ink-black);
}

/* The Workplace Picker's open list floats over the content below; the screen-reader line is the design system's. */
.unifor-form .unifor-wp {
	min-width: 0;
}
