/*
 * REACH Supply Find My Part request workspace.
 *
 * RS-DS-010: long service forms use a clearly sectioned neutral workspace.
 * RS-DS-011: guidance is compact and actionable, never a decorative
 * blue/green card stack.
 *
 * Scope is limited to the existing Find My Part page. Field names,
 * submission actions, validation, email delivery, and stored submissions are
 * unchanged.
 */

body.reach-design-system .reach-compatibility-page .reach-part-form-anchor {
	box-sizing: border-box;
	max-width: 100%;
	min-width: 0;
	scroll-margin-top: 8rem;
	width: 100%;
}

/* The old Breakdance guide is retained in the page export for rollback, but
 * the plugin supplies the canonical guide so legacy v2-v12 rules cannot leak
 * into the new component. */
body.reach-design-system .reach-compatibility-page .reach-compat-smart-guide.rs-find-part-legacy-guide {
	display: none !important;
}

body.reach-design-system .reach-compatibility-page .rs-find-part-portal {
	align-items: start !important;
	background: var(--rs-color-surface) !important;
	border: var(--rs-border-default) !important;
	border-top: 4px solid var(--rs-color-gold) !important;
	border-radius: 1.125rem !important;
	box-shadow: var(--rs-shadow-md) !important;
	box-sizing: border-box;
	display: grid !important;
	gap: clamp(var(--rs-space-5), 3vw, 2.5rem) !important;
	grid-template-columns: minmax(15rem, 17.5rem) minmax(0, 1fr) !important;
	max-width: 100%;
	min-width: 0;
	padding: clamp(var(--rs-space-5), 3vw, 2.5rem) !important;
	position: relative;
	width: 100% !important;
}

body.reach-design-system .reach-compatibility-page .rs-find-part-portal::before {
	background: var(--rs-color-gold);
	border-radius: var(--rs-radius-pill);
	content: "";
	height: 0.25rem;
	left: clamp(var(--rs-space-5), 3vw, 2.5rem);
	position: absolute;
	top: -0.25rem;
	width: 5.5rem;
}

body.reach-design-system .reach-compatibility-page :where(
	.rs-find-part-guide-host,
	.rs-find-part-main
) {
	box-sizing: border-box;
	max-width: 100% !important;
	min-width: 0;
	width: 100% !important;
}

body.reach-design-system .reach-compatibility-page .rs-find-part-guide-host {
	align-self: start;
	position: sticky;
	top: 7rem;
}

body.reach-design-system .reach-compatibility-page .rs-find-part-main,
body.reach-design-system .reach-compatibility-page .rs-find-part-main > form {
	max-width: 100%;
	min-width: 0;
	width: 100%;
}

/* Request guide */
body.reach-design-system .reach-compatibility-page .rs-find-part-guide {
	background: var(--rs-color-surface-soft);
	border: var(--rs-border-default);
	border-radius: var(--rs-radius-lg);
	box-shadow: none;
	box-sizing: border-box;
	color: var(--rs-color-ink);
	margin: 0;
	padding: var(--rs-space-5);
}

body.reach-design-system .reach-compatibility-page .rs-find-part-guide__eyebrow {
	color: var(--rs-color-warning);
	display: block;
	font-size: var(--rs-font-size-xs);
	font-weight: var(--rs-font-weight-bold);
	letter-spacing: 0.08em;
	line-height: 1.35;
	margin: 0 0 var(--rs-space-2);
	text-transform: uppercase;
}

body.reach-design-system .reach-compatibility-page .rs-find-part-guide h3 {
	color: var(--rs-color-ink);
	font-size: clamp(1.1rem, 2vw, 1.3rem);
	font-weight: var(--rs-font-weight-bold);
	letter-spacing: -0.015em;
	line-height: 1.35;
	margin: 0;
}

body.reach-design-system .reach-compatibility-page .rs-find-part-guide__intro {
	color: var(--rs-color-muted);
	font-size: var(--rs-font-size-sm);
	line-height: 1.55;
	margin: var(--rs-space-3) 0 0;
}

body.reach-design-system .reach-compatibility-page .rs-find-part-guide__steps {
	border-top: var(--rs-border-default);
	display: grid;
	gap: 0;
	grid-template-columns: 1fr;
	margin-top: var(--rs-space-5);
}

body.reach-design-system .reach-compatibility-page .rs-find-part-guide__step {
	align-items: center;
	appearance: none;
	background: transparent;
	border: 0;
	border-bottom: var(--rs-border-default);
	border-radius: 0;
	color: var(--rs-color-muted);
	cursor: pointer;
	display: grid;
	font: inherit;
	font-size: 0.84rem;
	font-weight: var(--rs-font-weight-semibold);
	gap: var(--rs-space-3);
	grid-template-columns: 2.25rem minmax(0, 1fr);
	line-height: 1.4;
	min-height: 3.5rem;
	padding: var(--rs-space-3) 0;
	text-align: left;
	transition: color var(--rs-transition-fast), background-color var(--rs-transition-fast);
	width: 100%;
}

body.reach-design-system .reach-compatibility-page .rs-find-part-guide__step:last-child {
	border-bottom: 0;
}

body.reach-design-system .reach-compatibility-page .rs-find-part-guide__step:hover,
body.reach-design-system .reach-compatibility-page .rs-find-part-guide__step.is-active {
	color: var(--rs-color-ink);
}

body.reach-design-system .reach-compatibility-page .rs-find-part-guide__step:focus-visible {
	border-radius: var(--rs-radius-sm);
	outline: 3px solid rgb(226 166 60 / 35%);
	outline-offset: 2px;
}

body.reach-design-system .reach-compatibility-page .rs-find-part-guide__number {
	align-items: center;
	background: var(--rs-color-ink);
	border-radius: var(--rs-radius-sm);
	box-shadow: inset 0 -3px 0 var(--rs-color-gold);
	color: var(--rs-color-on-ink);
	display: inline-flex;
	font-size: var(--rs-font-size-sm);
	font-weight: var(--rs-font-weight-bold);
	height: 2.25rem;
	justify-content: center;
	width: 2.25rem;
}

body.reach-design-system .reach-compatibility-page .rs-find-part-guide__step.is-active .rs-find-part-guide__number {
	background: var(--rs-color-gold);
	box-shadow: none;
	color: var(--rs-color-on-gold);
}

body.reach-design-system .reach-compatibility-page .rs-find-part-guide__note {
	border-top: var(--rs-border-default);
	color: var(--rs-color-muted);
	font-size: 0.8rem;
	line-height: 1.55;
	margin: var(--rs-space-4) 0 0;
	padding-top: var(--rs-space-4);
}

/* Form structure */
body.reach-design-system .reach-compatibility-page .rs-find-part-form {
	box-sizing: border-box;
	max-width: 100%;
	min-width: 0;
	width: 100%;
}

body.reach-design-system .reach-compatibility-page .rs-find-part-form :where(
	.breakdance-form-field,
	[class*="breakdance-form-field"]
) {
	box-sizing: border-box;
	min-width: 0;
}

body.reach-design-system .reach-compatibility-page .rs-find-part-section {
	align-items: center;
	background: var(--rs-color-surface-soft);
	border: var(--rs-border-default);
	border-radius: var(--rs-radius-md);
	box-sizing: border-box;
	display: grid;
	flex: 0 0 100%;
	gap: var(--rs-space-4);
	grid-column: 1 / -1;
	grid-template-columns: 2.75rem minmax(0, 1fr);
	margin: var(--rs-space-3) 0 var(--rs-space-1);
	max-width: 100%;
	min-width: 0;
	padding: var(--rs-space-4);
	width: 100%;
}

body.reach-design-system .reach-compatibility-page .rs-find-part-section:first-child {
	margin-top: 0;
}

body.reach-design-system .reach-compatibility-page .rs-find-part-section__number {
	align-items: center;
	background: var(--rs-color-ink);
	border-radius: var(--rs-radius-sm);
	box-shadow: inset 0 -3px 0 var(--rs-color-gold);
	color: var(--rs-color-on-ink);
	display: inline-flex;
	font-size: 1rem;
	font-weight: var(--rs-font-weight-bold);
	height: 2.75rem;
	justify-content: center;
	width: 2.75rem;
}

body.reach-design-system .reach-compatibility-page .rs-find-part-section__copy {
	min-width: 0;
}

body.reach-design-system .reach-compatibility-page .rs-find-part-section__eyebrow {
	color: var(--rs-color-warning);
	display: block;
	font-size: var(--rs-font-size-xs);
	font-weight: var(--rs-font-weight-bold);
	letter-spacing: 0.07em;
	line-height: 1.3;
	margin: 0 0 var(--rs-space-1);
	text-transform: uppercase;
}

body.reach-design-system .reach-compatibility-page .rs-find-part-section strong {
	color: var(--rs-color-ink);
	display: block;
	font-size: 1.05rem;
	font-weight: var(--rs-font-weight-bold);
	line-height: 1.35;
}

body.reach-design-system .reach-compatibility-page .rs-find-part-section p {
	color: var(--rs-color-muted);
	font-size: 0.82rem;
	line-height: 1.5;
	margin: var(--rs-space-1) 0 0;
}

body.reach-design-system .reach-compatibility-page .rs-find-part-form :where(
	label,
	.breakdance-form-field__label
) {
	color: var(--rs-color-ink) !important;
	font-size: 0.92rem !important;
	font-weight: var(--rs-font-weight-bold) !important;
	line-height: 1.4 !important;
}

body.reach-design-system .reach-compatibility-page .rs-find-part-form .required {
	color: var(--rs-color-error);
}

body.reach-design-system .reach-compatibility-page .rs-find-part-optional {
	color: var(--rs-color-subtle);
	font-size: var(--rs-font-size-xs);
	font-weight: var(--rs-font-weight-medium);
	margin-left: var(--rs-space-2);
}

body.reach-design-system .reach-compatibility-page .rs-find-part-form :where(
	input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]),
	select,
	textarea
) {
	background: var(--rs-color-surface) !important;
	border: var(--rs-border-strong) !important;
	border-radius: 0.625rem !important;
	box-shadow: none !important;
	box-sizing: border-box;
	color: var(--rs-color-ink) !important;
	font: inherit;
	font-size: var(--rs-font-size-base) !important;
	font-weight: var(--rs-font-weight-regular) !important;
	line-height: 1.45 !important;
	max-width: 100% !important;
	min-height: 3.25rem !important;
	min-width: 0 !important;
	padding: 0.8rem 0.9rem !important;
	transition: border-color var(--rs-transition-fast), box-shadow var(--rs-transition-fast), background-color var(--rs-transition-fast);
	width: 100% !important;
}

body.reach-design-system .reach-compatibility-page .rs-find-part-form textarea {
	min-height: 10rem !important;
	resize: vertical;
}

body.reach-design-system .reach-compatibility-page .rs-find-part-form :where(
	input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]),
	textarea
)::placeholder {
	color: var(--rs-color-subtle) !important;
	opacity: 1 !important;
}

body.reach-design-system .reach-compatibility-page .rs-find-part-form :where(
	input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]),
	select,
	textarea
):focus {
	border-color: var(--rs-color-focus) !important;
	box-shadow: var(--rs-focus-ring) !important;
	outline: 0 !important;
}

body.reach-design-system .reach-compatibility-page .rs-find-part-help,
body.reach-design-system .reach-compatibility-page .rs-find-part-file-status {
	color: var(--rs-color-muted);
	display: block;
	font-size: var(--rs-font-size-sm);
	font-weight: var(--rs-font-weight-regular);
	line-height: 1.5;
	margin-top: var(--rs-space-2);
}

/* Evidence upload */
body.reach-design-system .reach-compatibility-page .rs-find-part-form input[type="file"] {
	background: var(--rs-color-surface-soft) !important;
	border: 1px dashed var(--rs-color-border-strong) !important;
	border-radius: var(--rs-radius-md) !important;
	cursor: pointer;
	min-height: 5rem !important;
	padding: var(--rs-space-5) !important;
}

body.reach-design-system .reach-compatibility-page .rs-find-part-file-tips {
	display: grid;
	gap: var(--rs-space-2);
	grid-template-columns: repeat(4, minmax(0, 1fr));
	margin-top: var(--rs-space-3);
}

body.reach-design-system .reach-compatibility-page .rs-find-part-file-tips span {
	background: var(--rs-color-surface-soft);
	border: var(--rs-border-default);
	border-radius: var(--rs-radius-sm);
	color: var(--rs-color-muted);
	font-size: var(--rs-font-size-xs);
	font-weight: var(--rs-font-weight-semibold);
	line-height: 1.35;
	padding: var(--rs-space-2);
	text-align: center;
}

/* Consent and submit area */
body.reach-design-system .reach-compatibility-page .rs-find-part-consent {
	background: var(--rs-color-surface-soft);
	border: var(--rs-border-default);
	border-radius: var(--rs-radius-md);
	box-sizing: border-box;
	flex: 0 0 100%;
	grid-column: 1 / -1;
	padding: var(--rs-space-4);
	width: 100%;
}

body.reach-design-system .reach-compatibility-page .rs-find-part-consent :where(label, .breakdance-form-field__label) {
	align-items: flex-start;
	display: flex !important;
	font-size: var(--rs-font-size-sm) !important;
	font-weight: var(--rs-font-weight-medium) !important;
	gap: var(--rs-space-3);
	line-height: 1.55 !important;
}

body.reach-design-system .reach-compatibility-page .rs-find-part-consent input[type="checkbox"] {
	accent-color: var(--rs-color-ink);
	flex: 0 0 auto;
	height: 1.35rem !important;
	margin: 0.1rem 0 0 !important;
	min-height: 1.35rem !important;
	min-width: 1.35rem !important;
	width: 1.35rem !important;
}

body.reach-design-system .reach-compatibility-page .rs-find-part-submit-wrap {
	flex: 0 0 100%;
	grid-column: 1 / -1;
	width: 100%;
}

body.reach-design-system .reach-compatibility-page .rs-find-part-form :where(
	button[type="submit"],
	input[type="submit"],
	.breakdance-form-button
) {
	align-items: center;
	appearance: none;
	background: var(--rs-color-ink) !important;
	border: 1px solid var(--rs-color-ink) !important;
	border-radius: 0.625rem !important;
	box-shadow: none !important;
	color: var(--rs-color-on-ink) !important;
	cursor: pointer;
	display: inline-flex !important;
	font: inherit;
	font-size: var(--rs-font-size-base) !important;
	font-weight: var(--rs-font-weight-bold) !important;
	justify-content: center;
	line-height: 1.2 !important;
	min-height: 3.35rem !important;
	padding: var(--rs-space-3) var(--rs-space-5) !important;
	text-align: center;
	transition: background-color var(--rs-transition-fast), border-color var(--rs-transition-fast), box-shadow var(--rs-transition-fast), transform var(--rs-transition-fast);
	width: 100% !important;
}

body.reach-design-system .reach-compatibility-page .rs-find-part-form :where(
	button[type="submit"],
	input[type="submit"],
	.breakdance-form-button
):hover {
	background: var(--rs-color-ink-hover) !important;
	border-color: var(--rs-color-ink-hover) !important;
	box-shadow: var(--rs-shadow-sm) !important;
	transform: translateY(-1px);
}

body.reach-design-system .reach-compatibility-page .rs-find-part-submit-note {
	align-items: center;
	color: var(--rs-color-muted);
	display: flex;
	flex: 0 0 100%;
	flex-wrap: wrap;
	font-size: var(--rs-font-size-xs);
	gap: var(--rs-space-2) var(--rs-space-4);
	grid-column: 1 / -1;
	justify-content: center;
	line-height: 1.45;
	margin-top: calc(var(--rs-space-2) * -1);
	text-align: center;
	width: 100%;
}

body.reach-design-system .reach-compatibility-page .rs-find-part-submit-note span {
	align-items: center;
	display: inline-flex;
	gap: var(--rs-space-1);
}

body.reach-design-system .reach-compatibility-page .rs-find-part-submit-note span::before {
	background: var(--rs-color-gold);
	border-radius: var(--rs-radius-pill);
	content: "";
	height: 0.35rem;
	width: 0.35rem;
}

/* Validation and result states */
body.reach-design-system .reach-compatibility-page .rs-find-part-form :where(
	[aria-invalid="true"],
	.breakdance-form-field--error input,
	.breakdance-form-field--error select,
	.breakdance-form-field--error textarea
) {
	border-color: var(--rs-color-error) !important;
}

body.reach-design-system .reach-compatibility-page .rs-find-part-form :where(
	.breakdance-form-field__error,
	.breakdance-form-error,
	[role="alert"]
) {
	color: var(--rs-color-error);
	font-size: var(--rs-font-size-sm);
	font-weight: var(--rs-font-weight-semibold);
	line-height: 1.45;
}

body.reach-design-system .reach-compatibility-page .rs-find-part-form :where(
	.breakdance-form-message,
	.breakdance-form-success,
	.breakdance-form-error-message
) {
	background: var(--rs-color-surface);
	border: var(--rs-border-default);
	border-left: 4px solid var(--rs-color-gold);
	border-radius: var(--rs-radius-md);
	color: var(--rs-color-ink);
	line-height: 1.55;
	padding: var(--rs-space-4) var(--rs-space-5);
}

@media (max-width: 960px) {
	body.reach-design-system .reach-compatibility-page .rs-find-part-portal {
		grid-template-columns: 1fr !important;
	}

	body.reach-design-system .reach-compatibility-page .rs-find-part-guide-host {
		position: static;
		top: auto;
	}

	body.reach-design-system .reach-compatibility-page .rs-find-part-guide__steps {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	body.reach-design-system .reach-compatibility-page .rs-find-part-guide__step {
		border-bottom: 0;
		border-right: var(--rs-border-default);
		padding: var(--rs-space-3);
	}

	body.reach-design-system .reach-compatibility-page .rs-find-part-guide__step:last-child {
		border-right: 0;
	}
}

@media (max-width: 680px) {
	body.reach-design-system .reach-compatibility-page .rs-find-part-portal {
		border-radius: var(--rs-radius-lg) !important;
		gap: var(--rs-space-5) !important;
		padding: var(--rs-space-4) !important;
	}

	body.reach-design-system .reach-compatibility-page .rs-find-part-portal::before {
		left: var(--rs-space-4);
	}

	body.reach-design-system .reach-compatibility-page .rs-find-part-guide {
		padding: var(--rs-space-4);
	}

	body.reach-design-system .reach-compatibility-page .rs-find-part-guide__steps {
		grid-template-columns: 1fr;
		margin-top: var(--rs-space-4);
	}

	body.reach-design-system .reach-compatibility-page .rs-find-part-guide__step {
		border-bottom: var(--rs-border-default);
		border-right: 0;
		min-height: 3.1rem;
		padding: var(--rs-space-2) 0;
	}

	body.reach-design-system .reach-compatibility-page .rs-find-part-guide__step:last-child {
		border-bottom: 0;
	}

	body.reach-design-system .reach-compatibility-page .rs-find-part-section {
		align-items: start;
		gap: var(--rs-space-3);
		grid-template-columns: 2.5rem minmax(0, 1fr);
		padding: var(--rs-space-3);
	}

	body.reach-design-system .reach-compatibility-page .rs-find-part-section__number {
		height: 2.5rem;
		width: 2.5rem;
	}

	body.reach-design-system .reach-compatibility-page .rs-find-part-form :where(
		input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]),
		select,
		textarea
	) {
		font-size: 16px !important;
	}

	body.reach-design-system .reach-compatibility-page .rs-find-part-file-tips {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	body.reach-design-system .reach-compatibility-page .rs-find-part-consent {
		padding: var(--rs-space-3);
	}
}

@media (max-width: 390px) {
	body.reach-design-system .reach-compatibility-page .rs-find-part-portal {
		padding: var(--rs-space-3) !important;
	}

	body.reach-design-system .reach-compatibility-page .rs-find-part-guide {
		padding: var(--rs-space-3);
	}

	body.reach-design-system .reach-compatibility-page .rs-find-part-section p {
		font-size: var(--rs-font-size-xs);
	}
}

@media (prefers-reduced-motion: reduce) {
	body.reach-design-system .reach-compatibility-page .rs-find-part-form :where(
		button[type="submit"],
		input[type="submit"],
		.breakdance-form-button
	) {
		transition: none;
	}
}
