/* Fillable forms (HHA Forms) shown inside lessons. */

.hha-builder-card {
	margin-top: 1rem;
}

.hha-bf-intro {
	margin: 0.6rem 0 1rem;
	color: var(--hha-muted, #5a675f);
	font-size: 0.92rem;
}

.hha-builder-form {
	display: block;
}

.hha-bf-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.9rem 1.2rem;
}

.hha-bf-field {
	position: relative;
	display: grid;
	gap: 0.3rem;
	align-content: start;
	min-width: 0;
}

.hha-bf-full {
	grid-column: 1 / -1;
}

.hha-bf-half {
	grid-column: span 1;
}

.hha-bf-field > label:not(.hha-bf-option),
.hha-bf-field legend,
.hha-bf-label {
	font-weight: 600;
	font-size: 0.85rem;
	color: var(--hha-ink, #151b23);
}

.hha-bf-req {
	color: #c45c26;
}

.hha-builder-form input[type="text"],
.hha-builder-form input[type="email"],
.hha-builder-form input[type="tel"],
.hha-builder-form input[type="number"],
.hha-builder-form input[type="date"],
.hha-builder-form input[type="file"],
.hha-builder-form select,
.hha-builder-form textarea {
	width: 100%;
	box-sizing: border-box;
	padding: 0.65rem 0.75rem;
	border: 1px solid var(--hha-line, #d7e8e2);
	border-radius: 12px;
	font: inherit;
	font-size: 0.9rem;
	background: #fff;
}

.hha-builder-form input[type="checkbox"],
.hha-builder-form input[type="radio"] {
	width: auto;
	margin: 0.2rem 0.5rem 0 0;
	flex: 0 0 auto;
}

.hha-bf-field fieldset {
	margin: 0;
	padding: 0;
	border: 0;
	display: grid;
	gap: 0.4rem;
}

.hha-bf-option {
	display: flex;
	align-items: flex-start;
	font-weight: 400;
	font-size: 0.9rem;
	color: var(--hha-ink, #151b23);
	cursor: pointer;
}

.hha-bf-single span {
	font-weight: 600;
}

.hha-bf-help {
	color: var(--hha-muted, #5a675f);
	font-size: 0.8rem;
}

.hha-bf-heading {
	margin-top: 0.8rem;
	padding-top: 0.9rem;
	border-top: 1px solid var(--hha-line, #d7e8e2);
}

.hha-bf-heading:first-child {
	margin-top: 0;
	padding-top: 0;
	border-top: 0;
}

.hha-bf-heading h4 {
	margin: 0 0 0.4rem;
	font-size: 1rem;
	color: var(--hha-green, #075a4d);
}

.hha-bf-content {
	font-size: 0.9rem;
	color: var(--hha-ink, #151b23);
	line-height: 1.55;
}

.hha-bf-content p {
	margin: 0 0 0.6rem;
}

.hha-bf-content ul {
	margin: 0 0 0.6rem;
	padding-left: 1.2rem;
}

.hha-bf-content table {
	width: 100%;
	border-collapse: collapse;
	margin: 0.4rem 0 0.8rem;
	font-size: 0.85rem;
}

.hha-bf-content th,
.hha-bf-content td {
	border: 1px solid var(--hha-line, #d7e8e2);
	padding: 0.45rem 0.6rem;
	text-align: left;
}

.hha-bf-content th {
	background: var(--hha-green-soft, #e1f5f0);
}

.hha-bf-pad {
	width: 100%;
	height: auto;
}

.hha-bf-clear {
	justify-self: start;
}

.hha-bf-error {
	margin: 0;
	color: #b3401a;
	font-size: 0.8rem;
	font-weight: 600;
}

.hha-bf-field.is-invalid input:not([type="checkbox"]):not([type="radio"]),
.hha-bf-field.is-invalid select,
.hha-bf-field.is-invalid textarea,
.hha-bf-field.is-invalid .hha-bf-pad {
	border-color: #c45c26;
}

.hha-bf-downloads {
	margin: 0.8rem 0 0;
}

.hha-bf-resubmit {
	margin-top: 1rem;
}

.hha-bf-resubmit > summary {
	display: inline-block;
	cursor: pointer;
	list-style: none;
}

.hha-bf-resubmit > summary::-webkit-details-marker {
	display: none;
}

.hha-bf-resubmit[open] > summary {
	margin-bottom: 0.8rem;
}

.hha-staff-form .hha-bf-error {
	display: none;
}

.hha-bf-submit {
	margin: 1.2rem 0 0;
}

.hha-builder-form .hha-form-result {
	margin-top: 0.8rem;
}

@media (max-width: 640px) {
	.hha-bf-grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.hha-bf-half {
		grid-column: 1 / -1;
	}
}
