/**
 * Investax Forms Stylesheet
 * Forms: Contact Enquiry & Complimentary Consultation Booking
 */

.cp-lead-form-wrap {
	width: 100%;
	box-sizing: border-box;
	position: relative;
	margin-top: 22px;
}

.cp-lead-form {
	display: flex !important;
	flex-direction: column !important;
	gap: 18px;
	width: 100% !important;
	margin: 0 !important;
	box-sizing: border-box;
}

.cp-field-group {
	position: relative;
	box-sizing: border-box;
	display: flex !important;
	flex-direction: column !important;
	align-items: stretch !important;
	gap: 7px;
	width: auto !important;
	max-width: none !important;
	margin: 0 !important;
	padding: 0 !important;
	float: none !important;
}

.cp-field-label,
.cp-lead-form .cp-field-group > span:first-child {
	display: block;
	margin: 0 !important;
	padding: 0 !important;
	font-family: Montserrat, system-ui, sans-serif;
	font-size: 12px;
	letter-spacing: 0.6px;
	text-transform: uppercase;
	font-weight: 700;
	line-height: 1.3;
	color: #5E6878;
}

.cp-field-error {
	display: none;
	font-size: 12px;
	color: #d9383a;
	font-weight: 600;
	margin: 2px 0 0 !important;
}

/* Theme styles (Pico and similar) force every button to width:100%.
   These rules keep Business / Individual as a compact pair. */
.cp-lead-form .cp-type-toggle {
	display: flex !important;
	flex-direction: column !important;
	align-items: flex-start !important;
	gap: 8px;
	width: 100% !important;
	margin: 0 !important;
	padding: 0 !important;
}

.cp-lead-form .cp-fields-2,
.cp-lead-form .cp-fields-3 {
	display: grid !important;
	grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
	gap: 16px;
	width: 100% !important;
	margin: 0 !important;
	padding: 0 !important;
}

/* Booking form: post code + contact stay side by side in a narrow card. */
.cp-lead-form .cp-fields-pair {
	display: grid !important;
	grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
	gap: 12px;
	width: 100% !important;
	margin: 0 !important;
	padding: 0 !important;
}

.cp-lead-form .cp-fields-pair > .cp-field-group {
	min-width: 0 !important;
	width: auto !important;
}

.cp-lead-footnote {
	margin: 14px 0 0 !important;
	padding: 0 !important;
	font-family: Montserrat, system-ui, sans-serif;
	font-size: 12px;
	line-height: 1.5;
	font-weight: 500;
	color: #8C939E;
	text-align: center;
}

.cp-lead-input,
.cp-lead-form input.cp-lead-input,
.cp-lead-form select.cp-lead-input,
.cp-lead-form textarea.cp-lead-input {
	display: block !important;
	width: 100% !important;
	max-width: 100% !important;
	margin: 0 !important;
	box-sizing: border-box;
	font-family: Montserrat, system-ui, sans-serif;
	font-size: 15px;
	font-weight: 400;
	line-height: 1.4;
	padding: 13px 15px;
	border: 1px solid #DDD8CE;
	border-radius: 6px;
	outline: none;
	color: #0E1B2C;
	background: #fff;
	box-shadow: none;
	transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
	-webkit-appearance: none;
	appearance: none;
}

.cp-lead-form textarea.cp-lead-input {
	resize: vertical;
	min-height: 130px;
	line-height: 1.6;
}

.cp-lead-input:focus {
	border-color: #133054 !important;
	box-shadow: 0 0 0 3px rgba(190, 149, 92, 0.22) !important;
	outline: none !important;
}

.cp-lead-input.has-error {
	border-color: #d9383a !important;
	background-color: #fff9f9 !important;
}

select.cp-lead-input {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%235E6878' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 14px center;
	padding-right: 36px !important;
	cursor: pointer;
}

.cp-lead-form .cp-type-toggle-group {
	display: flex !important;
	flex-direction: row !important;
	flex-wrap: wrap !important;
	align-items: center !important;
	justify-content: flex-start !important;
	gap: 10px;
	width: auto !important;
	max-width: 100% !important;
	margin: 0 !important;
	padding: 0 !important;
}

.cp-lead-form .cp-type-toggle-group .cp-type-btn,
.cp-lead-form button.cp-type-btn {
	width: auto !important;
	min-width: 0 !important;
	max-width: none !important;
	flex: 0 0 auto !important;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	margin: 0 !important;
	float: none !important;
	box-sizing: border-box;
	font-family: Montserrat, system-ui, sans-serif;
	font-size: 12.5px;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	font-weight: 700;
	line-height: 1.2;
	padding: 11px 22px !important;
	border-radius: 2px !important;
	cursor: pointer;
	border: 1px solid #DDD8CE !important;
	background: #fff !important;
	color: #3A4556 !important;
	box-shadow: none !important;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
	outline: none;
}

.cp-type-toggle-group .cp-type-btn:hover:not(.is-active) {
	border-color: #133054 !important;
	color: #133054 !important;
	background-color: #f7f9fc !important;
}

.cp-type-toggle-group .cp-type-btn.is-active {
	border-color: #133054 !important;
	background-color: #133054 !important;
	color: #ffffff !important;
	box-shadow: none !important;
}

.cp-lead-form button.cp-lead-submit-btn,
.cp-lead-submit-btn {
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	gap: 8px;
	width: 100% !important;
	max-width: 100% !important;
	min-height: 50px;
	margin: 6px 0 0 !important;
	padding: 16px !important;
	box-sizing: border-box;
	font-family: Montserrat, system-ui, sans-serif !important;
	font-size: 15px !important;
	font-weight: 700 !important;
	line-height: 1.2 !important;
	text-transform: none !important;
	letter-spacing: 0 !important;
	color: #fff !important;
	background: #133054 !important;
	border: none !important;
	border-radius: 6px !important;
	cursor: pointer;
	box-shadow: none !important;
	transition: background-color 0.2s ease;
}

.cp-lead-submit-btn:hover:not(:disabled) {
	background-color: #0B2240 !important;
}

.cp-lead-submit-btn:active:not(:disabled) {
	background-color: #0B2240 !important;
}

.cp-lead-submit-btn:disabled {
	opacity: 0.75;
	cursor: not-allowed;
}

/* Spinner Animation */
.cp-spinner {
	display: inline-block;
	width: 16px;
	height: 16px;
	border: 2px solid rgba(255, 255, 255, 0.35);
	border-radius: 50%;
	border-top-color: #ffffff;
	animation: cpSpin 0.7s linear infinite;
}

@keyframes cpSpin {
	to { transform: rotate(360deg); }
}

/* Alert Banner */
.cp-lead-alert {
	padding: 14px 16px;
	border-radius: 6px;
	font-size: 14px;
	line-height: 1.5;
	font-weight: 600;
	margin-bottom: 6px;
	box-sizing: border-box;
}

.cp-lead-alert.is-error {
	background-color: #FDF2F2;
	border: 1px solid #F0B8B8;
	color: #9E1C1C;
}

.cp-lead-alert.is-success {
	background-color: #F0FDF4;
	border: 1px solid #BBF7D0;
	color: #166534;
}

/* Thank You Card replaces the form after a successful submit */
.cp-lead-form-wrap.cp-lead-form-submitted .cp-lead-form,
.cp-lead-form-wrap.cp-lead-form-submitted .cp-lead-footnote {
	display: none !important;
}

.cp-lead-form-wrap.cp-lead-form-submitted .cp-thank-you-card {
	display: flex !important;
	margin-top: 0 !important;
}

.cp-thank-you-card {
	background: #ffffff;
	border: 1px solid rgb(231, 227, 219);
	border-radius: 16px;
	box-shadow:
		0 2px 4px rgba(14, 27, 44, 0.04),
		0 16px 48px rgba(14, 27, 44, 0.1);
	padding: clamp(40px, 5vw, 52px) clamp(28px, 4vw, 40px);
	margin-top: clamp(22px, 3vw, 32px);
	text-align: center;
	box-sizing: border-box;
	width: 100%;
	min-height: clamp(140px, 18vw, 180px);
	flex-direction: column;
	align-items: center;
	justify-content: center;
}

.cp-lead-form-wrap .cp-thank-you-title {
	font-family: Montserrat, system-ui, sans-serif !important;
	font-size: clamp(24px, 2.6vw, 30px) !important;
	font-weight: 600 !important;
	color: #5c6570 !important;
	letter-spacing: -0.01em;
	margin: 0 0 16px !important;
	line-height: 1.2 !important;
	text-align: center !important;
}

.cp-lead-form-wrap .cp-thank-you-text {
	font-family: Montserrat, system-ui, sans-serif !important;
	font-size: clamp(15px, 1.45vw, 17px) !important;
	font-weight: 400 !important;
	line-height: 1.55 !important;
	color: #5c6570 !important;
	margin: 0 auto !important;
	max-width: 20em;
	text-align: center !important;
}

/* Success Card Animation */
.cp-lead-success {
	animation: cpFadeUp 0.35s ease-out both;
}

@keyframes cpFadeUp {
	from {
		opacity: 0;
		transform: translateY(12px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.cp-reset-lead-btn {
	transition: all 0.2s ease;
}

.cp-reset-lead-btn:hover {
	border-color: #133054 !important;
	background-color: #133054 !important;
	color: #ffffff !important;
}

/* Mobile Optimizations */
@media (max-width: 640px) {
	.cp-lead-input {
		font-size: 16px !important; /* Stops iOS Safari auto-zoom */
		padding: 13px 14px !important;
	}

	.cp-lead-submit-btn {
		width: 100% !important;
		min-height: 52px !important;
		font-size: 15.5px !important;
	}

	.cp-lead-form .cp-fields-2,
	.cp-lead-form .cp-fields-3 {
		grid-template-columns: 1fr !important;
	}

	.cp-lead-form .cp-fields-pair {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
	}

	.cp-lead-form .cp-type-toggle-group {
		display: flex !important;
		flex-direction: row !important;
		width: auto !important;
	}

	.cp-lead-form .cp-type-toggle-group .cp-type-btn,
	.cp-lead-form button.cp-type-btn {
		width: auto !important;
		text-align: center;
		justify-content: center;
		padding: 12px 16px !important;
		font-size: 12px !important;
	}
}
