/*
 * Fluent Forms skin. Loaded only on pages that render a form.
 *
 * Fluent Forms' own stylesheet keeps its grid/column layout intact; only the
 * visual layer is replaced here. Selectors are scoped under .fluentform so
 * nothing leaks into the rest of the site.
 */

.fluentform .ff-el-group {
	margin-bottom: var(--wp--preset--spacing--30);
}

/* --------------------------------------------------------------- labels -- */

.fluentform .ff-el-input--label label {
	display: inline-block;
	margin-bottom: 0.45rem;
	color: var(--wp--preset--color--text-dim);
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--wp--preset--font-size--xs);
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.14em;
}

/* Terminal prompt prefix. ASCII only — the font subset has no dingbats. */
.fluentform .ff-el-input--label label::before {
	content: "> ";
	color: var(--wp--preset--color--teal);
}

.fluentform .ff-el-is-required.asterisk-right label:after {
	color: var(--wp--preset--color--magenta);
}

/* --------------------------------------------------------------- fields -- */

.fluentform .ff-el-form-control {
	width: 100%;
	padding: 0.7em 0.85em;
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--teal) 55%, transparent);
	border-radius: 2px;
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--text);
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--wp--preset--font-size--md);
	line-height: 1.5;
	box-shadow: none;
	transition: border-color var(--wp--custom--transition),
		box-shadow var(--wp--custom--transition);
	/* 16px minimum stops iOS Safari zooming the viewport on focus. */
	min-height: 2.75rem;
}

.fluentform textarea.ff-el-form-control {
	min-height: 8rem;
	resize: vertical;
}

.fluentform .ff-el-form-control::placeholder {
	color: var(--wp--preset--color--text-dim);
	opacity: 0.7;
}

.fluentform .ff-el-form-control:hover {
	border-color: color-mix(in srgb, var(--wp--preset--color--cyan) 70%, transparent);
}

.fluentform .ff-el-form-control:focus {
	outline: none;
	border-color: var(--wp--preset--color--cyan);
	box-shadow: var(--wp--preset--shadow--glow-cyan);
}

/* Keyboard users still get the global focus ring. */
.fluentform .ff-el-form-control:focus-visible {
	outline: 2px solid var(--wp--preset--color--yellow);
	outline-offset: 2px;
}

.fluentform select.ff-el-form-control {
	appearance: none;
	-webkit-appearance: none;
	padding-right: 2rem;
	/* Chevron drawn as a gradient pair so no icon font or SVG is needed. */
	background-image: linear-gradient(45deg, transparent 50%, var(--wp--preset--color--cyan) 50%),
		linear-gradient(135deg, var(--wp--preset--color--cyan) 50%, transparent 50%);
	background-position: calc(100% - 1.1rem) center, calc(100% - 0.75rem) center;
	background-size: 0.35rem 0.35rem, 0.35rem 0.35rem;
	background-repeat: no-repeat;
}

/* ------------------------------------------------------ checks & radios -- */

.fluentform .ff-el-form-check input[type="checkbox"],
.fluentform .ff-el-form-check input[type="radio"] {
	accent-color: var(--wp--preset--color--cyan);
	width: 1rem;
	height: 1rem;
}

.fluentform .ff-el-form-check label {
	color: var(--wp--preset--color--text);
	text-transform: none;
	letter-spacing: normal;
	font-size: var(--wp--preset--font-size--sm);
}

.fluentform .ff-el-form-check label::before {
	content: none;
}

/* -------------------------------------------------------------- submit -- */

.fluentform .ff-btn-submit,
.fluentform .ff_btn_style {
	padding: 0.75em 1.6em;
	border: 1px solid var(--wp--preset--color--cyan);
	border-radius: 2px;
	background: transparent;
	color: var(--wp--preset--color--cyan);
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--wp--preset--font-size--sm);
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.12em;
	cursor: pointer;
	transition: background var(--wp--custom--transition),
		color var(--wp--custom--transition),
		box-shadow var(--wp--custom--transition);
}

.fluentform .ff-btn-submit:hover,
.fluentform .ff-btn-submit:focus-visible {
	background: var(--wp--preset--color--cyan);
	color: var(--wp--preset--color--base);
	box-shadow: var(--wp--preset--shadow--glow-cyan);
}

.fluentform .ff-btn-submit:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

/* ------------------------------------------------------------- states -- */

.fluentform .ff-el-is-error .ff-el-form-control,
.fluentform .ff-el-form-control.ff-el-is-error {
	border-color: var(--wp--preset--color--magenta);
}

.fluentform .error.text-danger,
.fluentform .ff-el-is-error .error {
	margin-top: 0.35rem;
	color: var(--wp--preset--color--magenta);
	font-size: var(--wp--preset--font-size--xs);
}

.fluentform .error.text-danger::before {
	content: "! ";
}

.ff-message-success,
.fluentform_wrapper .ff-message-success {
	padding: var(--wp--preset--spacing--30);
	border: 1px solid var(--wp--preset--color--green);
	border-radius: 2px;
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--green);
	font-family: var(--wp--preset--font-family--mono);
}

.ff-message-success::before {
	content: "[ ok ] ";
}

/* Fluent Forms' own loading spinner, recoloured. */
.fluentform .ff_submitting .ff-btn-submit {
	color: var(--wp--preset--color--yellow);
	border-color: var(--wp--preset--color--yellow);
}
