/**
 * Contact Form 7 presentation layer.
 *
 * IMPORTANT: this file is styling only. No CF7 field name, ID, shortcode or
 * markup is altered anywhere in this theme — the forms are wrapped and skinned
 * purely with CSS so the existing booking/cancellation automations, Google
 * Sheets mappings and mail tags keep working untouched.
 */

/* ==========================================================================
   Form shell
   ========================================================================== */

.wpcf7 {
	max-width: 720px;
	margin-inline: auto;
	padding: clamp(1.25rem, 3vw, 2rem);
	border: 1px solid var(--lpa-border);
	border-radius: var(--lpa-radius-lg);
	background: var(--lpa-white);
	box-shadow: var(--lpa-shadow);
}

.wpcf7-form p {
	margin-bottom: 1rem;
}

/* CF7 emits a bare <br> between tags; keep the rhythm without extra markup. */
.wpcf7-form br {
	line-height: 1.9;
}

.wpcf7-form label {
	display: block;
	margin-bottom: 0.35rem;
	color: var(--lpa-slate);
	font-weight: 600;
	font-size: 0.9375rem;
}

/* ==========================================================================
   Controls
   ========================================================================== */

.wpcf7-form-control:not(.wpcf7-submit):not(.wpcf7-acceptance):not([type="checkbox"]):not([type="radio"]),
.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 input[type="tel"],
.wpcf7 input[type="url"],
.wpcf7 input[type="number"],
.wpcf7 input[type="date"],
.wpcf7 input[type="time"],
.wpcf7 select,
.wpcf7 textarea {
	width: 100%;
	padding: 0.7rem 0.9rem;
	border: 1px solid var(--lpa-border);
	border-radius: var(--lpa-radius);
	background: var(--lpa-white);
	color: var(--lpa-slate);
	font: inherit;
	font-size: 1rem; /* >=16px stops iOS zooming the viewport on focus */
	line-height: 1.4;
	transition: border-color var(--lpa-transition), box-shadow var(--lpa-transition), background var(--lpa-transition);
	appearance: none;
}

.wpcf7 textarea {
	min-height: 140px;
	resize: vertical;
}

.wpcf7 select {
	/* Chevron drawn inline so no extra HTTP request is needed. */
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath fill='none' stroke='%234A5568' stroke-width='2' d='M1 1l6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 0.9rem center;
	padding-right: 2.4rem;
}

.wpcf7 input:hover,
.wpcf7 select:hover,
.wpcf7 textarea:hover {
	border-color: var(--lpa-slate-200);
}

.wpcf7 input:focus,
.wpcf7 select:focus,
.wpcf7 textarea:focus {
	border-color: var(--lpa-green);
	box-shadow: 0 0 0 3px rgba(76, 175, 80, .18);
	outline: none;
}

.wpcf7 ::placeholder {
	color: var(--lpa-slate-400);
	opacity: 1;
}

.wpcf7 input[readonly],
.wpcf7 input:disabled,
.wpcf7 select:disabled,
.wpcf7 textarea:disabled {
	background: var(--lpa-bg);
	color: var(--lpa-slate-400);
	cursor: not-allowed;
}

/* Checkboxes & radios */

.wpcf7-list-item {
	display: inline-flex;
	align-items: center;
	margin: 0 1rem 0.5rem 0;
}

.wpcf7-list-item-label {
	margin-left: 0.45rem;
	font-weight: 500;
}

.wpcf7 input[type="checkbox"],
.wpcf7 input[type="radio"] {
	width: 1.1rem;
	height: 1.1rem;
	accent-color: var(--lpa-green);
	cursor: pointer;
}

.wpcf7-acceptance .wpcf7-list-item {
	display: flex;
	align-items: flex-start;
	margin: 0;
}

.wpcf7-acceptance .wpcf7-list-item-label {
	font-size: 0.9rem;
	color: var(--lpa-slate-600);
	font-weight: 400;
}

/* ==========================================================================
   Submit + spinner
   ========================================================================== */

.wpcf7 .wpcf7-submit {
	width: auto;
	min-width: 180px;
	padding: 0.8rem 1.75rem;
	border: 0;
	border-radius: var(--lpa-radius);
	background: var(--lpa-green);
	color: var(--lpa-white);
	font-weight: 600;
	font-size: 1rem;
	cursor: pointer;
	box-shadow: var(--lpa-shadow-sm);
	transition: background var(--lpa-transition), transform var(--lpa-transition), box-shadow var(--lpa-transition);
}

.wpcf7 .wpcf7-submit:hover {
	background: var(--lpa-green-600);
	transform: translateY(-1px);
	box-shadow: var(--lpa-shadow);
}

.wpcf7 .wpcf7-submit:disabled {
	background: var(--lpa-slate-200);
	color: var(--lpa-slate-600);
	cursor: progress;
	transform: none;
}

.wpcf7-spinner {
	background-color: var(--lpa-green);
}

/* Dim the form while CF7 is posting so double submits read as blocked. */
.wpcf7 form.submitting .wpcf7-form-control-wrap {
	opacity: .65;
	transition: opacity var(--lpa-transition);
}

/* ==========================================================================
   Validation & response states
   ========================================================================== */

.wpcf7-not-valid-tip {
	display: block;
	margin-top: 0.35rem;
	color: var(--lpa-danger);
	font-size: 0.85rem;
	font-weight: 500;
}

.wpcf7 .wpcf7-not-valid {
	border-color: var(--lpa-danger);
	box-shadow: 0 0 0 3px rgba(229, 62, 62, .12);
}

.wpcf7 .wpcf7-response-output {
	margin: 1.25rem 0 0;
	padding: 0.85rem 1rem;
	border: 1px solid var(--lpa-border);
	border-left-width: 4px;
	border-radius: var(--lpa-radius-sm);
	background: var(--lpa-bg);
	font-size: 0.95rem;
}

.wpcf7 form.sent .wpcf7-response-output {
	border-color: var(--lpa-green);
	background: var(--lpa-green-050);
	color: var(--lpa-green-700);
}

.wpcf7 form.invalid .wpcf7-response-output,
.wpcf7 form.unaccepted .wpcf7-response-output,
.wpcf7 form.failed .wpcf7-response-output,
.wpcf7 form.aborted .wpcf7-response-output {
	border-color: var(--lpa-danger);
	background: #FDECEC;
	color: var(--lpa-danger);
}

/* ==========================================================================
   Companion plugins (multi-step, conditional fields, cost calculator)
   Styled defensively — selectors are additive, so a plugin update that changes
   markup degrades to plain controls rather than breaking the form.
   ========================================================================== */

.cf7mls_next,
.cf7mls_back {
	padding: 0.7rem 1.4rem;
	border: 0;
	border-radius: var(--lpa-radius);
	background: var(--lpa-green);
	color: var(--lpa-white);
	font-weight: 600;
	cursor: pointer;
}

.cf7mls_back {
	background: transparent;
	color: var(--lpa-slate);
	box-shadow: inset 0 0 0 2px var(--lpa-border);
}

.wpcf7cf-hidden-group,
.wpcf7cf_repeater .wpcf7cf-hidden {
	display: none !important;
}

/* Reduce the CF7 recaptcha badge footprint without hiding it (Google's terms
   require either the badge or an attribution line). */
.grecaptcha-badge {
	box-shadow: var(--lpa-shadow-sm) !important;
}

/* Privacy notice under every form, added by inc/contact.php. */
.lpa-form-privacy {
	margin-top: 0.85rem;
	font-size: 12.5px;
	line-height: 1.5;
	color: var(--lpa-slate-400);
}

.lpa-form-privacy a {
	color: inherit;
	text-decoration: underline;
}

.lpa-form-privacy a:hover,
.lpa-form-privacy a:focus-visible {
	color: var(--lpa-green-700);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 600px) {
	.wpcf7 {
		padding: 1rem;
		border-radius: var(--lpa-radius);
	}

	.wpcf7 .wpcf7-submit {
		width: 100%;
	}

	.wpcf7-list-item {
		display: flex;
		margin-right: 0;
	}
}
