/*
 * Colours come from the active theme's presets (CongoFox child theme), with
 * ArcticFox fallbacks. Matches the demo registration form's look.
 */
.cfcf {
	--cfcf-primary: var(--wp--preset--color--accent-1, #0b6ede);
	--cfcf-primary-hover: var(--wp--custom--brand--primary-hover, #0957b0);
	--cfcf-accent: var(--wp--preset--color--accent-2, #7b89eb);
	--cfcf-surface: var(--wp--preset--color--accent-5, #f5f3f8);
	--cfcf-text: var(--wp--preset--color--contrast, #212529);
	--cfcf-muted: var(--wp--preset--color--accent-4, #6c757d);
	--cfcf-field-bg: var(--wp--preset--color--base, #fff);
	--cfcf-border: #ced4da;
	--cfcf-danger: var(--wp--custom--brand--danger, #b02a37);
	--cfcf-danger-surface: var(--wp--custom--brand--danger-surface, #fbeaec);
	--cfcf-success: var(--wp--custom--brand--success, #146c43);
	--cfcf-success-surface: var(--wp--custom--brand--success-surface, #e8f3ee);

	box-sizing: border-box;
	padding: clamp(1.25rem, 4vw, 2.25rem);
	border: 1px solid color-mix(in srgb, var(--cfcf-accent) 30%, transparent);
	border-top: 4px solid var(--cfcf-primary);
	border-radius: 12px;
	background: var(--cfcf-surface);
	color: var(--cfcf-text);
	box-shadow: 0 1px 2px rgba(33, 37, 41, 0.04), 0 6px 20px rgba(33, 37, 41, 0.06);
	scroll-margin-top: 5rem;
}

.cfcf-form {
	display: grid;
	gap: 1.15rem;
}

.cfcf-row {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
	gap: 1.15rem;
}

.cfcf-field label {
	display: block;
	margin-bottom: 0.35rem;
	font-size: 0.9375rem;
	font-weight: 600;
}

.cfcf-optional {
	font-weight: 400;
	color: var(--cfcf-muted);
}

.cfcf-field input,
.cfcf-field select,
.cfcf-field textarea {
	box-sizing: border-box;
	width: 100%;
	min-height: 2.75rem;
	padding: 0.6rem 0.8rem;
	font: inherit;
	font-size: 1rem;
	color: var(--cfcf-text);
	background-color: var(--cfcf-field-bg);
	border: 1px solid var(--cfcf-border);
	border-radius: 6px;
	transition: border-color 0.15s, box-shadow 0.15s;
}

.cfcf-field textarea {
	resize: vertical;
	min-height: 8rem;
}

.cfcf-field input:focus,
.cfcf-field select:focus,
.cfcf-field textarea:focus {
	outline: none;
	border-color: var(--cfcf-primary);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--cfcf-primary) 25%, transparent);
}

.cfcf-field.has-error input,
.cfcf-field.has-error select,
.cfcf-field.has-error textarea {
	border-color: var(--cfcf-danger);
}

.cfcf-error {
	margin: 0.35rem 0 0;
	font-size: 0.875rem;
	color: var(--cfcf-danger);
}

.cfcf-error:empty {
	display: none;
}

/* Reserve the widget's height so the button doesn't jump when it loads. */
.cfcf-captcha .cf-turnstile {
	min-height: 65px;
}

.cfcf-alert {
	margin-bottom: 1.25rem;
	padding: 0.85rem 1rem;
	border-left: 4px solid var(--cfcf-danger);
	border-radius: 6px;
	background: var(--cfcf-danger-surface);
	color: var(--cfcf-danger);
	font-size: 0.9375rem;
}

.cfcf-submit.wp-element-button {
	width: 100%;
	padding: 0.85rem 1.25rem;
	font-size: 1rem;
	font-weight: 600;
	color: #fff;
	background-color: var(--cfcf-primary);
	border: 0;
	border-radius: 6px;
	cursor: pointer;
	transition: background-color 0.15s;
}

.cfcf-submit.wp-element-button:hover {
	background-color: var(--cfcf-primary-hover);
}

.cfcf-submit:disabled {
	opacity: 0.65;
	cursor: wait;
}

.cfcf-success {
	border-top-color: var(--cfcf-success);
	background: var(--cfcf-success-surface);
}

.cfcf-success h3 {
	margin: 0 0 0.4rem;
}

.cfcf-success p {
	margin: 0;
}

/* Honeypot: off-screen but still a real text input so bots fill it. */
.cfcf-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}
