/**
 * The main site's enquiry form, dressed as the mh landing-page card.
 *
 * Every value here is taken from the hand-built form this replaces, so the
 * page looks unchanged to a visitor arriving from an ad:
 *
 *   card            #fff, max-width 500px, 20px padding, 10px radius, soft shadow
 *   banner          #fccc04, white, 600 weight, 14px padding, 5px radius
 *   controls        1px #ced4da, 5px radius, 10px padding, 14px text
 *   submit          full width, #fccc04, white, red #f51414 on hover
 *
 * Everything is scoped to .yg-mh-enquiry. The widget this replaces styled
 * `*`, `body`, `.container`, `.row`, `.col-6` and `.btn` from inside an
 * Elementor HTML widget, so its rules leaked into the whole page; none of that
 * is reproduced here.
 */

.yg-mh-enquiry {
	max-width: 500px;
	margin: 20px auto;
	padding: 20px;
	background: #fff;
	border-radius: 10px;
	box-shadow: 0 4px 12px rgba( 0, 0, 0, .1 );
	box-sizing: border-box;
}

.yg-mh-enquiry *,
.yg-mh-enquiry *::before,
.yg-mh-enquiry *::after {
	box-sizing: border-box;
}

.yg-mh-enquiry-banner {
	margin: 0 0 15px;
	padding: 14px;
	background: #fccc04;
	border-radius: 5px;
	color: #fff;
	font-weight: 600;
	text-align: center;
}

/* The form ships its own <h2>. With our banner above it that is the same
   heading twice, so the form's own is hidden - but only then. */
.yg-mh-enquiry.has-heading .bscf7-form-title {
	display: none;
}

.yg-mh-enquiry .bscf7-form-title {
	margin: 0 0 15px;
	padding: 14px;
	background: #fccc04;
	border-radius: 5px;
	color: #fff;
	font-size: 18px;
	font-weight: 600;
	line-height: 1.3;
	text-align: center;
}

/*
 * The main site's stylesheet caps this container at 480px and centres it. Here
 * the card already does both, so the cap only makes the fields narrower than
 * the card they sit in.
 */
.yg-mh-enquiry .bscf7-eligibility-form {
	max-width: none;
	width: 100%;
	margin: 0;
	padding: 0;
	background: none;
	box-shadow: none;
}

/*
 * wpautop wraps the bare hidden `source` input in a paragraph of its own, with
 * no class. Left alone it is an empty row with a margin under it, which reads
 * as a gap in the form for no reason.
 */
.yg-mh-enquiry .bscf7-eligibility-form > p:not( [class] ) {
	margin: 0;
	padding: 0;
	display: none;
}

/*
 * Class in the selector, not just the element: the main site's sheet carries
 * `.bscf7-eligibility-form p.bscf7-field { margin: 0 0 16px }`, which ties with
 * a plain `p` rule on specificity and then wins on load order.
 */
.yg-mh-enquiry .bscf7-eligibility-form p.bscf7-field {
	margin: 0 0 12px;
	padding: 0;
}

.yg-mh-enquiry .wpcf7-form-control-wrap {
	display: block;
	width: 100%;
}

.yg-mh-enquiry .wpcf7-form-control:not( .wpcf7-submit ):not( [type="hidden"] ) {
	width: 100%;
	padding: 10px;
	border: 1px solid #ced4da;
	border-radius: 5px;
	background: #fff;
	color: #212529;
	font-family: inherit;
	font-size: 14px;
	line-height: 1.4;
}

/*
 * A select needs the room its own text asks for. The theme pins controls
 * shorter than that, which clips the descender on the chosen option.
 */
.yg-mh-enquiry select.wpcf7-form-control {
	height: auto;
	min-height: 42px;
	appearance: auto;
}

.yg-mh-enquiry .wpcf7-form-control:focus {
	border-color: #fccc04;
	outline: 2px solid rgba( 252, 204, 4, .35 );
	outline-offset: 0;
}

/* The country code sits with the number, as it did before. */
.yg-mh-enquiry .bscf7-phone-field {
	position: relative;
}

.yg-mh-enquiry .wpcf7-submit {
	width: 100%;
	margin-top: 10px;
	padding: 12px;
	border: none;
	border-radius: 5px;
	background: #fccc04;
	color: #fff;
	font-family: inherit;
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
	transition: background-color .15s ease;
}

.yg-mh-enquiry .wpcf7-submit:hover,
.yg-mh-enquiry .wpcf7-submit:focus-visible {
	background: #f51414;
}

.yg-mh-enquiry .wpcf7-submit:disabled {
	cursor: default;
	opacity: .75;
}

/*
 * CF7's own stylesheet keeps the response box hidden while the form carries
 * the class "init", and shows it once a status class replaces it. form.js does
 * that swap, so the box only needs its look defining here.
 */
.yg-mh-enquiry .wpcf7-response-output {
	margin: 12px 0 0;
	padding: 10px 12px;
	border: 1px solid #ced4da;
	border-radius: 5px;
	font-size: 14px;
	line-height: 1.4;
}

.yg-mh-enquiry form.sent .wpcf7-response-output {
	border-color: #46b450;
	background: #f2fbf3;
	color: #1c5b28;
}

.yg-mh-enquiry form.invalid .wpcf7-response-output,
.yg-mh-enquiry form.unaccepted .wpcf7-response-output,
.yg-mh-enquiry form.failed .wpcf7-response-output,
.yg-mh-enquiry form.spam .wpcf7-response-output,
.yg-mh-enquiry form.aborted .wpcf7-response-output {
	border-color: #f51414;
	background: #fdf3f3;
	color: #8a1111;
}

.yg-mh-enquiry .wpcf7-not-valid {
	border-color: #f51414 !important;
}

.yg-mh-enquiry .wpcf7-not-valid-tip {
	display: block;
	margin-top: 4px;
	color: #f51414;
	font-size: 12px;
	line-height: 1.3;
}

.yg-mh-enquiry .screen-reader-response {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect( 0, 0, 0, 0 );
	border: 0;
	white-space: nowrap;
}

@media ( max-width: 480px ) {
	.yg-mh-enquiry {
		margin: 16px auto;
		padding: 16px;
	}
}

@media ( prefers-reduced-motion: reduce ) {
	.yg-mh-enquiry .wpcf7-submit {
		transition: none;
	}
}
