/**
 * CodeLine Contact Form — form styles.
 *
 * Scoped to .cl-cf7-fe-form / .cl-cf7-fe. Works with any field layout built in
 * Contact Form 7: generic controls are styled, and the optional layout classes
 * (cl-cf7-fe__row, __field, __label, __hint, __optional, __note, __privacy,
 * __actions) refine it. The form inherits the site's font; colours follow the
 * site (black, white, soft blue → lilac → pink tints). Field borders and the
 * service indicators meet WCAG 2.2 non-text contrast (3:1).
 */

.cl-cf7-fe {
	--clfe-ink: #0a0a0b;
	--clfe-text: #18181b;
	--clfe-muted: #52525b;
	--clfe-surface: #fff;
	--clfe-line: #ececf0;
	--clfe-field-border: #8a8a94;
	--clfe-field-border-hover: #3f3f46;
	--clfe-chip-border: #d4d4d8;
	--clfe-indicator: #71717a;
	--clfe-focus: #0a0a0b;
	--clfe-halo: rgba(139, 114, 222, 0.22);
	--clfe-error: #b42318;
	--clfe-error-bg: #fef3f2;
	--clfe-tint: linear-gradient(120deg, #eef8fe 0%, #f4f0fc 55%, #fcf0f7 100%);
	--clfe-accent: linear-gradient(90deg, #8ecdf0 0%, #b9a3ec 50%, #f2a7cf 100%);
	--clfe-radius-field: 12px;
	--clfe-radius-card: 28px;
	--clfe-gap: 18px;
	--clfe-duration: 160ms;
	--clfe-ease: cubic-bezier(0.2, 0.7, 0.2, 1);

	container-type: inline-size;
	position: relative;
	padding: 40px 40px 36px;
	border: 1px solid var(--clfe-line);
	border-radius: var(--clfe-radius-card);
	background: var(--clfe-surface);
	box-shadow: 0 1px 2px rgba(16, 16, 40, 0.04), 0 30px 60px -32px rgba(76, 64, 140, 0.28);
	color: var(--clfe-text);
	font-family: inherit;
	font-size: 16px;
	line-height: 1.5;
	text-align: left;
}

@media (max-width: 600px) {
	.cl-cf7-fe {
		padding: 28px 20px 24px;
		border-radius: 22px;
	}
}

@media (max-width: 360px) {
	.cl-cf7-fe {
		padding: 24px 14px 20px;
		border-radius: 18px;
	}
}

.cl-cf7-fe *,
.cl-cf7-fe *::before,
.cl-cf7-fe *::after {
	box-sizing: border-box;
}

.cl-cf7-fe [hidden] {
	display: none !important;
}

/* Keep focused fields and the error summary clear of a sticky site header. */
.cl-cf7-fe input,
.cl-cf7-fe textarea,
.cl-cf7-fe select,
.cl-cf7-fe__summary,
.cl-cf7-fe__success-title {
	scroll-margin-top: 110px;
	scroll-margin-bottom: 24px;
}

/* Progress accent line: fills as the required fields are completed (set by the script). */
.cl-cf7-fe__progress {
	position: absolute;
	top: 0;
	right: var(--clfe-radius-card);
	left: var(--clfe-radius-card);
	height: 3px;
	overflow: hidden;
	border-radius: 0 0 3px 3px;
	background: #f1f1f4;
	pointer-events: none;
}

.cl-cf7-fe__progress-bar {
	display: block;
	width: 100%;
	height: 100%;
	background: var(--clfe-accent);
	transform: scaleX(var(--cl-progress, 0));
	transform-origin: left center;
	transition: transform 420ms var(--clfe-ease);
}

.cl-cf7-fe.is-sent .cl-cf7-fe__progress {
	display: none;
}

.cl-cf7-fe__body {
	display: grid;
	gap: var(--clfe-gap);
}

.cl-cf7-fe__body > * {
	grid-column: 1 / -1;
	min-width: 0;
}

.cl-cf7-fe__note {
	margin: 0;
	color: var(--clfe-muted);
	font-size: 14px;
}

.cl-cf7-fe__row {
	display: grid;
	gap: var(--clfe-gap) 16px;
}

@container (min-width: 520px) {
	.cl-cf7-fe__row {
		grid-template-columns: 1fr 1fr;
	}
}

.cl-cf7-fe__field {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
}

/* Labels and legends (beats Blocksy's ".wpcf7 label:not(...)" rule). */
.cl-cf7-fe label.cl-cf7-fe__label,
.cl-cf7-fe legend {
	display: block;
	margin: 0;
	padding: 0;
	color: var(--clfe-text);
	font-size: 15px;
	font-weight: 600;
	line-height: 1.4;
}

.cl-cf7-fe__optional,
.cl-cf7-fe__hint {
	color: var(--clfe-muted);
	font-size: 14px;
	font-weight: 400;
}

.cl-cf7-fe__hint {
	display: block;
	margin-top: 2px;
}

/* Text-like controls. */
.cl-cf7-fe .wpcf7-form-control-wrap {
	display: block;
}

/* Labels written as <label>Text [field]</label> (CF7's default layout). */
.cl-cf7-fe label > .wpcf7-form-control-wrap {
	margin-top: 6px;
}

.cl-cf7-fe__body > p {
	margin: 0;
}

.cl-cf7-fe input[type="text"],
.cl-cf7-fe input[type="email"],
.cl-cf7-fe input[type="tel"],
.cl-cf7-fe input[type="url"],
.cl-cf7-fe input[type="number"],
.cl-cf7-fe input[type="date"],
.cl-cf7-fe select,
.cl-cf7-fe textarea {
	display: block;
	width: 100%;
	min-height: 48px;
	margin: 0;
	padding: 11px 14px;
	border: 1px solid var(--clfe-field-border);
	border-radius: var(--clfe-radius-field);
	outline: 2px solid transparent;
	background: var(--clfe-surface);
	box-shadow: none;
	color: var(--clfe-text);
	font: inherit;
	font-size: 16px;
	font-weight: 400;
	line-height: 1.5;
	transition: border-color var(--clfe-duration) var(--clfe-ease), box-shadow var(--clfe-duration) var(--clfe-ease);
	-webkit-appearance: none;
	appearance: none;
}

.cl-cf7-fe textarea {
	height: 132px;
	min-height: 108px;
	resize: vertical;
}

.cl-cf7-fe ::placeholder {
	color: #71717a;
	opacity: 1;
}

.cl-cf7-fe input[type="text"]:hover,
.cl-cf7-fe input[type="email"]:hover,
.cl-cf7-fe input[type="tel"]:hover,
.cl-cf7-fe input[type="url"]:hover,
.cl-cf7-fe input[type="number"]:hover,
.cl-cf7-fe input[type="date"]:hover,
.cl-cf7-fe select:hover,
.cl-cf7-fe textarea:hover {
	border-color: var(--clfe-field-border-hover);
}

.cl-cf7-fe input[type="text"]:focus,
.cl-cf7-fe input[type="email"]:focus,
.cl-cf7-fe input[type="tel"]:focus,
.cl-cf7-fe input[type="url"]:focus,
.cl-cf7-fe input[type="number"]:focus,
.cl-cf7-fe input[type="date"]:focus,
.cl-cf7-fe select:focus,
.cl-cf7-fe textarea:focus {
	border-color: var(--clfe-focus);
	outline: 2px solid transparent;
	box-shadow: 0 0 0 1px var(--clfe-focus), 0 0 0 5px var(--clfe-halo);
}

/* Error states (classes set by Contact Form 7). */
.cl-cf7-fe .wpcf7-not-valid:is(input, textarea, select) {
	border-color: var(--clfe-error);
	box-shadow: 0 0 0 1px var(--clfe-error);
}

.cl-cf7-fe .wpcf7-not-valid:is(input, textarea, select):focus {
	box-shadow: 0 0 0 1px var(--clfe-error), 0 0 0 5px rgba(180, 35, 24, 0.16);
}

.cl-cf7-fe .wpcf7-not-valid-tip {
	display: flex;
	gap: 6px;
	align-items: flex-start;
	margin-top: 6px;
	color: var(--clfe-error);
	font-size: 14px;
	font-style: normal;
	font-weight: 500;
}

.cl-cf7-fe .wpcf7-not-valid-tip::before {
	content: "!";
	display: inline-grid;
	flex: 0 0 auto;
	place-items: center;
	width: 18px;
	height: 18px;
	margin-top: 1px;
	border-radius: 50%;
	background: var(--clfe-error);
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	line-height: 1;
}

/* Fieldsets (service selector and any other group). */
.cl-cf7-fe .cl-cf7-fe__body fieldset {
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
}

.cl-cf7-fe fieldset > .cl-cf7-fe__hint {
	margin: 0 0 12px;
}

.cl-cf7-fe legend {
	margin-bottom: 2px;
}

/* CF7 checkbox, radio and acceptance lists. */
.cl-cf7-fe .wpcf7-list-item {
	display: block;
	margin: 0 0 6px;
}

.cl-cf7-fe .wpcf7-list-item label {
	display: inline-flex;
	gap: 10px;
	align-items: center;
	min-height: 44px;
	font-weight: 400;
}

.cl-cf7-fe .wpcf7-list-item input {
	width: 20px;
	height: 20px;
	margin: 0;
}

/* Service cards: real checkboxes, one or more can be chosen. */
.cl-cf7-fe .cl-cf7-fe-services__grid {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.cl-cf7-fe label.cl-cf7-fe-service {
	display: inline-flex;
	position: relative;
	gap: 10px;
	align-items: center;
	min-height: 48px;
	margin: 0;
	padding: 8px 18px 8px 11px;
	border: 1px solid var(--clfe-chip-border);
	border-radius: 999px;
	background: var(--clfe-surface);
	color: var(--clfe-text);
	cursor: pointer;
	font-size: 15px;
	font-weight: 500;
	line-height: 1.3;
	transition: border-color var(--clfe-duration) var(--clfe-ease), background-color var(--clfe-duration) var(--clfe-ease), box-shadow var(--clfe-duration) var(--clfe-ease), transform var(--clfe-duration) var(--clfe-ease);
	-webkit-tap-highlight-color: transparent;
	-webkit-user-select: none;
	user-select: none;
}

.cl-cf7-fe label.cl-cf7-fe-service:hover {
	border-color: #a1a1aa;
	background-color: #fafafa;
}

.cl-cf7-fe label.cl-cf7-fe-service:active {
	transform: scale(0.98);
}

/* Narrow forms: full-width cards with a softer radius. */
@container (max-width: 459px) {
	.cl-cf7-fe label.cl-cf7-fe-service {
		flex: 1 1 100%;
		border-radius: 14px;
	}
}

/* The checkbox itself is the indicator: "+" when free, a check when chosen. */
.cl-cf7-fe input.cl-cf7-fe-service__input {
	display: inline-block;
	flex: 0 0 auto;
	width: 26px;
	height: 26px;
	margin: 0;
	border: 1.5px solid var(--clfe-indicator);
	border-radius: 50%;
	background: var(--clfe-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233f3f46' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M12 7v10M7 12h10'/%3E%3C/svg%3E") center / 16px no-repeat;
	box-shadow: none;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
	transition: background-color var(--clfe-duration) var(--clfe-ease), border-color var(--clfe-duration) var(--clfe-ease);
}

.cl-cf7-fe input.cl-cf7-fe-service__input::before,
.cl-cf7-fe input.cl-cf7-fe-service__input::after {
	content: none;
	display: none;
}

.cl-cf7-fe input.cl-cf7-fe-service__input:checked {
	border-color: var(--clfe-ink);
	background: var(--clfe-ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6.5 12.5l3.5 3.5 7.5-8'/%3E%3C/svg%3E") center / 16px no-repeat;
	animation: cl-cf7-fe-pop 220ms var(--clfe-ease);
}

@keyframes cl-cf7-fe-pop {
	0% {
		transform: scale(0.82);
	}

	60% {
		transform: scale(1.08);
	}

	100% {
		transform: none;
	}
}

/* Selected card (class set by the script; :has() covers it without script). */
.cl-cf7-fe label.cl-cf7-fe-service.is-selected {
	border-color: var(--clfe-ink);
	background: var(--clfe-tint);
	box-shadow: inset 0 0 0 1px var(--clfe-ink);
}

/* Focus ring on the card; the checkbox's own ring is the fallback. */
.cl-cf7-fe input.cl-cf7-fe-service__input:focus-visible {
	outline: 2px solid var(--clfe-focus);
	outline-offset: 3px;
}

@supports selector(:has(*)) {
	.cl-cf7-fe input.cl-cf7-fe-service__input:focus-visible {
		outline: none;
	}

	.cl-cf7-fe label.cl-cf7-fe-service:has(:focus-visible) {
		outline: 2px solid var(--clfe-focus);
		outline-offset: 3px;
	}

	.cl-cf7-fe label.cl-cf7-fe-service:has(:checked) {
		border-color: var(--clfe-ink);
		background: var(--clfe-tint);
		box-shadow: inset 0 0 0 1px var(--clfe-ink);
	}
}

.cl-cf7-fe .wpcf7-not-valid.cl-cf7-fe-services__grid label.cl-cf7-fe-service {
	border-color: var(--clfe-error);
}

.cl-cf7-fe .wpcf7-not-valid.cl-cf7-fe-services__grid input.cl-cf7-fe-service__input:not(:checked) {
	border-color: var(--clfe-error);
}

/* Privacy notice. */
.cl-cf7-fe__privacy {
	margin: 0;
	color: var(--clfe-muted);
	font-size: 14px;
}

.cl-cf7-fe__privacy a {
	color: var(--clfe-ink);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.cl-cf7-fe__privacy a:focus-visible,
.cl-cf7-fe__summary a:focus-visible {
	outline: 2px solid var(--clfe-focus);
	outline-offset: 2px;
	border-radius: 2px;
}

.cl-cf7-fe__sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	white-space: nowrap;
}

/* Privacy note and submit button share one row on wider forms. */
@container (min-width: 560px) {
	.cl-cf7-fe__body {
		grid-template-columns: minmax(0, 1fr) auto;
		column-gap: 28px;
	}

	.cl-cf7-fe__body > .cl-cf7-fe__privacy:has(+ .cl-cf7-fe__actions) {
		grid-column: 1;
		align-self: center;
	}

	.cl-cf7-fe__body > .cl-cf7-fe__privacy + .cl-cf7-fe__actions {
		grid-column: 2;
		justify-content: flex-end;
	}
}

/* Submit (the site's black pill buttons). Any submit button in the form is styled. */
.cl-cf7-fe__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	align-items: center;
}

.cl-cf7-fe input[type="submit"],
.cl-cf7-fe button[type="submit"] {
	float: none;
	min-width: 200px;
	min-height: 52px;
	margin: 0;
	padding: 14px 32px;
	border: 2px solid var(--clfe-ink);
	border-radius: 999px;
	background: var(--clfe-ink);
	box-shadow: none;
	color: #fff;
	cursor: pointer;
	font: inherit;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.2;
	transition: background-color var(--clfe-duration) var(--clfe-ease), box-shadow var(--clfe-duration) var(--clfe-ease), transform var(--clfe-duration) var(--clfe-ease);
}

.cl-cf7-fe input[type="submit"]:hover,
.cl-cf7-fe button[type="submit"]:hover {
	border-color: #27272a;
	background: #27272a;
	box-shadow: 0 12px 24px -14px rgba(10, 10, 11, 0.6);
	transform: translateY(-1px);
}

.cl-cf7-fe input[type="submit"]:active,
.cl-cf7-fe button[type="submit"]:active {
	box-shadow: none;
	transform: none;
}

.cl-cf7-fe input[type="submit"]:focus-visible,
.cl-cf7-fe button[type="submit"]:focus-visible {
	outline: 2px solid var(--clfe-focus);
	outline-offset: 3px;
}

.cl-cf7-fe input[type="submit"]:disabled,
.cl-cf7-fe button[type="submit"]:disabled {
	box-shadow: none;
	cursor: not-allowed;
	opacity: 0.55;
	transform: none;
}

@container (max-width: 419px) {
	.cl-cf7-fe input[type="submit"],
	.cl-cf7-fe button[type="submit"] {
		width: 100%;
	}
}

/* Busy: CF7 sets .submitting; the lazy reCAPTCHA loader sets aria-busy while fetching the token. */
.cl-cf7-fe-form.submitting [type="submit"],
.cl-cf7-fe-form[aria-busy="true"] [type="submit"] {
	box-shadow: none;
	cursor: progress;
	opacity: 0.8;
	transform: none;
}

/* CF7's spinner sits inside the button's right padding (no space taken while hidden). */
.cl-cf7-fe__actions {
	position: relative;
}

.cl-cf7-fe .cl-cf7-fe__actions .wpcf7-spinner {
	position: absolute;
	top: 50%;
	right: 10px;
	width: 18px;
	height: 18px;
	margin: -9px 0 0;
	background-color: rgba(255, 255, 255, 0.3);
	pointer-events: none;
}

.cl-cf7-fe .cl-cf7-fe__actions .wpcf7-spinner::before {
	top: 3px;
	left: 3px;
	width: 4px;
	height: 4px;
	background-color: #fff;
	transform-origin: 6px 6px;
}

/* Outside an actions row, keep CF7's inline spinner. */
.cl-cf7-fe .wpcf7-spinner {
	margin: 0 0 0 8px;
}

/* CF7 response output, outside the .cl-cf7-fe root. */
.cl-cf7-fe-form .wpcf7-response-output {
	margin: 16px 0 0 !important;
	padding: 12px 16px;
	border-width: 1px;
	border-radius: 12px;
	font-size: 15px;
	font-style: normal;
	line-height: 1.5;
}

.cl-cf7-fe-form.spam .wpcf7-response-output,
.cl-cf7-fe-form.failed .wpcf7-response-output,
.cl-cf7-fe-form.aborted .wpcf7-response-output {
	border-color: #b42318;
	background: #fef3f2;
	color: #b42318;
}

/* With the script running, the summary and success panel replace these. */
.cl-cf7-fe-form.is-enhanced.invalid .wpcf7-response-output,
.cl-cf7-fe-form.is-enhanced.unaccepted .wpcf7-response-output,
.cl-cf7-fe-form.is-enhanced.sent .wpcf7-response-output {
	display: none;
}

/* Error summary. */
.cl-cf7-fe__summary {
	margin-bottom: var(--clfe-gap);
	padding: 16px 20px;
	border: 1px solid #f1b5ae;
	border-left: 4px solid var(--clfe-error);
	border-radius: 14px;
	background: var(--clfe-error-bg);
}

.cl-cf7-fe__summary:focus {
	outline: 2px solid var(--clfe-focus);
	outline-offset: 3px;
}

.cl-cf7-fe__summary-title {
	margin: 0 0 8px;
	color: var(--clfe-error);
	font-size: 16px;
	font-weight: 700;
	line-height: 1.4;
}

.cl-cf7-fe__summary ul {
	margin: 0;
	padding-left: 20px;
}

.cl-cf7-fe__summary li {
	margin: 4px 0;
}

.cl-cf7-fe__summary a {
	color: var(--clfe-error);
	font-weight: 500;
	text-decoration: underline;
	text-underline-offset: 2px;
}

/* Success panel. */
.cl-cf7-fe__success {
	display: grid;
	gap: 12px;
	justify-items: start;
	padding: 32px 28px;
	border-radius: 20px;
	background: var(--clfe-tint);
}

.cl-cf7-fe__success-icon {
	display: grid;
	width: 48px;
	height: 48px;
	place-items: center;
	border-radius: 50%;
	background: var(--clfe-ink);
}

.cl-cf7-fe__success-icon::before {
	content: "";
	width: 18px;
	height: 10px;
	margin-top: -4px;
	border-bottom: 3px solid #fff;
	border-left: 3px solid #fff;
	transform: rotate(-45deg);
}

.cl-cf7-fe .cl-cf7-fe__success-title {
	margin: 0;
	color: var(--clfe-ink);
	font-size: 22px;
	font-weight: 800;
	line-height: 1.3;
}

.cl-cf7-fe__success-title:focus {
	outline: none;
}

.cl-cf7-fe__success-title:focus-visible {
	outline: 2px solid var(--clfe-focus);
	outline-offset: 3px;
}

.cl-cf7-fe__success-text {
	margin: 0;
	color: var(--clfe-muted);
}

.cl-cf7-fe button.cl-cf7-fe__again {
	min-height: 48px;
	margin: 4px 0 0;
	padding: 10px 24px;
	border: 2px solid var(--clfe-ink);
	border-radius: 999px;
	background: #fff;
	color: var(--clfe-ink);
	cursor: pointer;
	font: inherit;
	font-size: 15px;
	font-weight: 600;
}

.cl-cf7-fe button.cl-cf7-fe__again:hover {
	background: var(--clfe-ink);
	color: #fff;
}

.cl-cf7-fe button.cl-cf7-fe__again:focus-visible {
	outline: 2px solid var(--clfe-focus);
	outline-offset: 3px;
}

.cl-cf7-fe.is-sent .cl-cf7-fe__body {
	display: none;
}

.cl-cf7-fe.is-sent .cl-cf7-fe__success {
	animation: cl-cf7-fe-in 220ms var(--clfe-ease) both;
}

@keyframes cl-cf7-fe-in {
	from {
		opacity: 0;
		transform: translateY(6px);
	}

	to {
		opacity: 1;
		transform: none;
	}
}

/* Honeypot: off-screen for people, still present for bots. */
.cl-cf7-fe .cl-cf7-fe-hp {
	position: absolute !important;
	left: -10000px !important;
	width: 1px !important;
	height: 1px !important;
	overflow: hidden !important;
}

@media (prefers-reduced-motion: reduce) {
	.cl-cf7-fe *,
	.cl-cf7-fe *::before,
	.cl-cf7-fe *::after {
		transition: none !important;
		animation: none !important;
	}
}

@media (forced-colors: active) {
	.cl-cf7-fe {
		border-color: CanvasText;
	}

	.cl-cf7-fe input.cl-cf7-fe-service__input {
		forced-color-adjust: none;
		border-color: CanvasText;
		background-color: Canvas;
	}

	.cl-cf7-fe input.cl-cf7-fe-service__input:checked {
		border-color: Highlight;
		background-color: Highlight;
	}

	.cl-cf7-fe label.cl-cf7-fe-service:has(:checked),
	.cl-cf7-fe label.cl-cf7-fe-service.is-selected {
		border-color: Highlight;
	}

	.cl-cf7-fe__progress {
		display: none;
	}
}
