/* Telliant Forms — modal. Graphic-left / content-right, matching the live design.
   Uses design-system tokens when present, with brand fallbacks. */

.tf-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
	overflow-y: auto; /* scroll the overlay if the dialog is tall */
}
.tf-modal[hidden] { display: none; }

.tf-modal__overlay {
	position: absolute;
	inset: 0;
	background: rgba(8, 20, 38, 0.72);
}

.tf-modal__dialog {
	position: relative;
	display: flex;
	align-items: stretch !important;
	width: 100%;
	max-width: 920px;
	min-height: auto; /* size to content — keeps the short download form compact */
	max-height: calc(100vh - 2rem); /* never taller than the viewport */
	background: #fff;
	border-radius: var(--t-radius-lg, 14px);
	overflow: hidden;
	box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
	animation: tf-pop 0.25s ease;
}

@keyframes tf-pop {
	from { opacity: 0; transform: translateY(12px) scale(0.98); }
	to   { opacity: 1; transform: none; }
}

.tf-modal__media {
	flex: 0 0 45% !important;
	align-self: stretch !important;
	background-size: cover !important;
	background-position: center center !important;
	background-repeat: no-repeat !important;
}

.tf-modal__body {
	flex: 1 1 55%;
	padding: 2.25rem 2.25rem;
	display: flex;
	flex-direction: column;
	justify-content: flex-start; /* top-align so tall forms never clip */
	overflow-y: auto;            /* scroll within the panel if content is tall */
}
/* Short success message looks better centred (it always fits). */
.tf-modal.tf-submitted .tf-modal__body { justify-content: center; }

.tf-modal__title {
	margin: 0 0 0.75rem;
	font-size: clamp(1.5rem, 2.4vw, 1.9rem);
	line-height: 1.2;
	font-weight: 700;
	color: var(--t-navy, #1b2a4a);
}

.tf-modal__subtitle {
	margin: 0 0 1.5rem;
	font-size: 1rem;
	line-height: 1.5;
	color: var(--t-grey-600, #5a6473);
}

.tf-modal__close {
	position: absolute;
	top: 0.9rem;
	right: 1.1rem;
	z-index: 2;
	width: 2rem;
	height: 2rem;
	border: 0;
	background: transparent;
	font-size: 1.9rem;
	line-height: 1;
	color: var(--t-grey-500, #8a93a0);
	cursor: pointer;
}
.tf-modal__close:hover { color: var(--t-navy, #1b2a4a); }

.tf-modal__error {
	margin-top: 0.75rem;
	color: #c5273c;
	font-size: 0.9rem;
}

/* CTA hint mirrors the form's submit label; hidden once the HS button renders. */
.tf-modal__cta-hint { display: none; }

/* Submitted (thank-you) state — drop the contextual heading and centre/polish
   the HubSpot success message. */
.tf-modal.tf-submitted .tf-modal__title,
.tf-modal.tf-submitted .tf-modal__subtitle { display: none !important; }

.tf-form-host .submitted-message {
	font-size: 1.05rem;
	line-height: 1.65;
	color: var(--t-grey-600, #5a6473);
	padding: 0.5rem 0;
}
.tf-form-host .submitted-message > * { margin: 0 0 0.65rem; }
.tf-form-host .submitted-message > *:last-child { margin-bottom: 0; }
.tf-form-host .submitted-message strong,
.tf-form-host .submitted-message b {
	display: block;
	margin-bottom: 0.4rem;
	font-size: 1.3rem;
	line-height: 1.25;
	font-weight: 700;
	color: var(--t-navy, #1b2a4a);
}
.tf-form-host .submitted-message a { color: var(--t-blue, #00a6e0); }

/* ============================================================
   HubSpot form — two-column, compact, responsive.
   HubSpot wraps paired fields in <fieldset class="form-columns-2">
   and full-width fields in "form-columns-1". We lay those out as a
   grid and neutralise HubSpot's float/percentage widths.
   ============================================================ */
.tf-form-host form.hs-form { margin: 0; }
.tf-form-host fieldset { max-width: none !important; width: 100% !important; }

.tf-form-host .form-columns-2 {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0 16px;
}
.tf-form-host .form-columns-1 { display: block; }

/* Neutralise HubSpot's own float + width so the grid controls layout. */
.tf-form-host .hs-form-field {
	width: auto !important;
	float: none !important;
	margin: 0 0 13px !important;
	padding: 0 !important;
}

.tf-form-host .hs-form-field > label {
	display: block;
	margin-bottom: 6px;
	font-size: 0.88rem;
	font-weight: 500;
	color: var(--t-navy, #1b2a4a);
}
.tf-form-host .hs-field-desc { display: none; }
.tf-form-host .hs-form-required { color: #e2401c; margin-left: 2px; }

.tf-form-host .input { margin: 0 !important; }

.tf-form-host .hs-input {
	width: 100% !important;
	box-sizing: border-box;
	padding: 0.65rem 0.85rem;
	border: 1px solid var(--t-grey-300, #d8dde5);
	border-radius: var(--t-radius, 8px);
	font-size: 0.95rem;
	line-height: 1.3;
	background: #fff;
}
.tf-form-host textarea.hs-input { min-height: 80px; resize: vertical; }
.tf-form-host .hs-input:focus {
	outline: none;
	border-color: var(--t-blue, #00a6e0);
	box-shadow: 0 0 0 3px rgba(0, 166, 224, 0.15);
}

/* Validation — per-field messages only; hide HubSpot's global banner. */
.tf-form-host .hs_error_rollup { display: none !important; }
.tf-form-host .hs-error-msgs { list-style: none; margin: 4px 0 0; padding: 0; }
.tf-form-host .hs-error-msg,
.tf-form-host .hs-error-msgs label { color: #e2401c; font-size: 0.78rem; }
.tf-form-host .hs-input.invalid,
.tf-form-host .hs-input.error { border-color: #e2401c; }

/* Collapse dead vertical space: hidden-field wrappers (visitor_browser/IP/geo
   etc.) and empty HubSpot containers/iframes that otherwise stack up before
   the submit button. */
.tf-form-host .hs-richtext:empty,
.tf-form-host .legal-consent-container:empty { display: none !important; }
/* NOTE: never blanket-hide iframes or use :has() to hide fields here — some
   HubSpot forms render inside an iframe and aggressive hiding blanks the whole
   form. Hidden-field spacing is collapsed precisely in JS (collapseHiddenFields). */

/* Submit — full width, ONE consistent brand button across every form.
   !important deliberately overrides HubSpot's per-form button styling so
   "Let's talk!" and "Download Now" etc. look identical.
   Change --tf-btn-bg to re-skin all submit buttons in one place. */
.tf-form-host .hs_submit,
.tf-form-host .hs-submit { margin: 8px 0 0 !important; }
.tf-form-host .hs_submit .actions { margin: 0 !important; padding: 0 !important; }
.tf-form-host .hs-button {
	display: inline-block;
	width: 100%;
	padding: 0.85rem 1.5rem !important;
	border: 0 !important;
	border-radius: var(--t-radius, 8px) !important;
	font-size: 1rem !important;
	font-weight: 700 !important;
	line-height: 1.2 !important;
	text-align: center;
	color: #fff !important;
	background: var(--tf-btn-bg, var(--t-orange, #f7981c)) !important;
	box-shadow: none !important;
	cursor: pointer;
	transition: background 0.2s ease, opacity 0.2s ease;
}
.tf-form-host .hs-button:hover,
.tf-form-host .hs-button:focus {
	background: var(--tf-btn-bg-hover, var(--t-orange-dark, #e0860f)) !important;
	opacity: 1;
}

/* ============================================================
   Responsive — stack the modal AND collapse the form to one
   column together, so fields never get cramped in a narrow card.
   ============================================================ */
@media (max-width: 820px) {
	.tf-modal__dialog { flex-direction: column; min-height: 0; max-width: 460px; }
	.tf-modal__media { flex-basis: 170px; }
	.tf-modal__body { padding: 1.75rem 1.5rem; }
	.tf-form-host .form-columns-2 { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
	.tf-modal { padding: 0.5rem; }
	.tf-modal__title { font-size: 1.3rem; }
	.tf-modal__body { padding: 1.5rem 1.25rem; }
}

/* ============================================================
   Inline placement ([telliant_form] shortcode) — same chrome as the
   modal, embedded in page content (no overlay). Reuses .tf-form-host
   for the HubSpot form styling.
   ============================================================ */
.tf-inline {
	display: flex;
	align-items: stretch;
	width: 100%;
	margin: 1.5rem 0;
	background: #fff;
	border: 1px solid var(--t-grey-200, #e6e9ee);
	border-radius: var(--t-radius-lg, 14px);
	overflow: hidden;
	box-shadow: 0 10px 30px rgba(8, 20, 38, 0.08);
}

.tf-inline__media {
	flex: 0 0 42%;
	background-size: cover;
	background-position: center center;
	background-repeat: no-repeat;
	min-height: 260px;
}

.tf-inline__body {
	flex: 1 1 58%;
	padding: 2rem 2.25rem;
	display: flex;
	flex-direction: column;
	justify-content: center;
}
.tf-inline:not(.tf-inline--has-media) .tf-inline__body { flex-basis: 100%; }

.tf-inline__title {
	margin: 0 0 0.6rem;
	font-size: clamp(1.4rem, 2.2vw, 1.8rem);
	line-height: 1.2;
	font-weight: 700;
	color: var(--t-navy, #1b2a4a);
}
.tf-inline__subtitle {
	margin: 0 0 1.4rem;
	font-size: 1rem;
	line-height: 1.5;
	color: var(--t-grey-600, #5a6473);
}

/* Hide the chrome once the inline form is submitted (success message shows). */
.tf-inline.tf-submitted .tf-inline__title,
.tf-inline.tf-submitted .tf-inline__subtitle { display: none; }

@media (max-width: 820px) {
	.tf-inline { flex-direction: column; }
	.tf-inline__media { flex-basis: 200px; }
	.tf-inline__body { padding: 1.75rem 1.5rem; }
}
