/*
 * Tripleseat lead forms
 *
 * Restyles any Tripleseat "dynamic lead form" embed to match the contact page
 * form (page-contact.php): small uppercase labels, underline-only fields, a
 * two-column grid and the outlined grey Submit button.
 *
 * The embed script writes its markup into #tripleseat_embed_form and injects
 * its own stylesheet at run time. Everything here is scoped under that id, so
 * it outranks Tripleseat's single-class rules no matter which loads last, and
 * any new form pasted into a page picks it up with no extra setup.
 */

#tripleseat_embed_form {
	--ts-seg-text: #58585B;
	--ts-seg-accent: #D9C2BA;
	--ts-seg-error: #a00;
	max-width: 720px;
	margin: 0 auto;
	font-family: 'brandon-grotesque', sans-serif;
	color: var(--ts-seg-text);
}

/* --- Layout: two columns, like the contact form ---------------------------- */

#tripleseat_embed_form #dynamic_lead_form {
	display: grid;
	grid-template-columns: 1fr 1fr;
	column-gap: 48px;
	row-gap: 36px;
}

/* Heading, intro text and anything that is not a field group span both columns,
   as do fields that need the room: the name pair, multi-selects, text areas,
   the captcha and the submit button. */
#tripleseat_embed_form #dynamic_lead_form > :not(.tripleseat-dlf-field-group),
#tripleseat_embed_form #dynamic_lead_form > .tripleseat-dlf-field-group:has(
	.tripleseat-dlf-name-fields,
	.tripleseat-dlf-multiple-select,
	> textarea,
	.tripleseat-dlf-captcha-container,
	.tripleseat-dlf-submit
) {
	grid-column: 1 / -1;
}

#tripleseat_embed_form .tripleseat-dlf-field-group {
	padding: 0;
	margin: 0;
	min-width: 0;
}

#tripleseat_embed_form .tripleseat-dlf-name-fields {
	gap: 48px;
}

#tripleseat_embed_form .tripleseat-dlf-name-field {
	flex: 1 1 0;
	min-width: 0;
}

@media (max-width: 767px) {
	#tripleseat_embed_form #dynamic_lead_form {
		grid-template-columns: 1fr;
		row-gap: 28px;
	}

	#tripleseat_embed_form .tripleseat-dlf-name-fields {
		flex-direction: column;
		gap: 28px;
	}
}

/* --- Heading and intro ------------------------------------------------------ */

#tripleseat_embed_form .tripleseat-dlf-heading {
	font-family: 'essonnes-display', serif;
	font-size: 40px;
	font-weight: 400;
	line-height: 1.2;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	text-align: center;
	color: var(--ts-seg-text);
	margin: 0;
	padding: 0;
}

#tripleseat_embed_form .tripleseat-dlf-text {
	font-size: 15px;
	line-height: 1.65;
	text-align: center;
	color: var(--ts-seg-text);
	margin: -16px 0 16px;
}

@media (max-width: 767px) {
	#tripleseat_embed_form .tripleseat-dlf-heading {
		font-size: 30px;
	}
}

/* --- Labels ------------------------------------------------------------------ */

#tripleseat_embed_form .tripleseat-dlf-label {
	display: block;
	font-size: 10.5px;
	font-weight: 700;
	line-height: 1.4;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--ts-seg-text);
	margin: 0 0 10px;
}

/* Required fields get an asterisk. The embed marks them only with the
   required attribute (data-required on multi-selects), never in the label, so
   the label is matched by the field that follows it - directly, or inside the
   phone, date, time or budget wrapper. */
#tripleseat_embed_form .tripleseat-dlf-label:has(+ [required])::after,
#tripleseat_embed_form .tripleseat-dlf-label:has(+ [data-required="true"])::after,
#tripleseat_embed_form .tripleseat-dlf-label:has(+ * [required])::after {
	content: ' *';
}

/* --- Fields: underline only --------------------------------------------------- */

#tripleseat_embed_form .tripleseat-dlf-input {
	width: 100%;
	max-width: none;
	min-height: 0;
	border: 0;
	border-bottom: 1px solid var(--ts-seg-text);
	border-radius: 0;
	box-shadow: none;
	padding: 5px 0 6px;
	margin: 0;
	background: transparent;
	font-family: 'brandon-grotesque', sans-serif;
	font-size: 14px;
	line-height: 1.4;
	color: var(--ts-seg-text);
}

#tripleseat_embed_form .tripleseat-dlf-input:focus {
	outline: none;
	box-shadow: none;
	border-color: var(--ts-seg-text);
	border-bottom-color: var(--ts-seg-accent);
}

/* Contact form shows no placeholder text in its fields. */
#tripleseat_embed_form .tripleseat-dlf-input::placeholder {
	color: transparent;
}

#tripleseat_embed_form textarea.tripleseat-dlf-input {
	display: block;
	min-height: 32px;
	height: 32px;
	resize: vertical;
}

#tripleseat_embed_form select.tripleseat-dlf-input {
	-webkit-appearance: none;
	appearance: none;
	padding-right: 20px;
	cursor: pointer;
	background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2358585B'/%3E%3C/svg%3E") no-repeat right 2px center;
}

#tripleseat_embed_form .tripleseat-dlf-date-wrapper {
	max-width: none;
}

/* Phone number and extension share one line. */
#tripleseat_embed_form .tripleseat-dlf-phone-container {
	max-width: none;
	gap: 24px;
}

#tripleseat_embed_form .tripleseat-dlf-phone-container .tripleseat-dlf-phone-ext {
	flex: 0 0 60px;
	width: 60px;
	text-align: left;
}

#tripleseat_embed_form .tripleseat-dlf-phone-container .tripleseat-dlf-phone-ext::placeholder {
	color: #bbb;
}

/* Start / end time: the clock sits inline to the left of the field instead of
   in its own box. */
#tripleseat_embed_form .tripleseat-dlf-time-wrapper {
	display: flex;
	align-items: center;
	border-radius: 0;
	border-bottom: 1px solid var(--ts-seg-text);
}

#tripleseat_embed_form .tripleseat-dlf-time-wrapper:focus-within {
	border-bottom-color: var(--ts-seg-accent);
}

#tripleseat_embed_form .tripleseat-dlf-time-wrapper .tripleseat-dlf-time-icon {
	position: static;
	flex: 0 0 auto;
	width: auto;
	padding: 0 10px 0 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	color: var(--ts-seg-text);
}

#tripleseat_embed_form .tripleseat-dlf-time-wrapper .tripleseat-dlf-time-icon i {
	font-size: 12px;
}

#tripleseat_embed_form .tripleseat-dlf-time-wrapper .tripleseat-dlf-input {
	flex: 1 1 auto;
	max-width: none;
	padding-left: 0;
	border-bottom: 0;
}

/* Budget: the "$" reads as part of the field, not a separate box. */
#tripleseat_embed_form .tripleseat-dlf-input-group {
	max-width: none;
	align-items: center;
	border-bottom: 1px solid var(--ts-seg-text);
}

#tripleseat_embed_form .tripleseat-dlf-input-group:focus-within {
	border-bottom-color: var(--ts-seg-accent);
}

#tripleseat_embed_form .tripleseat-dlf-input-group .tripleseat-dlf-currency-addon {
	padding: 0 6px 0 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	font-size: 14px;
	font-weight: 400;
	color: var(--ts-seg-text);
}

#tripleseat_embed_form .tripleseat-dlf-input-group .tripleseat-dlf-financial {
	border-bottom: 0;
}

/* Multi-select list: laid out like the contact form's venue checkboxes. */
#tripleseat_embed_form .tripleseat-dlf-multiple-select {
	display: grid;
	grid-template-columns: 1fr 1fr;
	column-gap: 48px;
	row-gap: 10px;
	max-height: none;
	overflow: visible;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	background: transparent;
	padding: 6px 0 0;
}

#tripleseat_embed_form .tripleseat-dlf-multiple-option {
	display: flex;
	align-items: center;
	padding: 0;
	border: 0;
	background: transparent;
	font-size: 10.5px;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--ts-seg-text);
}

#tripleseat_embed_form .tripleseat-dlf-multiple-option::before {
	content: '';
	flex-shrink: 0;
	width: 13px;
	height: 13px;
	margin-right: 10px;
	border: 1px solid var(--ts-seg-text);
	box-sizing: border-box;
}

#tripleseat_embed_form .tripleseat-dlf-multiple-option:hover,
#tripleseat_embed_form .tripleseat-dlf-multiple-option.selected,
#tripleseat_embed_form .tripleseat-dlf-multiple-option.selected:hover {
	background: transparent;
	color: var(--ts-seg-text);
	font-weight: 700;
}

#tripleseat_embed_form .tripleseat-dlf-multiple-option.selected::before {
	background-color: var(--ts-seg-accent);
	border-color: var(--ts-seg-accent);
}

#tripleseat_embed_form .tripleseat-dlf-multiple-option:focus {
	outline: none;
	background: transparent;
}

#tripleseat_embed_form .tripleseat-dlf-multiple-option:focus-visible::before {
	outline: 2px solid var(--ts-seg-accent);
	outline-offset: 2px;
}

@media (max-width: 480px) {
	#tripleseat_embed_form .tripleseat-dlf-multiple-select {
		grid-template-columns: 1fr;
	}
}

/* --- Help text and errors ------------------------------------------------------ */

#tripleseat_embed_form .tripleseat-dlf-help-text {
	font-size: 12px;
	font-style: normal;
	letter-spacing: 0.03em;
	color: #888;
	margin-top: 6px;
}

#tripleseat_embed_form .tripleseat-dlf-error {
	font-size: 12px;
	line-height: 1.4;
	letter-spacing: 0.03em;
	color: var(--ts-seg-error);
	margin-top: 6px;
}

#tripleseat_embed_form .tripleseat-dlf-input.error,
#tripleseat_embed_form .tripleseat-dlf-error-border,
#tripleseat_embed_form .tripleseat-dlf-error-field {
	background: transparent;
	border: 0 !important;
	border-bottom: 1px solid var(--ts-seg-error) !important;
	box-shadow: none;
}

/* Banner listing every problem, shown above the fields on a failed submit
   (classes errorExplanation alert alert-danger). The embed's own CSS gives it
   a fixed 450px width and a peach fill. */
#tripleseat_embed_form .errorExplanation {
	width: auto;
	margin: 0;
	padding: 20px 24px;
	background: transparent;
	border: 1px solid var(--ts-seg-error);
	border-radius: 0;
	box-shadow: none;
	font-size: 13px;
	line-height: 1.5;
	letter-spacing: 0.03em;
	color: var(--ts-seg-text);
	text-align: left;
}

#tripleseat_embed_form .errorExplanation h2 {
	font-family: 'brandon-grotesque', sans-serif;
	font-size: 12px;
	font-weight: 700;
	font-style: normal;
	line-height: 1.4;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--ts-seg-error);
	background: none;
	border: 0;
	margin: 0 0 8px;
	padding: 0;
}

#tripleseat_embed_form .errorExplanation h2 i {
	margin-right: 6px;
}

#tripleseat_embed_form .errorExplanation p {
	margin: 0 0 6px;
}

#tripleseat_embed_form .errorExplanation ul {
	margin: 0;
	padding: 0 0 0 18px;
}

#tripleseat_embed_form .errorExplanation li {
	margin: 0 0 4px;
}

/* --- Thank-you message: replaces the form once it submits ---------------------- */

#tripleseat_embed_form div:has(> #tsLeadSuccessMessage) {
	text-align: center;
}

/* --- Submit: outlined grey box, left aligned ------------------------------------ */

#tripleseat_embed_form .tripleseat-dlf-field-group:has(.tripleseat-dlf-submit) {
	align-items: flex-start;
}

#tripleseat_embed_form .tripleseat-dlf-submit {
	font-family: 'brandon-grotesque', sans-serif;
	font-size: 10.5px;
	font-weight: 700;
	line-height: 1.4;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--ts-seg-text);
	background: transparent;
	border: 1px solid var(--ts-seg-text);
	border-radius: 0;
	box-shadow: none;
	padding: 13px 30px;
	width: auto;
	cursor: pointer;
	transition: background-color 0.2s, color 0.2s;
}

#tripleseat_embed_form .tripleseat-dlf-submit:hover,
#tripleseat_embed_form .tripleseat-dlf-submit:focus-visible {
	background-color: var(--ts-seg-text);
	border-color: var(--ts-seg-text);
	color: #fff;
}

#tripleseat_embed_form .tripleseat-dlf-submit:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

/* "Powered by Tripleseat" link the embed code requires. */
#tripleseat_link {
	display: block;
	max-width: 720px;
	margin: 24px auto 0;
	font-size: 11px;
	letter-spacing: 0.05em;
	color: #999;
}

/* --- Tap targets (matches the contact form) --------------------------------------- */

@media (pointer: coarse), only screen and (max-width: 1023px) {
	#tripleseat_embed_form .tripleseat-dlf-input,
	#tripleseat_embed_form .tripleseat-dlf-submit,
	#tripleseat_embed_form .tripleseat-dlf-multiple-option {
		min-height: 44px;
	}

	#tripleseat_embed_form .tripleseat-dlf-time-wrapper .tripleseat-dlf-input,
	#tripleseat_embed_form .tripleseat-dlf-input-group .tripleseat-dlf-financial {
		min-height: 44px;
	}
}

/* iOS zooms into fields under 16px. */
@media (max-width: 480px) {
	#tripleseat_embed_form .tripleseat-dlf-input {
		font-size: 16px;
	}
}
