/**
 * Request a Quote form widget.
 *
 * Two groups (what you need, your details), each opened by a numbered
 * legend on a hairline, so a long form reads as two short steps.
 */

.dw-quote {
	padding: clamp(1.5rem, 1rem + 2.5vw, 3rem);
	border: 1px solid var(--dw-color-border);
	border-radius: var(--dw-radius-lg);
	background: var(--dw-color-white);
}

.dw-quote__title {
	margin-block-end: var(--dw-space-2);
	font-size: var(--dw-fs-xl);
}

.dw-quote__intro {
	max-width: 60ch;
	margin-block-end: var(--dw-space-6);
}

.dw-quote__form {
	counter-reset: dw-quote-group;
}

.dw-quote__group {
	display: grid;
	gap: var(--dw-space-4);
	min-width: 0;
	margin: 0 0 var(--dw-space-6);
	padding: 0;
	border: 0;
}

/* Legends are awkward to lay out, so the rule and number sit on the legend
   itself, floated to behave like a normal block. */
.dw-quote__legend {
	float: left;
	display: flex;
	align-items: center;
	gap: var(--dw-space-3);
	width: 100%;
	margin: 0 0 var(--dw-space-1);
	padding: 0 0 var(--dw-space-3);
	border-block-end: 1px solid var(--dw-color-border);
	color: var(--dw-color-heading);
	font-family: var(--dw-font-heading);
	font-size: var(--dw-fs-md);
	font-stretch: var(--dw-heading-stretch);
	font-weight: 700;
	letter-spacing: var(--dw-heading-tracking);
	counter-increment: dw-quote-group;
}

.dw-quote__legend::before {
	content: counter(dw-quote-group);
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: var(--dw-color-primary);
	color: var(--dw-color-white);
	font-size: var(--dw-fs-sm);
	letter-spacing: 0;
}

.dw-quote__legend + * {
	clear: both;
}

.dw-quote .dw-field label {
	margin-block-end: var(--dw-space-2);
}

.dw-quote .dw-field__hint {
	margin: calc(-1 * var(--dw-space-1)) 0 var(--dw-space-2);
	color: var(--dw-color-muted);
	font-size: var(--dw-fs-sm);
	line-height: 1.5;
}

.dw-quote__footer {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--dw-space-3);
	margin-block-start: var(--dw-space-2);
}

.dw-quote__required-note {
	margin: 0;
	color: var(--dw-color-muted);
	font-size: var(--dw-fs-xs);
}

.dw-quote__required-note span {
	color: var(--dw-color-error);
}

.dw-quote .dw-btn--block {
	flex: 1 1 100%;
}

.dw-quote .dw-field--check label a {
	color: var(--dw-color-secondary);
	font-weight: 600;
}

/* Consent: a full-height row so the tap target is not just the 18px box. */
.dw-quote .dw-field--check {
	min-height: 44px;
	align-items: center;
}

/* Dark variant: place the widget in a dark section and set the form box
   background to transparent; fields stay readable. */
.dw-on-dark .dw-quote label,
.dw-on-dark .dw-quote__title,
.dw-on-dark .dw-quote__legend {
	color: var(--dw-color-white);
}
