/**
 * Free Style 3 — Public Forms
 * Contact Form 7 presentation for Contact, Custom Store, Submit Artwork,
 * and Wholesaler Form pages.
 */

.fsp-form-shell {
	padding: clamp(var(--fsp-space-5), 4vw, var(--fsp-space-8));
	border: 1px solid var(--fsp-border);
	border-radius: var(--fsp-radius-lg);
	background: var(--fsp-surface);
	box-shadow: var(--fsp-shadow-md);
}

.fsp-form-shell :where(.wpcf7-form) {
	display: grid;
	gap: var(--fsp-space-5);
}

.fsp-form-shell :where(.wpcf7-form.init) {
	opacity: 1;
}

.fsp-form-shell :where(p) {
	margin: 0;
}

.fsp-form-shell :where(label) {
	display: grid;
	gap: var(--fsp-space-2);
	font-size: var(--fsp-text-sm);
	font-weight: 700;
	line-height: 1.4;
}

.fsp-form-shell :where(.wpcf7-form-control-wrap) {
	display: block;
	min-width: 0;
}

.fsp-form-shell :where(
	input[type="text"],
	input[type="email"],
	input[type="tel"],
	input[type="number"],
	input[type="date"],
	input[type="url"],
	select,
	textarea
) {
	width: 100%;
	min-height: 3rem;
	padding: var(--fsp-space-3) var(--fsp-space-4);
	border: 1px solid var(--fsp-border);
	border-radius: var(--fsp-radius-sm);
	background: var(--fsp-ink-075);
	color: var(--fsp-text);
	font: inherit;
}

.fsp-form-shell :where(textarea) {
	min-height: 9rem;
	resize: vertical;
}

.fsp-form-shell :where(input, textarea)::placeholder {
	color: var(--fsp-ink-500);
	opacity: 1;
}

.fsp-form-shell :where(
	input[type="text"],
	input[type="email"],
	input[type="tel"],
	input[type="number"],
	input[type="date"],
	input[type="url"],
	select,
	textarea
):focus {
	border-color: var(--fsp-focus-ring);
	background: var(--fsp-surface);
	outline: 2px solid var(--fsp-focus-ring);
	outline-offset: 2px;
}

.fsp-form-shell :where([aria-invalid="true"]) {
	border-color: var(--fsp-danger);
}

.fsp-form-shell :where(input[type="file"]) {
	width: 100%;
	min-height: 3rem;
	padding: var(--fsp-space-2);
	border: 1px dashed var(--fsp-ink-300);
	border-radius: var(--fsp-radius-sm);
	background: var(--fsp-ink-075);
	color: var(--fsp-text-soft);
	font: inherit;
	cursor: pointer;
}

.fsp-form-shell :where(input[type="file"])::file-selector-button {
	margin-inline-end: var(--fsp-space-3);
	padding: var(--fsp-space-2) var(--fsp-space-3);
	border: 0;
	border-radius: var(--fsp-radius-sm);
	background: var(--fsp-blue-100);
	color: var(--fsp-blue-900);
	font: inherit;
	font-weight: 700;
	cursor: pointer;
}

.fsp-form-shell :where(input[type="file"])::file-selector-button:hover {
	background: var(--fsp-blue-300);
}

.fsp-form-shell :where(input[type="radio"], input[type="checkbox"]) {
	width: 1.15rem;
	height: 1.15rem;
	margin: 0;
	accent-color: var(--fsp-blue-700);
	flex: 0 0 auto;
}

.fsp-form-shell :where(.contact_normal_inputs, .contact_special_inputs, .form_flat) {
	display: grid;
	gap: var(--fsp-space-5);
}

/* Contact Form 7 preserves form-editor inline layout declarations. These
 * overrides make the supplied rows responsive within the theme grid. */
.fsp-form-shell :where(.form_row) {
	display: grid !important;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--fsp-space-5);
	align-items: start;
}

.fsp-form-shell :where(.form_row > p, .contact_normal_inputs > p, .contact_special_inputs > p) {
	display: grid;
	gap: var(--fsp-space-2);
	min-width: 0;
	color: var(--fsp-heading);
	font-size: var(--fsp-text-sm);
	font-weight: 700;
	line-height: 1.4;
}

.fsp-form-shell :where(.wpcf7-radio) {
	display: flex;
	flex-wrap: wrap;
	gap: var(--fsp-space-2) var(--fsp-space-5);
	padding-block-start: var(--fsp-space-2);
}

.fsp-form-shell :where(.wpcf7-list-item) {
	margin: 0;
}

.fsp-form-shell :where(.wpcf7-list-item label) {
	display: inline-flex;
	flex-direction: row;
	align-items: center;
	gap: var(--fsp-space-2);
	font-weight: 600;
	cursor: pointer;
}

.fsp-form-shell :where(.form_text_below) {
	margin-block-start: calc(-1 * var(--fsp-space-2));
	color: var(--fsp-text-soft);
	font-size: var(--fsp-text-sm);
}

.fsp-form-shell :where(.form_line_break) {
	width: 100%;
	margin-block: var(--fsp-space-2);
	border-block-start: 2px solid var(--fsp-blue-300);
}

.fsp-form-shell :where(.user_form_inputs) {
	display: grid !important;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--fsp-space-5);
	align-items: center;
}

.fsp-form-shell :where(.form_accept_terms label) {
	display: flex;
	flex-direction: row;
	align-items: flex-start;
	gap: var(--fsp-space-3);
}

.fsp-form-shell :where(.form_accept_terms .wpcf7-form-control-wrap) {
	flex: 0 0 auto;
	padding-block-start: var(--fsp-space-1);
}

.fsp-form-shell :where(.form_accept_terms a) {
	font-weight: 600;
}

.fsp-form-shell :where(input[type="submit"]) {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 10rem;
	min-height: 3rem;
	padding: var(--fsp-space-3) var(--fsp-space-6);
	border: 1px solid var(--fsp-blue-700);
	border-radius: var(--fsp-radius-md);
	background: var(--fsp-blue-700);
	color: var(--fsp-on-primary);
	font: inherit;
	font-weight: 700;
	line-height: 1.2;
	cursor: pointer;
	transition: background-color var(--fsp-dur-fast) var(--fsp-ease),
		border-color var(--fsp-dur-fast) var(--fsp-ease),
		transform var(--fsp-dur-fast) var(--fsp-ease);
}

.fsp-form-shell :where(input[type="submit"]):hover {
	border-color: var(--fsp-blue-900);
	background: var(--fsp-blue-900);
	transform: translateY(-1px);
}

.fsp-form-shell :where(input[type="submit"]):focus-visible {
	outline: 2px solid var(--fsp-focus-ring);
	outline-offset: 3px;
}

.fsp-form-shell :where(input[type="submit"]:disabled) {
	cursor: wait;
	opacity: 0.65;
	transform: none;
}

.fsp-form-shell :where(.form_submit) {
	display: flex;
	justify-content: flex-start;
}

.fsp-form-shell :where(.wpcf7-not-valid-tip) {
	display: block;
	margin-block-start: var(--fsp-space-1);
	color: var(--fsp-danger);
	font-size: var(--fsp-text-sm);
	font-weight: 600;
}

.fsp-form-shell :where(.wpcf7-response-output) {
	margin: 0;
	padding: var(--fsp-space-3) var(--fsp-space-4);
	border: 0;
	border-inline-start: 4px solid var(--fsp-info);
	border-radius: var(--fsp-radius-sm);
	background: var(--fsp-blue-50);
	color: var(--fsp-heading);
}

.fsp-form-shell :where(.wpcf7-form.sent .wpcf7-response-output) {
	border-inline-start-color: var(--fsp-success);
}

.fsp-form-shell :where(
	.wpcf7-form.invalid .wpcf7-response-output,
	.wpcf7-form.unaccepted .wpcf7-response-output,
	.wpcf7-form.payment-required .wpcf7-response-output,
	.wpcf7-form.spam .wpcf7-response-output,
	.wpcf7-form.failed .wpcf7-response-output,
	.wpcf7-form.aborted .wpcf7-response-output
) {
	border-inline-start-color: var(--fsp-danger);
	background: var(--fsp-ink-075);
}

.fsp-form-shell :where(.wpcf7-spinner) {
	margin: 0 var(--fsp-space-2);
	vertical-align: middle;
}

.fsp-form-shell :where(.screen-reader-response:focus) {
	padding: var(--fsp-space-3);
	border-radius: var(--fsp-radius-sm);
	background: var(--fsp-surface);
}

.fsp-form-shell :where(.fsp-form-fallback) {
	margin: 0;
	box-shadow: none;
}

@media (min-width: 48rem) {
	.fsp-form-shell :where(.contact_normal_inputs, .form_row) {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.fsp-form-shell :where(.form_row > :only-child) {
		grid-column: 1 / -1;
	}

	.fsp-form-shell :where(.user_form_inputs) {
		grid-template-columns: minmax(0, 3fr) minmax(10rem, 1fr);
	}

	.fsp-form-shell :where(.form_submit) {
		justify-content: flex-end;
	}
}
