/*
 * HZD Forms (decision 66). Tokens from docs/design/style-guide.md: navy
 * #1C294E, orange #E14D1E, slate #64748D, light #F7F9FC, hairline #E5EDF4,
 * lavender #DCDDEF, Inter. Self-contained: the forms sit in pages, popups and
 * cards whose own styles were written for Contact Form 7.
 */

.hzd-form {
	--hzf-line: #DCDDEF;
	width: 100%;
	margin: 0;
	font-family: Inter, sans-serif;
	font-size: 15px;
	line-height: 22px;
	color: #1C294E;
	text-align: left;
}

.hzd-form *,
.hzd-form *::before,
.hzd-form *::after {
	box-sizing: border-box;
}

.hzd-form fieldset {
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
}

.hzd-form-step[hidden] {
	display: none;
}

.hzd-form .hzd-form-title {
	display: block;
	margin: 0 0 6px;
	padding: 0;
	font-size: 22px;
	line-height: 28px;
	font-weight: 600;
	color: #1C294E;
}

.hzd-form .hzd-form-sub {
	margin: 0 0 20px;
	font-size: 15px;
	line-height: 22px;
	color: #64748D;
}

.hzd-form-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px 16px;
}

.hzd-form-field {
	grid-column: 1 / -1;
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
}

.hzd-form-field.is-half {
	grid-column: auto;
}

.hzd-form label,
.hzd-form-field > legend {
	margin: 0;
	padding: 0;
	font-size: 14px;
	line-height: 20px;
	font-weight: 500;
	color: #1C294E;
}

.hzd-form-req {
	margin-left: 3px;
	color: #E14D1E;
}

.hzd-form-help {
	font-size: 13px;
	line-height: 19px;
	color: #64748D;
}

.hzd-form input[type="text"],
.hzd-form input[type="email"],
.hzd-form input[type="tel"],
.hzd-form input[type="url"],
.hzd-form input[type="number"],
.hzd-form select,
.hzd-form textarea {
	display: block;
	width: 100%;
	height: 46px;
	margin: 0;
	padding: 0 14px;
	border: 1px solid var(--hzf-line);
	border-radius: 4px;
	background: #FFFFFF;
	box-shadow: none;
	font: 400 15px/22px Inter, sans-serif;
	color: #1C294E;
	transition: border-color 0.2s, box-shadow 0.2s;
	-webkit-appearance: none;
	appearance: none;
}

.hzd-form textarea {
	height: auto;
	min-height: 112px;
	padding: 12px 14px;
	resize: vertical;
}

.hzd-form select {
	padding-right: 36px;
	background: #FFFFFF url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23E14D1E' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 14px center;
	cursor: pointer;
}

.hzd-form ::placeholder {
	color: #B0C2D4;
	opacity: 1;
}

.hzd-form input:focus,
.hzd-form select:focus,
.hzd-form textarea:focus {
	outline: 0;
	border-color: #E14D1E;
	box-shadow: 0 0 0 3px #FBE5DD;
}

.hzd-form .is-invalid input,
.hzd-form .is-invalid select,
.hzd-form .is-invalid textarea,
.hzd-form .is-invalid .hzd-form-drop {
	border-color: #E14D1E;
}

.hzd-form-error {
	display: none;
	font-size: 13px;
	line-height: 18px;
	font-weight: 500;
	color: #E14D1E;
}

.hzd-form .is-invalid .hzd-form-error {
	display: block;
}

/* Radio choices as bordered rows. */
.hzd-form-choices {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px;
	margin-top: 4px;
}

.hzd-form .hzd-form-choices label {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 14px;
	border: 1px solid var(--hzf-line);
	border-radius: 4px;
	background: #FFFFFF;
	font-weight: 400;
	cursor: pointer;
	transition: border-color 0.2s, background-color 0.2s;
}

.hzd-form .hzd-form-choices label:has(input:checked) {
	border-color: #E14D1E;
	background: #FBE5DD;
}

.hzd-form-choices input {
	flex: none;
	width: 18px;
	height: 18px;
	margin: 0;
	accent-color: #E14D1E;
}

/* File: a dashed drop area; the real input covers it. */
.hzd-form-drop {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 84px;
	padding: 14px;
	border: 1px dashed #B0C2D4;
	border-radius: 4px;
	background: #F7F9FC;
	text-align: center;
	transition: border-color 0.2s, background-color 0.2s;
}

.hzd-form-drop:hover,
.hzd-form-drop.is-over,
.hzd-form-drop:focus-within {
	border-color: #E14D1E;
	background: #FBE5DD;
}

.hzd-form-drop input[type="file"] {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	opacity: 0;
	cursor: pointer;
}

.hzd-form-drop-text {
	display: grid;
	gap: 2px;
	font-size: 14px;
	line-height: 20px;
	color: #64748D;
	pointer-events: none;
}

.hzd-form-drop-text b {
	font-weight: 600;
	color: #E14D1E;
}

.hzd-form-drop-text small {
	font-size: 12px;
	line-height: 16px;
}

.hzd-form-drop.has-file .hzd-form-drop-text {
	color: #1C294E;
	font-weight: 500;
}

.hzd-form-actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 10px;
	margin-top: 22px;
}

.hzd-form button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 46px;
	margin: 0;
	padding: 12px 24px;
	border: 1px solid #E14D1E;
	border-radius: 4px;
	background: #E14D1E;
	box-shadow: none;
	font: 500 15px/20px Inter, sans-serif;
	color: #FFFFFF;
	text-transform: none;
	letter-spacing: 0;
	cursor: pointer;
	transition: background-color 0.2s, color 0.2s;
}

.hzd-form button:hover,
.hzd-form button:focus-visible {
	background: #FFFFFF;
	color: #E14D1E;
}

.hzd-form button.hzd-form-back {
	margin-right: auto;
	border-color: #DCDDEF;
	background: #FFFFFF;
	color: #1C294E;
}

.hzd-form button.hzd-form-back:hover {
	border-color: #1C294E;
}

.hzd-form button[disabled] {
	opacity: 0.7;
	cursor: wait;
}

.hzd-form button.is-busy::after {
	content: "";
	width: 14px;
	height: 14px;
	border: 2px solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	animation: hzd-form-spin 0.7s linear infinite;
}

@keyframes hzd-form-spin {
	to {
		transform: rotate(360deg);
	}
}

/* Step indicator on multi-step forms. */
.hzd-form-progress {
	display: flex;
	gap: 8px;
	margin: 0 0 24px;
	padding: 0;
	list-style: none;
	counter-reset: none;
}

.hzd-form-progress li {
	display: flex;
	flex: 1;
	align-items: center;
	gap: 8px;
	margin: 0;
	padding: 0 0 10px;
	border-bottom: 3px solid #E5EDF4;
	font-size: 13px;
	line-height: 18px;
	font-weight: 500;
	color: #64748D;
	transition: border-color 0.3s, color 0.3s;
}

.hzd-form-progress li::before,
.hzd-form-progress li::marker {
	content: none;
}

.hzd-form-progress span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: none;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: #E5EDF4;
	font-size: 12px;
	font-weight: 700;
	color: #64748D;
}

.hzd-form-progress li.is-current,
.hzd-form-progress li.is-done {
	border-bottom-color: #E14D1E;
	color: #1C294E;
}

.hzd-form-progress li.is-current span,
.hzd-form-progress li.is-done span {
	background: #E14D1E;
	color: #FFFFFF;
}

.hzd-form-review {
	display: grid;
	grid-template-columns: minmax(120px, 34%) 1fr;
	gap: 0;
	margin: 0;
	border: 1px solid #E5EDF4;
	border-radius: 8px;
	overflow: hidden;
}

.hzd-form-review dt,
.hzd-form-review dd {
	margin: 0;
	padding: 10px 14px;
	border-top: 1px solid #E5EDF4;
	font-size: 14px;
	line-height: 20px;
	overflow-wrap: anywhere;
}

.hzd-form-review dt {
	background: #F7F9FC;
	font-weight: 600;
	color: #64748D;
}

.hzd-form-review dt:first-of-type,
.hzd-form-review dt:first-of-type + dd {
	border-top: 0;
}

.hzd-form .hzd-form-note {
	margin: 16px 0 0;
	font-size: 13px;
	line-height: 19px;
	color: #64748D;
}

.hzd-form .hzd-form-status {
	margin: 12px 0 0;
	font-size: 14px;
	line-height: 20px;
	font-weight: 500;
	color: #E14D1E;
}

.hzd-form .hzd-form-status:empty {
	display: none;
}

.hzd-form .hzd-form-status.is-ok {
	color: #42A07D;
}

.hzd-form-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* Forms on dark backgrounds keep white fields and readable labels. */
.hzd-band-navy .hzd-form label,
.hzd-band-navy .hzd-form .hzd-form-title {
	color: #FFFFFF;
}

@media (max-width: 600px) {
	.hzd-form-grid,
	.hzd-form-choices {
		grid-template-columns: 1fr;
	}

	.hzd-form-field.is-half {
		grid-column: 1 / -1;
	}

	.hzd-form-actions button {
		flex: 1;
	}

	.hzd-form-progress li {
		font-size: 0;
		justify-content: center;
	}

	.hzd-form-review {
		grid-template-columns: 1fr;
	}

	.hzd-form-review dd {
		border-top: 0;
		padding-top: 0;
	}

	.hzd-form-review dt {
		background: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.hzd-form * {
		transition: none !important;
		animation: none !important;
	}
}
