/*
 * Wholesale enquiry form.
 *
 * The form sits inside the dark enquiry band from assets/css/wholesale.css, so
 * it is given its own light panel: the band keeps its contrast and the inputs
 * keep the contrast an input needs. Every colour, space, radius, shadow and
 * duration is a design token from assets/css/design-tokens.css, so a
 * [data-theme="dark"] remap of the role tokens recolours the panel with no
 * rules here. The buttons come from the shared .hcr-btn rules.
 *
 * Mobile-first: one column, no fixed widths, nothing wider than its container.
 * The two-column grid only appears from 40em up.
 */

.hcr-enquiry {
	margin-top: var(--space-8);
}

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

/* ------------------------------------------------------- the status note --- */

/*
 * Always in the DOM so the live region is reliable; collapsed to nothing when
 * it has no text so the layout does not carry an empty box.
 */
.hcr-enquiry__status {
	margin: 0;
	font-family: var(--font-body);
	font-size: var(--text-base);
	line-height: var(--leading-normal);
}

.hcr-enquiry__status:empty {
	display: none;
}

.hcr-enquiry__status--success,
.hcr-enquiry__status--error {
	margin-bottom: var(--space-6);
	padding: var(--space-4) var(--space-5);
	border-left: 4px solid currentColor;
	border-radius: var(--radius-md);
	font-weight: var(--weight-medium);
}

.hcr-enquiry__status--success {
	background: rgba(22, 163, 74, 0.14);
	color: var(--color-accent-100);
}

.hcr-enquiry__status--error {
	background: rgba(220, 38, 38, 0.16);
	color: var(--color-primary-100);
}

/* ------------------------------------------------------------- the panel --- */

.hcr-enquiry__form {
	padding: var(--space-6);
	background: var(--color-bg);
	border: var(--border-width) solid var(--color-border);
	border-radius: var(--radius-xl);
	box-shadow: var(--shadow-lg);
	color: var(--color-text);
}

.hcr-enquiry__grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--space-5);
}

/* ------------------------------------------------------------ the fields --- */

.hcr-enquiry__field {
	display: flex;
	flex-direction: column;
	gap: var(--space-2);
	min-width: 0;
}

.hcr-enquiry__label {
	color: var(--color-text);
	font-family: var(--font-body);
	font-size: var(--text-sm);
	font-weight: var(--weight-medium);
	letter-spacing: var(--letter-wide);
	text-transform: uppercase;
}

.hcr-enquiry__required {
	color: var(--color-primary-600);
}

.hcr-enquiry__input {
	width: 100%;
	max-width: 100%;
	padding: var(--space-3) var(--space-4);
	background: var(--color-surface);
	border: var(--border-width) solid var(--color-border);
	border-radius: var(--radius-md);
	color: var(--color-text);
	font-family: var(--font-body);
	font-size: var(--text-base);
	line-height: var(--leading-normal);
	transition:
		border-color var(--duration-fast) var(--ease-default),
		box-shadow var(--duration-fast) var(--ease-default);
}

.hcr-enquiry__input:hover {
	border-color: var(--color-neutral-400);
}

.hcr-enquiry__input:focus-visible {
	outline: 2px solid var(--color-primary-600);
	outline-offset: 2px;
	border-color: var(--color-primary-600);
	box-shadow: var(--shadow-glow);
}

.hcr-enquiry__textarea {
	resize: vertical;
	min-height: 7.5rem;
}

.hcr-enquiry__select {
	/* Keep the native control: it is the accessible, keyboard-friendly one. */
	appearance: auto;
	cursor: pointer;
}

.hcr-enquiry__field--invalid .hcr-enquiry__input {
	border-color: var(--color-error);
}

.hcr-enquiry__error {
	margin: 0;
	color: var(--color-error);
	font-family: var(--font-body);
	font-size: var(--text-sm);
	font-weight: var(--weight-medium);
	line-height: var(--leading-snug);
}

.hcr-enquiry__hint {
	margin: 0;
	color: var(--color-text-muted);
	font-family: var(--font-body);
	font-size: var(--text-sm);
	line-height: var(--leading-snug);
}

/* ---------------------------------------------------------- the honeypot --- */

/*
 * Taken out of the layout and out of the accessibility tree without
 * display:none, which some bots check for.
 */
.hcr-enquiry__hp {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/* ----------------------------------------------------------- the actions --- */

.hcr-enquiry__actions {
	display: flex;
	flex-direction: column;
	gap: var(--space-4);
	margin-top: var(--space-6);
}

.hcr-enquiry__submit {
	align-self: flex-start;
	font-size: var(--text-base);
	font-weight: var(--weight-semibold);
}

.hcr-enquiry__submit:focus-visible {
	outline: 2px solid var(--color-primary-600);
	outline-offset: 3px;
}

.hcr-enquiry__legal {
	margin: 0;
	color: var(--color-text-muted);
	font-family: var(--font-body);
	font-size: var(--text-sm);
	line-height: var(--leading-snug);
}

/* ------------------------------------------------------------ the steps --- */

/*
 * The "what happens next" list keeps its place above the form, so the band
 * still explains the process rather than opening with a bare set of inputs.
 */
.hcr-wholesale__steps {
	margin-bottom: var(--space-4);
}

/* -------------------------------------------------------- breakpoints --- */

@media (min-width: 40em) {
	.hcr-enquiry__form {
		padding: var(--space-8);
	}

	.hcr-enquiry__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: var(--space-5) var(--space-6);
	}

	/* The volume select and the message both want the full width. */
	.hcr-enquiry__field--volume,
	.hcr-enquiry__field--message {
		grid-column: 1 / -1;
	}

	.hcr-enquiry__actions {
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
		gap: var(--space-6);
	}

	.hcr-enquiry__legal {
		max-width: 34ch;
		text-align: right;
	}
}

@media (prefers-reduced-motion: reduce) {
	.hcr-enquiry__input {
		transition: none;
	}
}
