/* William T Healthcare brand colours, pulled from williamthealthcare.co.uk theme CSS */
.wt-af-form {
	--wt-primary: #0a6e0b;
	--wt-primary-dark: #085708;
	--wt-secondary: #d26e4b;
	--wt-text: #333333;
	--wt-border: #d8dcd8;
	--wt-bg-alt: #f6f8f6;
	--wt-error: #b20000;

	max-width: 960px;
	margin: 0 auto;
	padding: 1.5rem;
	font-family: Lato, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	color: var(--wt-text);
	line-height: 1.5;
	box-sizing: border-box;
}
.wt-af-form *, .wt-af-form *::before, .wt-af-form *::after {
	box-sizing: inherit;
}

.wt-af-header h1 {
	color: var(--wt-primary);
	font-size: 1.8rem;
	margin: 0 0 0.25rem;
}
.wt-af-subtitle {
	font-weight: 700;
	margin: 0 0 0.5rem;
}
.wt-af-note {
	font-size: 0.9rem;
	color: #555;
}
.wt-af-sublabel {
	font-weight: 700;
	margin: 1rem 0 0.5rem;
	color: var(--wt-primary-dark);
}

.wt-af-hp {
	/* Visually hidden without moving far off-canvas: a large negative
	   offset (the old "left:-9999px" trick) makes some browsers' print/PDF
	   engines try to allocate page canvas reaching toward that position,
	   producing dozens of blank pages in the downloaded PDF. Clipping to
	   zero size in place avoids that while still hiding it from sighted users. */
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.wt-af-section {
	border: 1px solid var(--wt-border);
	border-radius: 8px;
	padding: 1.25rem 1.5rem 1.5rem;
	margin: 0 0 1.5rem;
	background: #fff;
}
.wt-af-section legend {
	font-weight: 700;
	color: #fff;
	background: var(--wt-primary);
	padding: 0.35rem 0.9rem;
	border-radius: 6px;
	font-size: 1rem;
}

.wt-af-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 0.9rem 1.5rem;
}
@media (max-width: 640px) {
	.wt-af-grid {
		grid-template-columns: 1fr;
	}
}

.wt-af-field {
	display: flex;
	flex-direction: column;
	gap: 0.3rem;
}
.wt-af-field label,
.wt-af-yesno-label {
	font-size: 0.92rem;
	font-weight: 600;
}
.wt-af-req {
	color: var(--wt-error);
}

.wt-af-form input[type="text"],
.wt-af-form input[type="email"],
.wt-af-form input[type="tel"],
.wt-af-form input[type="date"],
.wt-af-form input[type="time"],
.wt-af-form input[type="number"],
.wt-af-form textarea {
	width: 100%;
	padding: 0.5rem 0.6rem;
	border: 1px solid var(--wt-border);
	border-radius: 5px;
	font-family: inherit;
	font-size: 0.95rem;
	background: #fff;
}
.wt-af-form input:focus,
.wt-af-form textarea:focus {
	outline: 2px solid var(--wt-secondary);
	outline-offset: 1px;
}

.wt-af-yesno-row {
	flex-direction: row;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	flex-wrap: wrap;
	padding: 0.5rem 0;
	border-bottom: 1px dashed var(--wt-border);
}
.wt-af-yesno-row:last-child {
	border-bottom: none;
}
.wt-af-yesno-options {
	display: flex;
	gap: 1rem;
	flex-shrink: 0;
}
.wt-af-radio {
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
	font-weight: 400;
	white-space: nowrap;
}

.wt-af-checkbox-list {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1.5rem;
	margin: 0.5rem 0 1rem;
}
.wt-af-checkbox-list-inline {
	margin: 0;
}
.wt-af-checkbox {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	font-size: 0.92rem;
}
.wt-af-checkbox-other {
	align-items: center;
}
.wt-af-inline-text {
	border: 1px solid var(--wt-border);
	border-radius: 4px;
	padding: 0.2rem 0.4rem;
	font-family: inherit;
}

.wt-af-declaration-list .wt-af-checkbox {
	display: flex;
	align-items: flex-start;
	gap: 0.5rem;
	margin-bottom: 0.6rem;
	font-size: 0.92rem;
}
.wt-af-declaration-list input[type="checkbox"] {
	margin-top: 0.2rem;
}
.wt-af-gdpr {
	background: var(--wt-bg-alt);
	border: 1px solid var(--wt-border);
	border-radius: 6px;
	padding: 0.8rem 1rem;
	margin: 0.5rem 0 1.25rem;
}
.wt-af-gdpr .wt-af-checkbox {
	display: flex;
	align-items: flex-start;
	gap: 0.5rem;
	font-size: 0.92rem;
}

.wt-af-table-wrap {
	overflow-x: auto;
	margin-bottom: 0.75rem;
}
.wt-af-table {
	border-collapse: collapse;
	width: 100%;
	min-width: 720px;
}
.wt-af-table th,
.wt-af-table td {
	border: 1px solid var(--wt-border);
	padding: 0.4rem;
	text-align: left;
	vertical-align: middle;
}
.wt-af-table th {
	background: var(--wt-bg-alt);
	font-size: 0.85rem;
	color: var(--wt-primary-dark);
}
.wt-af-table input {
	min-width: 90px;
}
.wt-af-rating-table th:not(:first-child) {
	text-align: center;
	font-size: 0.78rem;
	width: 9%;
}
.wt-af-rating-cell {
	text-align: center;
}
.wt-af-radio-cell {
	display: inline-flex;
	margin-right: 0.5rem;
	font-size: 0.85rem;
}

.wt-af-actions {
	text-align: center;
	padding: 1rem 0 0;
}
.wt-af-btn {
	font-family: inherit;
	font-size: 1rem;
	font-weight: 700;
	padding: 0.75rem 1.75rem;
	border-radius: 6px;
	border: 2px solid transparent;
	cursor: pointer;
	margin: 0 0.5rem 0.75rem;
}
.wt-af-btn-primary {
	background: var(--wt-primary);
	color: #fff;
}
.wt-af-btn-primary:hover {
	background: var(--wt-primary-dark);
}
.wt-af-btn-secondary {
	background: #fff;
	color: var(--wt-primary);
	border-color: var(--wt-primary);
}
.wt-af-btn-secondary:hover {
	background: var(--wt-bg-alt);
}
.wt-af-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}
.wt-af-message {
	min-height: 1.4em;
	font-weight: 700;
	margin-bottom: 0.75rem;
}
.wt-af-message.wt-af-success {
	color: var(--wt-primary-dark);
}
.wt-af-message.wt-af-error {
	color: var(--wt-error);
}

/* Print / "Download PDF copy" styles: browser print-to-PDF renders this, so
   controls and decoration are hidden and inputs show their filled values plainly. */
@media print {
	/* Most sections contain wide 6-8 column tables (address/employment history,
	   competency ratings, availability, references) that get their right-hand
	   columns cut off at the page edge in portrait. Landscape gives them the
	   room they need. */
	@page {
		size: A4 landscape;
		margin: 12mm 10mm;
	}
	.wt-af-hp,
	.wt-af-actions button,
	#wt-af-message:empty {
		display: none !important;
	}
	.wt-af-form {
		max-width: 100%;
		padding: 0;
	}
	.wt-af-section {
		border: 1px solid #999;
	}
	.wt-af-section legend {
		background: #fff !important;
		color: #000 !important;
		border: 1px solid #999;
		-webkit-print-color-adjust: exact;
		print-color-adjust: exact;
		break-after: avoid;
		page-break-after: avoid;
	}
	.wt-af-form input,
	.wt-af-form textarea {
		border: 1px solid #999;
		background: #fff !important;
	}
	.wt-af-table-wrap {
		overflow: visible;
	}
	/* Fit tables to the printed page width instead of overflowing off the
	   right edge - min-width (set for on-screen horizontal scrolling) and
	   input min-width both need to give way here. */
	.wt-af-table {
		min-width: 0;
		width: 100%;
		table-layout: fixed;
		font-size: 0.78rem;
	}
	.wt-af-table th,
	.wt-af-table td {
		padding: 0.3rem;
		overflow-wrap: break-word;
	}
	.wt-af-table input {
		min-width: 0;
		width: 100%;
		font-size: 0.78rem;
		padding: 0.25rem 0.35rem;
	}
	/* Keep short rows/rows of a table intact across a page break, but never
	   force a whole (often page-plus-sized) section onto one page - that is
	   what leaves large blank gaps at the bottom of the previous page. */
	.wt-af-table tr,
	.wt-af-yesno-row,
	.wt-af-field {
		break-inside: avoid;
		page-break-inside: avoid;
	}
}
