/**
 * Contact Form 7 — success notice and submit button states.
 * Scoped to .wpcf7 only; !important beats theme CF7 overrides.
 */

.wpcf7 {
	--hpf-cf7-blue: #1291df;
	--hpf-cf7-blue-d: #0e7bc2;
	--hpf-cf7-success: #16a34a;
	--hpf-cf7-success-dark: #15803d;
	--hpf-cf7-success-bg: #dcfce7;
	--hpf-cf7-success-border: #86efac;
	--hpf-cf7-gray-bg: #e5e5e5;
	--hpf-cf7-gray-text: #999;
}

/* Required field labels — inline next to label text */
.wpcf7 .hpf-cf7-required {
	color: #d63638;
	display: inline;
	font-weight: 700;
	margin-left: 3px;
	vertical-align: baseline;
	white-space: nowrap;
}

.wpcf7 label .hpf-cf7-required,
.wpcf7 .elementor-field-label .hpf-cf7-required {
	line-height: inherit;
}

/* One validation tip per field — hide duplicates from CF7 + native validation overlap */
.wpcf7-form-control-wrap .wpcf7-not-valid-tip ~ .wpcf7-not-valid-tip {
	display: none !important;
}

/* Submit — gray and disabled until all required fields are valid */
.wpcf7 input[type="submit"],
.wpcf7 button[type="submit"],
.wpcf7 .wpcf7-submit {
	background: var(--hpf-cf7-gray-bg) !important;
	border: none !important;
	border-radius: 8px !important;
	box-shadow: none !important;
	color: var(--hpf-cf7-gray-text) !important;
	cursor: not-allowed !important;
	font-weight: 700 !important;
	opacity: 1 !important;
	pointer-events: none;
	transition: background 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
}

/* Submit — blue when all required fields are complete */
.wpcf7 input[type="submit"].hpf-cf7-ready:not(:disabled),
.wpcf7 button[type="submit"].hpf-cf7-ready:not(:disabled),
.wpcf7 .wpcf7-submit.hpf-cf7-ready:not(:disabled) {
	background: var(--hpf-cf7-blue) !important;
	box-shadow: 0 4px 18px rgba(18, 145, 223, 0.35) !important;
	color: #fff !important;
	cursor: pointer !important;
	pointer-events: auto;
}

.wpcf7 input[type="submit"].hpf-cf7-ready:hover,
.wpcf7 button[type="submit"].hpf-cf7-ready:hover,
.wpcf7 .wpcf7-submit.hpf-cf7-ready:hover {
	background: var(--hpf-cf7-blue-d) !important;
}

/* Submit — gray while CF7 is sending (instant on AJAX start) */
.wpcf7.submitting input[type="submit"],
.wpcf7.submitting button[type="submit"],
.wpcf7.submitting .wpcf7-submit,
.wpcf7.submitting .elementor-button[type="submit"] {
	background: var(--hpf-cf7-gray-bg) !important;
	background-color: var(--hpf-cf7-gray-bg) !important;
	border-color: var(--hpf-cf7-gray-bg) !important;
	box-shadow: none !important;
	color: var(--hpf-cf7-gray-text) !important;
	cursor: not-allowed !important;
	opacity: 1 !important;
	pointer-events: none !important;
}

/* Submit — inactive again after successful send */
.wpcf7 input[type="submit"].hpf-cf7-sent,
.wpcf7 button[type="submit"].hpf-cf7-sent,
.wpcf7 .wpcf7-submit.hpf-cf7-sent,
.wpcf7.sent input[type="submit"],
.wpcf7.sent button[type="submit"],
.wpcf7.sent .wpcf7-submit,
.wpcf7.hpf-cf7-form-locked input[type="submit"],
.wpcf7.hpf-cf7-form-locked button[type="submit"],
.wpcf7.hpf-cf7-form-locked .wpcf7-submit,
.wpcf7[data-hpf-cf7-submit-locked="1"] input[type="submit"],
.wpcf7[data-hpf-cf7-submit-locked="1"] button[type="submit"],
.wpcf7[data-hpf-cf7-submit-locked="1"] .wpcf7-submit,
.wpcf7 input[type="submit"].hpf-cf7-ready.hpf-cf7-sent,
.wpcf7 button[type="submit"].hpf-cf7-ready.hpf-cf7-sent,
.wpcf7 .wpcf7-submit.hpf-cf7-ready.hpf-cf7-sent,
.wpcf7.sent input[type="submit"].hpf-cf7-ready,
.wpcf7.sent button[type="submit"].hpf-cf7-ready,
.wpcf7.sent .wpcf7-submit.hpf-cf7-ready,
	.wpcf7.hpf-cf7-form-locked .hpf-cf7-ready,
.wpcf7.hpf-cf7-form-locked .elementor-button,
.wpcf7.sent .elementor-button[type="submit"],
.wpcf7[data-hpf-cf7-mail-sent="1"] input[type="submit"],
.wpcf7[data-hpf-cf7-mail-sent="1"] button[type="submit"],
.wpcf7[data-hpf-cf7-mail-sent="1"] .wpcf7-submit,
.wpcf7[data-hpf-cf7-mail-sent="1"] .elementor-button {
	background: var(--hpf-cf7-gray-bg) !important;
	background-color: var(--hpf-cf7-gray-bg) !important;
	border-color: var(--hpf-cf7-gray-bg) !important;
	box-shadow: none !important;
	color: var(--hpf-cf7-gray-text) !important;
	cursor: not-allowed !important;
	opacity: 1 !important;
	pointer-events: none !important;
}

.wpcf7.hpf-cf7-form-locked input[type="submit"]:hover,
.wpcf7.hpf-cf7-form-locked button[type="submit"]:hover,
.wpcf7.hpf-cf7-form-locked .wpcf7-submit:hover,
.wpcf7.sent input[type="submit"]:hover,
.wpcf7.sent button[type="submit"]:hover,
.wpcf7.sent .wpcf7-submit:hover {
	background: var(--hpf-cf7-gray-bg) !important;
	background-color: var(--hpf-cf7-gray-bg) !important;
	box-shadow: none !important;
	color: var(--hpf-cf7-gray-text) !important;
}

/* Success response — green notice (override theme blue CF7 styles) */
.wpcf7.sent .wpcf7-response-output,
.wpcf7 .wpcf7-response-output.hpf-cf7-success-output {
	background-color: var(--hpf-cf7-success-bg) !important;
	border: 2px solid var(--hpf-cf7-success-border) !important;
	border-radius: 12px !important;
	box-shadow: none !important;
	color: var(--hpf-cf7-success-dark) !important;
	display: flex !important;
	align-items: flex-start !important;
	gap: 12px !important;
	font-size: 16px !important;
	font-weight: 600 !important;
	line-height: 1.5 !important;
	margin: 20px 0 0 !important;
	padding: 16px 18px !important;
	text-align: left !important;
	white-space: pre-line !important;
	width: 100% !important;
}

.wpcf7 .wpcf7-response-output.hpf-cf7-success-output {
	white-space: normal !important;
}

.wpcf7.sent .wpcf7-response-output::before,
.wpcf7 .wpcf7-response-output.hpf-cf7-success-output::before {
	content: none !important;
	display: none !important;
}

.wpcf7 .hpf-cf7-success__icon {
	align-items: center;
	background: var(--hpf-cf7-success);
	border-radius: 50%;
	color: #fff;
	display: flex;
	flex-shrink: 0;
	font-size: 15px;
	font-weight: 700;
	height: 32px;
	justify-content: center;
	line-height: 1;
	margin-top: 1px;
	width: 32px;
}

.wpcf7 .hpf-cf7-success__text {
	color: var(--hpf-cf7-success-dark) !important;
	flex: 1 1 auto;
	min-width: 0;
}

.wpcf7 .hpf-cf7-success-msg__line {
	color: var(--hpf-cf7-success-dark) !important;
	display: block !important;
	hyphens: none !important;
	line-height: 1.45 !important;
	margin: 0 !important;
	overflow-wrap: normal !important;
	padding: 0 !important;
	word-break: normal !important;
	word-wrap: normal !important;
}

.wpcf7 .hpf-cf7-success-msg__line + .hpf-cf7-success-msg__line {
	margin-top: 4px !important;
}

@media (max-width: 767px) {
	.wpcf7.sent .wpcf7-response-output,
	.wpcf7 .wpcf7-response-output.hpf-cf7-success-output {
		align-items: flex-start !important;
		display: grid !important;
		font-size: 15px !important;
		gap: 0 !important;
		grid-template-columns: 28px 1fr;
		padding: 14px 14px !important;
	}

	.wpcf7 .hpf-cf7-success__icon {
		font-size: 13px;
		grid-column: 1;
		grid-row: 1;
		height: 28px;
		margin-top: 0;
		width: 28px;
	}

	.wpcf7 .hpf-cf7-success__text {
		grid-column: 1 / -1;
		grid-row: 2;
		margin-top: 10px;
		min-width: 0;
		width: 100%;
	}

	.wpcf7 .hpf-cf7-success-msg__line + .hpf-cf7-success-msg__line {
		margin-top: 6px !important;
	}
}
