/* ==========================================================================
   Motorly multi-step form (steps 2–22)
   Uses the same colours and type as the landing page (landing.css).
   ========================================================================== */

.mf {
	--mf-dark: #17392f;
	--mf-green: #2e7362;
	--mf-green-bright: #3a8d76;
	--mf-tint: #eaf3f0;
	--mf-soft: #f4f7f6;
	--mf-text: #1d2431;
	--mf-muted: #545b68;
	--mf-line: #dde2e6;
	--mf-error: #c62f2f;
	--mf-radius: 10px;

	max-width: 640px;
	margin: 0 auto;
	padding: 20px 16px 40px;
	font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	font-size: 16px;
	line-height: 1.5;
	color: var(--mf-text);
	-webkit-font-smoothing: antialiased;
}
.mf *,
.mf *::before,
.mf *::after {
	box-sizing: border-box;
}
.mf[hidden],
.mf [hidden],
.motorly-main .wp-block-post-content[hidden],
.motorly-footer[hidden] {
	display: none !important;
}
body.mf-active .motorly-sticky-cta {
	display: none !important;
}
body.mf-active.motorly-landing-page {
	padding-bottom: 0;
}

/* ---------- Progress ---------- */
.mf-progress {
	position: relative;
	height: 16px;
	margin: 4px 8px 22px;
}
.mf-progress__track {
	position: absolute;
	left: 0;
	right: 0;
	top: 50%;
	height: 4px;
	margin-top: -2px;
	border-radius: 4px;
	background: var(--mf-line);
	overflow: hidden;
}
.mf-progress__bar {
	display: block;
	width: 0;
	height: 100%;
	background: var(--mf-green-bright);
	transition: width 0.35s ease;
}
.mf-dot {
	position: absolute;
	top: 0;
	width: 16px;
	height: 16px;
	margin-left: -8px;
	border: 2px solid var(--mf-line);
	border-radius: 50%;
	background: #fff;
	transition: background-color 0.3s ease, border-color 0.3s ease;
}
.mf-dot--0 { left: 0; }
.mf-dot--33 { left: 33.33%; }
.mf-dot--66 { left: 66.66%; }
.mf-dot--100 { left: 100%; }
.mf-dot.is-active {
	border-color: var(--mf-green-bright);
	background: var(--mf-green-bright);
}

/* ---------- Step text ---------- */
.mf-step,
.mf-done {
	animation: mf-in 0.25s ease;
}
@keyframes mf-in {
	from { opacity: 0; transform: translateY(6px); }
	to { opacity: 1; transform: none; }
}
.mf-kicker {
	margin: 0 0 4px;
	text-align: center;
	font-size: 14px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--mf-green);
}
.mf .mf-q {
	margin: 0 0 18px;
	text-align: center;
	font-family: inherit;
	font-size: clamp(20px, 5.4vw, 26px);
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: 0;
	color: var(--mf-text);
	text-wrap: balance;
}
.mf .mf-q:focus {
	outline: none;
}
.mf-subq {
	margin: 22px 0 12px;
	text-align: center;
	font-size: 19px;
	font-weight: 700;
}
.mf-help {
	margin: 0 0 16px;
	text-align: center;
	font-size: 15px;
	color: var(--mf-muted);
}
.mf-note {
	margin: 0 0 16px;
	padding: 10px 14px;
	border-left: 3px solid var(--mf-green-bright);
	border-radius: 6px;
	background: var(--mf-tint);
	font-size: 15px;
	line-height: 1.45;
}
.mf-status {
	margin: 12px 0 0;
	text-align: center;
	font-weight: 600;
	color: var(--mf-green);
}

/* ---------- Options (single choice) ---------- */
.mf-options {
	display: grid;
	grid-template-columns: 1fr;
	gap: 10px;
	border-radius: var(--mf-radius);
}
.mf-options--two {
	grid-template-columns: 1fr 1fr;
}
.mf-options--four {
	grid-template-columns: repeat(4, 1fr);
	margin-bottom: 16px;
}
.mf-option {
	position: relative;
	display: block;
	margin: 0;
	cursor: pointer;
}
.mf-option input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
	pointer-events: none;
}
.mf-option span {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 54px;
	padding: 10px 12px;
	border: 2px solid var(--mf-green-bright);
	border-radius: var(--mf-radius);
	background: #fff;
	text-align: center;
	font-size: clamp(16px, 4.4vw, 19px);
	line-height: 1.25;
	transition: background-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.mf-option:hover span {
	background: var(--mf-tint);
}
.mf-option input:focus-visible + span {
	outline: 3px solid var(--mf-dark);
	outline-offset: 2px;
}
.mf-option input:checked + span {
	background: var(--mf-tint);
	box-shadow: inset 0 0 0 1px var(--mf-green-bright);
	font-weight: 600;
}
.mf-options.mf-err .mf-option span {
	border-color: var(--mf-error);
}

/* ---------- Inputs ---------- */
.mf-field {
	margin: 0 0 14px;
}
.mf-label {
	display: block;
	margin: 0 0 6px;
	font-size: 15px;
	font-weight: 600;
}
.mf .mf-input,
.mf .idpc-input,
.mf .idpc-select {
	display: block;
	width: 100%;
	min-height: 52px;
	padding: 12px 14px;
	border: 2px solid #c9d0d6;
	border-radius: var(--mf-radius);
	background: #fff;
	color: var(--mf-text);
	font: inherit;
	font-size: 18px;
	line-height: 1.3;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
	-webkit-appearance: none;
	appearance: none;
}
.mf .mf-input::placeholder {
	color: #8a929c;
}
.mf .mf-input:focus,
.mf .idpc-input:focus,
.mf .idpc-select:focus {
	outline: none;
	border-color: var(--mf-green-bright);
	box-shadow: 0 0 0 3px rgba(58, 141, 118, 0.2);
}
.mf .mf-input.mf-err,
.mf .idpc-input.mf-err {
	border-color: var(--mf-error);
}
.mf-reg,
#mf-px-manual-reg {
	text-transform: uppercase;
	letter-spacing: 0.06em;
	font-weight: 700;
}
.mf-reg {
	text-align: center;
	background: #ffd400 !important;
	border-color: #1d2431 !important;
	font-size: 24px !important;
}
.mf-error,
.mf-field-error,
.mf-tiles-msg {
	display: block;
	margin: 12px 0 0;
	text-align: center;
	font-size: 14px;
	font-weight: 600;
	color: var(--mf-error);
}
.mf-field-error {
	margin-top: 6px;
	text-align: left;
}
.mf-tiles-msg {
	margin-top: 10px;
}
.motorly-tiles.mf-tiles-err > .motorly-tile {
	border-color: var(--mf-error) !important;
}

/* DOB */
.mf-dob {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin-bottom: 14px;
}
.mf-dob .mf-input {
	width: 76px;
	text-align: center;
}
.mf-dob .mf-dob__year {
	width: 104px;
}
.mf-dob span {
	font-size: 22px;
	color: var(--mf-muted);
}

/* Money */
.mf-money {
	position: relative;
	max-width: 320px;
	margin: 0 auto 8px;
}
.mf-money > span {
	position: absolute;
	left: 16px;
	top: 50%;
	transform: translateY(-50%);
	font-size: 20px;
	font-weight: 600;
	color: var(--mf-muted);
}
.mf-money .mf-input {
	padding-left: 36px;
	font-size: 22px;
	font-weight: 600;
}

/* Stepper */
.mf-stepper {
	display: flex;
	align-items: stretch;
	gap: 8px;
	max-width: 360px;
	margin: 0 auto 14px;
}
.mf-stepper .mf-input {
	text-align: center;
	font-size: 24px;
	font-weight: 700;
}
.mf-stepper__btn {
	flex: 0 0 56px;
	border: 2px solid var(--mf-green-bright);
	border-radius: var(--mf-radius);
	background: #fff;
	color: var(--mf-green);
	font-size: 28px;
	font-weight: 700;
	line-height: 1;
	cursor: pointer;
}
.mf-stepper__btn:hover {
	background: var(--mf-tint);
}
.mf-check {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	margin: 0 0 6px;
	font-size: 17px;
	cursor: pointer;
}
.mf-check input {
	width: 22px;
	height: 22px;
	accent-color: var(--mf-green);
}

/* Durations / grids */
.mf-duration,
.mf-grid-2 {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}
.mf-duration {
	max-width: 360px;
	margin: 0 auto;
}
.mf-duration .mf-input {
	text-align: center;
}
.mf-grid-3 {
	display: grid;
	grid-template-columns: 0.9fr 1.4fr 0.8fr;
	gap: 10px;
	align-items: end;
}
.mf-grid-2 {
	align-items: end;
}
.mf-grid-3 .mf-label,
.mf-grid-2 .mf-label {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* ---------- Buttons ---------- */
.mf .mf-next {
	display: block;
	width: 100%;
	margin: 18px 0 0;
	padding: 15px 16px;
	border: 0;
	border-radius: 8px;
	background: var(--mf-green);
	box-shadow: 0 2px 0 rgba(23, 57, 47, 0.25);
	color: #fff;
	font: inherit;
	font-size: clamp(19px, 5vw, 22px);
	font-weight: 700;
	line-height: 1.2;
	cursor: pointer;
	transition: background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.mf .mf-next:hover,
.mf .mf-next:focus-visible {
	background: var(--mf-dark);
	transform: translateY(-2px);
	box-shadow: 0 10px 24px rgba(23, 57, 47, 0.3);
}
.mf .mf-next:focus-visible {
	outline: 3px solid var(--mf-dark);
	outline-offset: 2px;
}
.mf .mf-next[disabled] {
	opacity: 0.6;
	cursor: wait;
	transform: none;
}
.mf-links {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	margin-top: 16px;
}
.mf-link {
	padding: 4px 6px;
	border: 0;
	background: none;
	color: var(--mf-green);
	font: inherit;
	font-size: 15px;
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}
.mf-back {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
	margin-top: 32px;
	color: var(--mf-muted);
	font-size: 14px;
}
.mf-prev {
	padding: 4px 10px;
	border: 0;
	background: none;
	color: var(--mf-text);
	font: inherit;
	font-size: 16px;
	font-weight: 700;
	cursor: pointer;
}
.mf-prev:hover {
	color: var(--mf-green);
}

/* ---------- Part exchange ---------- */
.mf-px-card {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 16px;
	border: 2px solid var(--mf-green-bright);
	border-radius: var(--mf-radius);
	background: var(--mf-tint);
	text-align: center;
}
.mf-px-summary {
	font-size: 20px;
}
.mf-px-detail,
.mf-px-mot {
	color: var(--mf-muted);
	font-size: 15px;
}

/* ---------- Address ---------- */
.mf-added-addresses {
	margin: 0 0 16px;
	padding: 0;
	list-style: none;
}
.mf-added-addresses li {
	margin: 0 0 8px;
	padding: 10px 14px;
	border: 1px solid var(--mf-line);
	border-radius: 8px;
	background: var(--mf-soft);
	font-size: 14px;
}
#mf-postcode-context {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}
#mf-postcode-context .idpc-input {
	flex: 1 1 200px;
	text-transform: uppercase;
}
#mf-postcode-context .mf-idpc-button {
	flex: 0 0 auto;
	padding: 12px 18px;
	border: 0;
	border-radius: 8px;
	background: var(--mf-green);
	color: #fff;
	font: inherit;
	font-size: 17px;
	font-weight: 700;
	cursor: pointer;
	transition: background-color 0.15s ease;
}
#mf-postcode-context .mf-idpc-button:hover,
#mf-postcode-context .mf-idpc-button:focus-visible {
	background: var(--mf-dark);
}
#mf-postcode-context .mf-idpc-button:focus-visible {
	outline: 3px solid var(--mf-dark);
	outline-offset: 2px;
}
#mf-postcode-context .idpc-select {
	flex: 1 1 100%;
	font-size: 16px;
	background-image: linear-gradient(45deg, transparent 50%, var(--mf-green) 50%), linear-gradient(135deg, var(--mf-green) 50%, transparent 50%);
	background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%;
	background-size: 6px 6px;
	background-repeat: no-repeat;
	padding-right: 40px;
}
#mf-postcode-context .idpc-error,
#mf-postcode-context .mf-idpc-message {
	flex: 1 1 100%;
	margin: 0;
	text-align: left;
	color: var(--mf-error);
}
.mf-address-fields {
	margin-top: 16px;
	padding-top: 16px;
	border-top: 1px solid var(--mf-line);
}
.mf-address-fields .mf-input {
	font-size: 16px;
	min-height: 48px;
}

/* ---------- Final step ---------- */
.mf-panel {
	margin: 22px 0 0;
	padding: 16px;
	border-radius: var(--mf-radius);
	background: var(--mf-soft);
	text-align: center;
}
.mf-panel h3 {
	margin: 0 0 6px;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.4;
}
.mf-panel p {
	margin: 0;
	font-size: 14px;
	color: var(--mf-muted);
}
.mf-terms {
	margin: 16px 0 0;
	text-align: center;
	font-size: 13px;
	color: var(--mf-muted);
}
.mf-terms a {
	color: var(--mf-green);
}

/* ---------- Modal + loader ---------- */
.mf-modal,
.mf-loader {
	position: fixed;
	inset: 0;
	z-index: 100;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	background: rgba(15, 30, 26, 0.55);
}
.mf-modal__box,
.mf-loader__box {
	width: 100%;
	max-width: 400px;
	padding: 24px 20px;
	border-radius: 14px;
	background: #fff;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
	text-align: center;
}
.mf-modal__box h3 {
	margin: 0 0 8px;
	font-size: 20px;
}
.mf-modal__actions {
	display: flex;
	gap: 10px;
	margin-top: 18px;
}
.mf-modal__actions > * {
	flex: 1;
}
.mf .mf-modal__actions .mf-next {
	margin: 0;
	font-size: 16px;
	padding: 12px;
}
.mf-modal__secondary {
	padding: 12px;
	border: 2px solid var(--mf-green-bright);
	border-radius: 8px;
	background: #fff;
	color: var(--mf-green);
	font: inherit;
	font-weight: 700;
	cursor: pointer;
}
.mf-loader__box p {
	margin: 14px 0 0;
	font-weight: 600;
}
.mf-spinner {
	display: inline-block;
	width: 44px;
	height: 44px;
	border: 4px solid var(--mf-tint);
	border-top-color: var(--mf-green);
	border-radius: 50%;
	animation: mf-spin 0.8s linear infinite;
}
@keyframes mf-spin {
	to { transform: rotate(360deg); }
}

/* ---------- Test mode ---------- */
.mf-test {
	margin-top: 20px;
}
.mf-test__table {
	width: 100%;
	border-collapse: collapse;
	font-size: 13px;
}
.mf-test__table th,
.mf-test__table td {
	padding: 6px 8px;
	border-bottom: 1px solid var(--mf-line);
	text-align: left;
	vertical-align: top;
	word-break: break-word;
}
.mf-test__table th {
	width: 42%;
	font-weight: 600;
	color: var(--mf-muted);
}

/* ---------- Small phones ---------- */
@media (max-width: 380px) {
	.mf-options--four {
		grid-template-columns: 1fr 1fr;
	}
	.mf-grid-3 {
		grid-template-columns: 1fr 1fr;
	}
	.mf-grid-3 > :nth-child(2) {
		grid-column: 1 / -1;
		order: 3;
	}
}

@media (min-width: 782px) {
	.mf {
		padding-top: 36px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.mf-step,
	.mf-done,
	.mf-progress__bar,
	.mf-option span,
	.mf .mf-next {
		animation: none;
		transition: none;
	}
}
