/**
 * Service Hero — Figma "Service Page – Sell Vehicle".
 *
 * Desktop 10344:4038 — 1440 wide, inset 120, 80 above and below. Two columns
 *   517 + 80 + 603: the collage image on the left, and on the right a rating
 *   row, an H1 48/58, three inputs 12 apart, then a row holding the call-us
 *   panel on the left and the submit on the right.
 * Mobile 10344:4096 — 375 wide, inset 20, 40 above and below. One column, 32
 *   between the collage and the text. The rating stacks and centres, the H1 is
 *   36/46 centred, the inputs sit 8 apart, and the submit goes full width with
 *   the call-us panel centred below it.
 *
 * The left visual is one composite PNG (Figma Group 1932 / 517×510) — tilted
 * frame, portrait and badges baked in — so it scales as a single image.
 */

.ae-service-hero {
	width: 100%;
	/* Figma: 40 at 375 → 80 at 1440. */
	padding-block: clamp(40px, calc(40px + 40 * var(--ae-fluid)), 80px);
}

.ae-service-hero__inner {
	display: flex;
	flex-direction: column;
	/* Figma: 32 between the collage and the text at 375. */
	gap: 32px;
}

/* Collage ----------------------------------------------------------------- */

.ae-service-hero__figure {
	margin: 0;
	width: 100%;
	/* Figma group: 517 × 510. */
	aspect-ratio: 517 / 510;
}

.ae-service-hero__collage {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
	object-position: center;
}

/* Content ----------------------------------------------------------------- */

.ae-service-hero__content {
	display: flex;
	flex-direction: column;
	/* Figma: 24 at 375 → 32 at 1440. */
	gap: clamp(24px, calc(24px + 8 * var(--ae-fluid)), 32px);
}

.ae-service-hero__header {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.ae-service-hero__rating {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	margin: 0;
	/* Label: 18/24, letter-spacing 0.72. */
	font-size: 18px;
	line-height: 24px;
	font-weight: 400;
	letter-spacing: 0.72px;
	text-transform: uppercase;
	color: var(--ae-color-grey-800, #404040);
}

.ae-service-hero__stars {
	display: block;
	flex: none;
	width: 99px;
	height: 18px;
}

.ae-service-hero__rating-score {
	font-weight: 700;
}

.ae-service-hero__heading {
	margin: 0;
	/* H1: 36/46 → 48/58 bold. */
	font-size: clamp(36px, calc(36px + 12 * var(--ae-fluid)), 48px);
	line-height: clamp(46px, calc(46px + 12 * var(--ae-fluid)), 58px);
	font-weight: 700;
	text-transform: capitalize;
	text-align: center;
	color: var(--ae-color-black, #000);
	overflow-wrap: break-word;
}

/* Form -------------------------------------------------------------------- */

.ae-service-hero__lead {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

/*
 * Contact Form 7 renders the inputs and the submit. Its shortcode carries the
 * BEM classes through, so the rules below are the Figma design applied to CF7's
 * own markup, plus resets for the wrappers its autop inserts.
 */
.ae-service-hero__form .wpcf7,
.ae-service-hero__form .wpcf7-form {
	width: 100%;
	margin: 0;
}

.ae-service-hero__form .wpcf7-form {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.ae-service-hero__form .wpcf7-form p {
	margin: 0;
}

.ae-service-hero__form .wpcf7-form > p {
	position: relative;
	display: flex;
	align-items: center;
	gap: 8px;
	width: 100%;
}

/*
 * CF7 keeps its spinner in the flow whether or not it is turning; hide it
 * site-wide (see main.css). Keep this override so the service-hero form does
 * not depend on load order of CF7's own stylesheet.
 */
.ae-service-hero__form .wpcf7-spinner {
	display: none;
}

.ae-service-hero__form .wpcf7-form-control-wrap {
	display: block;
	width: 100%;
}

.ae-service-hero__form .hidden-fields-container {
	margin: 0;
	padding: 0;
	border: 0;
}

.ae-service-hero__fields {
	display: flex;
	flex-direction: column;
	/* Figma: 8 at 375 → 12 at 1440. */
	gap: clamp(8px, calc(8px + 4 * var(--ae-fluid)), 12px);
	width: 100%;
}

.ae-service-hero__field {
	width: 100%;
}

.ae-service-hero__input {
	display: block;
	width: 100%;
	margin: 0;
	padding: 16px 20px;
	border: 0.6px solid var(--ae-color-grey-500, #9a9a9a);
	border-radius: 2px;
	background-color: var(--ae-color-white, #fff);
	font-family: inherit;
	/* Par: 16/26 → 18/28. */
	font-size: clamp(16px, calc(16px + 2 * var(--ae-fluid)), 18px);
	line-height: clamp(26px, calc(26px + 2 * var(--ae-fluid)), 28px);
	font-weight: 400;
	color: var(--ae-color-grey-800, #404040);
}

.ae-service-hero__input::placeholder {
	color: var(--ae-color-grey-600, #676767);
	opacity: 1;
}

.ae-service-hero__input:focus {
	outline: none;
	border-color: var(--ae-color-blue-600, #0c8ce9);
}

.ae-service-hero__submit {
	display: block;
	width: 100%;
	/* Figma: 24/40 padding, and 16 between the label and the mark. */
	padding: 24px 72px 24px 40px;
	border: 0;
	border-radius: 200px;
	background-color: var(--ae-color-blue-600, #0c8ce9);
	background-image: url("../../assets/images/icon-plus-white.svg");
	background-repeat: no-repeat;
	background-position: right 40px center;
	background-size: 16px 16px;
	font-family: inherit;
	/* Button: 18/18 600. */
	font-size: 18px;
	line-height: 18px;
	font-weight: 600;
	text-transform: capitalize;
	color: var(--ae-color-white, #fff);
	cursor: pointer;
}

.ae-service-hero__submit:hover,
.ae-service-hero__submit:focus-visible {
	background-color: var(--ae-color-blue-700, #0067b3);
}

/* CF7's own messages, in the section's type rather than its default box. */
.ae-service-hero__form .wpcf7 form .wpcf7-response-output {
	width: 100%;
	margin: 0;
	padding: 12px 16px;
	border: 0;
	border-radius: 2px;
	background-color: var(--ae-color-white, #fff);
	font-size: 16px;
	line-height: 26px;
	color: var(--ae-color-grey-800, #404040);
}

.ae-service-hero__form .wpcf7 form.invalid .wpcf7-response-output,
.ae-service-hero__form .wpcf7 form.unaccepted .wpcf7-response-output,
.ae-service-hero__form .wpcf7 form.failed .wpcf7-response-output,
.ae-service-hero__form .wpcf7 form.aborted .wpcf7-response-output {
	color: var(--ae-color-red-600, #e90c0c);
}

.ae-service-hero__form .wpcf7-not-valid-tip {
	margin-top: 6px;
	font-size: 14px;
	line-height: 22px;
	color: var(--ae-color-red-600, #e90c0c);
}

.ae-service-hero__form .wpcf7-form-control.wpcf7-not-valid {
	border-color: var(--ae-color-red-600, #e90c0c);
}

/* Call us ----------------------------------------------------------------- */

.ae-service-hero__call {
	display: flex;
	align-self: center;
	align-items: center;
	gap: 12px;
}

.ae-service-hero__call-icon {
	display: block;
	flex: none;
	/* Figma: 55.75 × 56 at 375 → 59.732 × 60 at 1440. */
	width: clamp(55.75px, calc(55.75px + 3.982 * var(--ae-fluid)), 59.732px);
	height: clamp(56px, calc(56px + 4 * var(--ae-fluid)), 60px);
}

.ae-service-hero__call-image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.ae-service-hero__call-text {
	display: flex;
	flex-direction: column;
	color: var(--ae-color-black, #000);
}

.ae-service-hero__call-label {
	/* Par: 16/26 → 18/28. */
	font-size: clamp(16px, calc(16px + 2 * var(--ae-fluid)), 18px);
	line-height: clamp(26px, calc(26px + 2 * var(--ae-fluid)), 28px);
	font-weight: 400;
}

.ae-service-hero__call-number {
	/* H4: 20/28 → 24/32 semibold, underlined as drawn. */
	font-size: clamp(20px, calc(20px + 4 * var(--ae-fluid)), 24px);
	line-height: clamp(28px, calc(28px + 4 * var(--ae-fluid)), 32px);
	font-weight: 600;
	text-transform: capitalize;
	text-decoration: underline;
	color: inherit;
}

/* Desktop ----------------------------------------------------------------- */

@media (min-width: 1025px) {

	.ae-service-hero__inner {
		display: grid;
		/* Figma 1440: 517 + 80 + 603 inside a 1200 column. */
		grid-template-columns: 43.0833% minmax(0, 1fr);
		column-gap: 6.6667%;
		align-items: center;
	}

	.ae-service-hero__rating {
		flex-direction: row;
		align-items: center;
	}

	.ae-service-hero__heading,
	.ae-service-hero__rating {
		text-align: left;
	}

	.ae-service-hero__rating {
		align-self: flex-start;
	}

	/*
	 * The submit and the call-us panel share the last row. The form owns the
	 * submit, so the two are stacked in one grid cell and pinned to opposite
	 * sides of it — which also keeps them level whatever height the button ends
	 * up being.
	 */
	.ae-service-hero__lead {
		display: grid;
	}

	.ae-service-hero__form,
	.ae-service-hero__call {
		grid-area: 1 / 1;
	}

	.ae-service-hero__form .wpcf7-form > p {
		justify-content: flex-end;
	}

	.ae-service-hero__submit {
		width: auto;
	}

	.ae-service-hero__call {
		align-self: end;
		justify-self: start;
	}
}
