/* Math CAPTCHA for Contact Form 7 */

/*
 * One row: question – answer box – refresh button.
 * The answer box shrinks on narrow screens instead of wrapping.
 * To allow wrapping again: .cf7mc { flex-wrap: wrap; }
 */
.cf7mc {
	display: inline-flex;
	flex-wrap: nowrap;
	align-items: center;
	gap: 0.5em;
	max-width: 100%;
	vertical-align: middle;
}

.cf7mc-question {
	flex: 0 0 auto;
	font-weight: 600;
	white-space: nowrap;
	transition: opacity 0.15s ease;
}

/*
 * The answer box and button use stronger selectors because themes often style
 * every form input/button, e.g.
 * `.wpcf7-form .wpcf7-form-control-wrap input[type="text"] { display: block; width: 100%; margin-bottom: 1em; }`,
 * which would push them onto their own lines.
 */
.wpcf7 .wpcf7-form .cf7mc input.cf7mc-answer,
.wpcf7-form .cf7mc input.cf7mc-answer,
.cf7mc input.cf7mc-answer {
	display: block;
	flex: 0 1 var(--cf7mc-input-width, 6em);
	box-sizing: border-box;
	width: var(--cf7mc-input-width, 6em);
	min-width: 3.5em;
	max-width: 100%;
	margin: 0;
	float: none;
	text-align: center;
}

.wpcf7 .wpcf7-form .cf7mc .cf7mc-refresh,
.wpcf7-form .cf7mc .cf7mc-refresh,
.cf7mc .cf7mc-refresh {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: auto;
	min-width: 0;
	height: auto;
	min-height: 0;
	margin: 0;
	padding: 0.4em;
	float: none;
	border: 1px solid currentColor;
	border-radius: 4px;
	background: transparent;
	box-shadow: none;
	color: inherit;
	font: inherit;
	line-height: 1;
	text-transform: none;
	opacity: 0.65;
	cursor: pointer;
}

.wpcf7 .wpcf7-form .cf7mc .cf7mc-refresh:hover,
.wpcf7 .wpcf7-form .cf7mc .cf7mc-refresh:focus-visible,
.wpcf7-form .cf7mc .cf7mc-refresh:hover,
.wpcf7-form .cf7mc .cf7mc-refresh:focus-visible,
.cf7mc .cf7mc-refresh:hover,
.cf7mc .cf7mc-refresh:focus-visible {
	opacity: 1;
}

.wpcf7 .wpcf7-form .cf7mc .cf7mc-refresh[hidden],
.wpcf7-form .cf7mc .cf7mc-refresh[hidden],
.cf7mc .cf7mc-refresh[hidden] {
	display: none;
}

.cf7mc-refresh svg {
	display: block;
	width: 1em;
	height: 1em;
}

.cf7mc--loading .cf7mc-question {
	opacity: 0.35;
}

.cf7mc--loading .cf7mc-refresh svg {
	animation: cf7mc-spin 0.8s linear infinite;
}

@keyframes cf7mc-spin {
	to {
		transform: rotate(360deg);
	}
}

@media (prefers-reduced-motion: reduce) {
	.cf7mc--loading .cf7mc-refresh svg {
		animation: none;
	}
}

/* Answered correctly, but another field needs fixing. */
.wpcf7 .wpcf7-form .cf7mc--passed input.cf7mc-answer,
.wpcf7 .wpcf7-form .cf7mc--passed .cf7mc-refresh,
.wpcf7-form .cf7mc--passed input.cf7mc-answer,
.wpcf7-form .cf7mc--passed .cf7mc-refresh,
.cf7mc--passed input.cf7mc-answer,
.cf7mc--passed .cf7mc-refresh {
	display: none;
}

.cf7mc--passed .cf7mc-question {
	flex-shrink: 1;
	min-width: 0;
	white-space: normal;
}

.cf7mc-passed-text {
	color: #1a7f37;
}

.cf7mc-sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}
