/* The Body Program Forms
   Fonts, accent colour and button radius come from Avada's Global Options CSS
   variables. Surface colours default to the site's own palette (grey page,
   dark card, slate accent) and can be overridden in Enquiries > Settings. */

.tbp {
	--tbp-accent:         var(--button_gradient_top_color, #5b6e72);
	--tbp-accent-text:    var(--button_accent_color, #ffffff);
	--tbp-font:           var(--body_typography-font-family, inherit);
	--tbp-label-font:     var(--h2_typography-font-family, var(--tbp-font));
	--tbp-label-weight:   var(--h2_typography-font-weight, 800);
	--tbp-radius:         var(--button_border_radius_top_left, 0px);
	--tbp-card-bg:        #393939;
	--tbp-card-radius:    18px;
	--tbp-error:          #e06b5a;

	/* light surface (default for newsletter) */
	--tbp-bg:        transparent;
	--tbp-text:      #1a1a1a;
	--tbp-muted:     #5b5b57;
	--tbp-line:      #1a1a1a;
	--tbp-choice-bg: rgba(0, 0, 0, 0.07);

	font-family: var(--tbp-font);
	color: var(--tbp-text);
	box-sizing: border-box;
	container-type: inline-size;
}
.tbp *, .tbp *::before, .tbp *::after { box-sizing: inherit; }
.tbp [hidden] { display: none !important; }

/* Dark surfaces: on-card and plain dark. Everything white. */
.tbp--dark, .tbp--card {
	--tbp-text:      #ffffff;
	--tbp-muted:     #ffffff;
	--tbp-line:      #ffffff;
	--tbp-choice-bg: rgba(255, 255, 255, 0.10);
}
.tbp--dark, .tbp--card,
.tbp--dark .tbp-label, .tbp--card .tbp-label,
.tbp--dark .tbp-req, .tbp--card .tbp-req,
.tbp--dark .tbp-fineprint, .tbp--card .tbp-fineprint,
.tbp--dark .tbp-choice span, .tbp--card .tbp-choice span,
.tbp--dark .tbp-success__title, .tbp--card .tbp-success__title,
.tbp--dark .tbp-success__text, .tbp--card .tbp-success__text { color: #ffffff !important; }
.tbp--dark .tbp-input, .tbp--card .tbp-input,
.tbp--dark .tbp-input:focus, .tbp--card .tbp-input:focus { color: #ffffff !important; -webkit-text-fill-color: #ffffff !important; caret-color: #ffffff; }
.tbp--dark .tbp-input::placeholder, .tbp--card .tbp-input::placeholder { color: #ffffff !important; -webkit-text-fill-color: #ffffff !important; opacity: 1 !important; }
.tbp--dark .tbp-input::-webkit-input-placeholder, .tbp--card .tbp-input::-webkit-input-placeholder { color: #ffffff !important; -webkit-text-fill-color: #ffffff !important; opacity: 1 !important; }
/* Browser autofill tries to paint a light background and dark text; keep it white on the card */
.tbp--dark .tbp-input:-webkit-autofill, .tbp--card .tbp-input:-webkit-autofill,
.tbp--dark .tbp-input:-webkit-autofill:focus, .tbp--card .tbp-input:-webkit-autofill:focus {
	-webkit-text-fill-color: #ffffff !important;
	-webkit-box-shadow: 0 0 0 1000px var(--tbp-bg, #393939) inset !important;
	transition: background-color 9999s ease-in-out 0s;
}
.tbp--dark .tbp-choice input:checked + span, .tbp--card .tbp-choice input:checked + span { color: var(--tbp-accent-text) !important; }
.tbp--card {
	--tbp-bg: var(--tbp-card-bg);
}

/* ---------- Enquiry ---------- */
.tbp-enquiry {
	background: var(--tbp-bg);
	width: 100%;
	margin: 0;
}
.tbp-enquiry.tbp--card {
	padding: clamp(28px, 6cqi, 56px);
	border-radius: var(--tbp-card-radius);
}
.tbp-enquiry.tbp--light, .tbp-enquiry.tbp--dark { padding: 0; }

.tbp-form { margin: 0; }
.tbp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 32px; }
.tbp-grid .tbp-field[data-field="name"] { grid-column: 1 / -1; }
/* Collapses to one column whenever the form itself is narrow (half columns, mobile) */
@container (max-width: 560px) { .tbp-grid { grid-template-columns: 1fr; } }
@supports not (container-type: inline-size) {
	@media (max-width: 900px) { .tbp-grid { grid-template-columns: 1fr; } }
}

.tbp-field { margin: 0 0 28px; padding: 0; border: 0; min-width: 0; }
.tbp-label {
	display: block;
	font-family: var(--tbp-label-font);
	font-weight: var(--tbp-label-weight);
	font-size: 15px;
	line-height: 1.3;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: var(--tbp-text);
	margin: 0 0 8px;
	padding: 0;
}
.tbp-req { color: var(--tbp-text); }

/* Underlined inputs. !important beats Avada's global input styling. */
.tbp .tbp-input {
	display: block;
	width: 100% !important;
	height: auto !important;
	min-height: 0 !important;
	font-family: var(--tbp-font) !important;
	font-size: 17px !important;
	line-height: 1.4 !important;
	color: var(--tbp-text) !important;
	background: transparent !important;
	border: 0 !important;
	border-bottom: 2px solid var(--tbp-line) !important;
	border-radius: 0 !important;
	padding: 10px 0 !important;
	margin: 0 !important;
	outline: none !important;
	box-shadow: none !important;
	transition: border-color .18s ease, opacity .18s ease;
	-webkit-appearance: none;
	appearance: none;
}
.tbp .tbp-input::placeholder { color: var(--tbp-muted); opacity: 1; }
.tbp .tbp-input:focus { border-bottom-color: var(--tbp-accent) !important; }
.tbp--dark .tbp-input:focus, .tbp--card .tbp-input:focus { opacity: .85; }
.tbp .tbp-textarea { resize: vertical; min-height: 110px !important; }
.tbp .tbp-field.is-invalid .tbp-input { border-bottom-color: var(--tbp-error) !important; }

/* Choice pills (radios underneath) */
.tbp-choices { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.tbp-choice { position: relative; cursor: pointer; margin: 0; display: inline-block; }
.tbp-choice input { position: absolute !important; opacity: 0 !important; width: 1px !important; height: 1px !important; pointer-events: none; margin: 0 !important; }
.tbp-choice span {
	display: inline-block;
	font-size: 15px;
	line-height: 1.25;
	padding: 12px 18px;
	border-radius: 999px;
	background: var(--tbp-choice-bg);
	border: 2px solid transparent;
	color: var(--tbp-text);
	transition: border-color .15s ease, background .15s ease, color .15s ease;
	user-select: none;
}
.tbp-choice:hover span { border-color: var(--tbp-line); }
.tbp-choice input:focus-visible + span { outline: 2px solid var(--tbp-accent); outline-offset: 2px; }
.tbp-choice input:checked + span {
	background: var(--tbp-accent);
	border-color: var(--tbp-accent);
	color: var(--tbp-accent-text);
}
.tbp-field.is-invalid .tbp-choice span { border-color: var(--tbp-error); }

/* Errors */
.tbp-error, .tbp-form-error {
	display: none;
	font-size: 13px;
	line-height: 1.4;
	color: var(--tbp-error);
	margin: 8px 0 0;
}
.tbp-field.is-invalid .tbp-error, .tbp-form-error.is-visible { display: block; }
.tbp-form-error { margin-top: 16px; }

/* Button: full width, matches the site's existing button */
.tbp-actions { margin-top: 6px; }
.tbp .tbp-button {
	position: relative;
	display: flex;
	width: 100%;
	align-items: center;
	justify-content: center;
	font-family: var(--button_typography-font-family, var(--tbp-label-font)) !important;
	font-size: 16px !important;
	font-weight: 800;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--tbp-accent-text) !important;
	background: var(--tbp-accent) !important;
	background-image: none !important;
	border: 0 !important;
	border-radius: var(--tbp-radius) !important;
	padding: 22px 32px !important;
	line-height: 1 !important;
	cursor: pointer;
	box-shadow: none !important;
	transition: filter .15s ease, transform .12s ease;
}
.tbp .tbp-button:hover { filter: brightness(1.1); }
.tbp .tbp-button:active { transform: translateY(1px); }
.tbp .tbp-button:focus-visible { outline: 2px solid var(--tbp-text); outline-offset: 3px; }
.tbp .tbp-button[disabled] { cursor: progress; }
.tbp-button__busy {
	display: none;
	position: absolute;
	width: 18px; height: 18px;
	border: 2px solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	animation: tbp-spin .7s linear infinite;
}
.tbp-button.is-busy .tbp-button__label { visibility: hidden; }
.tbp-button.is-busy .tbp-button__busy { display: block; }
@keyframes tbp-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
	.tbp-button__busy { animation: none; border-right-color: currentColor; opacity: .6; }
	.tbp .tbp-button, .tbp-choice span, .tbp .tbp-input { transition: none; }
}

.tbp .tbp-fineprint { font-size: 13px; color: var(--tbp-muted); margin: 20px 0 0 !important; line-height: 1.4; }

/* Success state: a solid panel in the accent colour, same footprint as the form */
.tbp .tbp-success {
	background: var(--tbp-accent);
	color: var(--tbp-accent-text);
	border-radius: var(--tbp-radius);
	padding: 32px 36px;
}
.tbp .tbp-success__title {
	font-family: var(--tbp-label-font);
	font-weight: var(--tbp-label-weight);
	font-size: 26px;
	line-height: 1.1;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	margin: 0 0 8px;
	color: var(--tbp-accent-text) !important;
	-webkit-text-fill-color: var(--tbp-accent-text) !important;
}
.tbp .tbp-success__text {
	font-size: 17px;
	line-height: 1.5;
	margin: 0;
	color: var(--tbp-accent-text) !important;
	-webkit-text-fill-color: var(--tbp-accent-text) !important;
}
.tbp .tbp-success--compact {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 4px 18px;
	padding: 24px 28px;
}
.tbp .tbp-success--compact .tbp-success__title { font-size: 20px; margin: 0; }
.tbp .tbp-success--compact .tbp-success__text { font-size: 16px; }

/* ---------- Newsletter: one solid bar, button flush at the end ---------- */
.tbp-newsletter { background: var(--tbp-bg); }
.tbp-newsletter--band { padding: 8px 0; }
.tbp-newsletter--inline { padding: 0; }
.tbp-newsletter__inner { width: 100%; }
.tbp-newsletter__fields {
	display: flex;
	align-items: stretch;
	border: 2px solid var(--tbp-line);
	border-radius: var(--tbp-radius);
	overflow: hidden;
	background: transparent;
}
.tbp-newsletter__bar { display: flex; flex: 1 1 auto; min-width: 0; }
.tbp-newsletter__bar .tbp-field { flex: 1 1 0; min-width: 0; margin: 0; display: flex; }
.tbp-newsletter__bar .tbp-field + .tbp-field { border-left: 2px solid var(--tbp-line); }
.tbp-newsletter__bar .tbp-input {
	border-bottom: 0 !important;
	padding: 20px 22px !important;
	font-size: 16px !important;
}
.tbp-newsletter__bar .tbp-input:focus { background: rgba(0, 0, 0, 0.04) !important; }
.tbp--dark .tbp-newsletter__bar .tbp-input:focus { background: rgba(255, 255, 255, 0.08) !important; }
.tbp-newsletter__fields .tbp-button {
	flex: 0 0 auto;
	width: auto;
	border-radius: 0 !important;
	padding: 0 32px !important;
	margin: -2px -2px -2px 0 !important;
}
.tbp-newsletter .tbp-error { margin-top: 10px; }
@container (max-width: 640px) {
	.tbp-newsletter__fields { flex-direction: column; }
	.tbp-newsletter__bar { flex-direction: column; }
	.tbp-newsletter__bar .tbp-field + .tbp-field { border-left: 0; border-top: 2px solid var(--tbp-line); }
	.tbp-newsletter__fields .tbp-button { width: auto; padding: 20px 32px !important; margin: 0 -2px -2px !important; }
}
@supports not (container-type: inline-size) {
	@media (max-width: 700px) {
		.tbp-newsletter__fields, .tbp-newsletter__bar { flex-direction: column; }
		.tbp-newsletter__bar .tbp-field + .tbp-field { border-left: 0; border-top: 2px solid var(--tbp-line); }
	}
}

/* Utilities */
.tbp-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.tbp-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
