/*
 * LiV — /contact/ page dark form skin.
 *
 * Re-skins Fluent Forms output to match the dark embed design.
 * Static chrome (top bar, logo, status line) lives in patterns/contact-form.php.
 * Step headers + identity callout live in Fluent Forms HTML fields in WP Admin
 * so the column layout stays inside FluentForms' own .ff-t-container/.ff-t-cell flow.
 *
 * Tokens are scoped to .liv-contact so the dark palette doesn't leak elsewhere.
 */

/* Page wrapper — black backdrop so the centered .liv-contact card blends
 * seamlessly into the page background instead of sitting on a contrasting
 * band. Also zeros the block-gap top spacing so the form sits flush under
 * the header, matching .liv-main--exploreliv / --news / --build patterns. */
.liv-main--contact {
	background: #000;
	margin-block-start: 0;
}

.liv-contact,
.liv-contact *,
.liv-contact *::before,
.liv-contact *::after {
	box-sizing: border-box;
}

.liv-contact {
	--liv-green: #8BC53F;
	--liv-green-glow: rgba(139, 197, 63, 0.45);
	--liv-black: #000;
	--liv-ink: #0A0A0A;
	--liv-charcoal: #1F1F1F;
	--bg-inset: #0E0E0E;
	--border-hairline: #1B1B1B;
	--border-soft: #2A2A2A;
	--fg-1: #fff;
	--fg-2: #C7C7C7;
	--fg-3: #9A9A9A;
	--fg-4: #6B6B6B;
	--ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);

	background: var(--liv-black);
	color: var(--fg-1);
	font-family: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
	font-size: 15px;
	line-height: 1.55;
	-webkit-font-smoothing: antialiased;
	overflow: hidden;
	border-radius: 14px;
	padding: 0;
	/* Two-value margin-block: top reduced ~65% to sit closer to the header,
	 * bottom preserved so the form still has breathing room above the footer. */
	margin-block: clamp(0.75rem, 1.75vw, 1.5rem) clamp(2rem, 5vw, 4rem);
	/* Constrain to ~75% viewport on desktop, capped on ultra-wide displays.
	 * Narrower-laptop + mobile overrides live in the @media blocks below. */
	width: 75%;
	max-width: 1440px;
	margin-inline: auto;
}

.liv-contact a { color: inherit; }

/* ─── Top bar ─────────────────────────────────────────────── */

.liv-contact__top {
	padding: 24px 40px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	border-bottom: 1px solid var(--border-hairline);
}
.liv-contact__logo {
	height: 30px;
	width: auto;
	display: block;
}
.liv-contact__top-meta {
	display: flex;
	gap: 24px;
}

/* ─── Eyebrow / labels (shared by chrome + HTML fields) ──── */

.liv-contact__eyebrow {
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.24em;
	text-transform: uppercase;
	color: var(--fg-3);
}
.liv-contact__eyebrow--green { color: var(--liv-green); }
.liv-contact__eyebrow--mute  { color: var(--fg-4); }

/* ─── Column heading (rendered inside FluentForms HTML field) ── */

.liv-contact__col-heading {
	display: flex;
	flex-direction: column;
	gap: 4px;
	margin: 0 0 6px;
}
.liv-contact__col-heading h3 {
	margin: 12px 0 4px;
	font-size: 26px;
	font-weight: 700;
	letter-spacing: -0.02em;
	line-height: 1.1;
	color: var(--fg-1);
}
.liv-contact__col-heading--message h3 {
	font-size: 32px;
	letter-spacing: -0.025em;
}
.liv-contact__col-heading p {
	margin: 0;
	font-size: 13px;
	color: var(--fg-3);
	line-height: 1.55;
	max-width: 520px;
}
.liv-contact__col-heading--message p { font-size: 14px; }

/* ─── Identity callout (rendered inside FluentForms HTML field) ── */

.liv-contact__callout {
	margin-top: auto;
	padding-top: 24px;
	border-top: 1px solid var(--border-hairline);
	font-size: 12px;
	color: var(--fg-3);
	line-height: 1.6;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	text-align: right;
	gap: 4px;
}
.liv-contact__callout-phone {
	margin-top: 8px;
	font-size: 14px;
	color: var(--fg-1);
}
.liv-contact__callout-phone a { text-decoration: none; }
.liv-contact__callout-hours { color: var(--fg-4); }
.liv-contact__callout-row {
	margin-top: 6px;
}
.liv-contact__callout-row a {
	color: var(--fg-2);
	text-decoration: none;
	transition: color 140ms var(--ease-out);
}
.liv-contact__callout-row a:hover {
	color: var(--liv-green);
}

/* ============================================================
 * Fluent Forms output → embed visual mapping
 * ============================================================ */

/* The form itself acts as the body+bottom-bar grid. */
.liv-contact .frm-fluent-form {
	display: grid;
	grid-template-columns: 1fr auto;
	grid-template-areas:
		"body body"
		"agree submit";
	min-width: 0;
	margin: 0;
	padding: 0;
	background: transparent;
}

/* Outer container = body, 2-column grid. */
.liv-contact .frm-fluent-form > .ff-t-container {
	grid-area: body;
	display: grid;
	grid-template-columns: 380px 1fr;
	gap: 0;
	margin: 0;
}

/* Each top-level cell is a column with vertical flex flow. */
.liv-contact .frm-fluent-form > .ff-t-container > .ff-t-cell {
	padding: 40px;
	display: flex;
	flex-direction: column;
	gap: 18px;
	min-width: 0;
}
.liv-contact .frm-fluent-form > .ff-t-container > .ff-t-cell:first-child {
	background: var(--liv-ink);
	border-right: 1px solid var(--border-hairline);
}
.liv-contact .frm-fluent-form > .ff-t-container > .ff-t-cell:last-child {
	padding: 40px 48px;
	min-height: 0;
}

/* Nested container — used for the city + state row inside the identity column.
 * Activates when an editor drops a 2-column Container inside the left cell. */
.liv-contact .ff-t-cell .ff-t-container {
	display: grid;
	grid-template-columns: 1.4fr 1fr;
	gap: 12px;
	padding: 0;
	margin: 0;
	background: transparent;
}
.liv-contact .ff-t-cell .ff-t-container > .ff-t-cell {
	padding: 0;
	background: transparent;
	border: 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

/* Field group = label + input wrap. */
.liv-contact .ff-el-group {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin: 0;
}

/* Label. */
.liv-contact .ff-el-input--label {
	margin: 0;
	padding: 0;
}
.liv-contact .ff-el-input--label label {
	display: flex;
	justify-content: space-between;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--fg-3);
	margin: 0;
	line-height: 1;
}
.liv-contact .ff-el-input--label label .ff-el-is-required {
	color: var(--liv-green);
	margin-left: 4px;
}

/* Input wrap — provides positioning for icon ::before. */
.liv-contact .ff-el-input--content {
	position: relative;
	display: flex;
	align-items: center;
}

/* Single-line inputs and selects share the input pill. */
.liv-contact .ff-el-input--content input[type="text"],
.liv-contact .ff-el-input--content input[type="email"],
.liv-contact .ff-el-input--content input[type="tel"],
.liv-contact .ff-el-input--content input[type="url"],
.liv-contact .ff-el-input--content input[type="number"],
.liv-contact .ff-el-input--content select {
	flex: 1;
	width: 100%;
	min-width: 0;
	height: 36px;
	padding: 0 3px;
	background: var(--bg-inset);
	border: 1px solid var(--border-soft);
	border-radius: 6px;
	color: var(--fg-1);
	font: inherit;
	font-size: 14px;
	transition: border-color 140ms var(--ease-out), box-shadow 140ms var(--ease-out);
	appearance: none;
	-webkit-appearance: none;
	outline: 0;
}

.liv-contact .ff-el-input--content input::placeholder {
	color: var(--fg-4);
}

/* Narrow the input boxes in the left column by 20% */
.liv-contact .frm-fluent-form > .ff-t-container > .ff-t-cell:first-child input,
.liv-contact .frm-fluent-form > .ff-t-container > .ff-t-cell:first-child select {
	width: 80%;
}

.liv-contact .ff-el-input--content input:focus,
.liv-contact .ff-el-input--content select:focus {
	border-color: var(--liv-green);
	box-shadow: 0 0 0 3px rgba(139, 197, 63, 0.15);
}

/* Select chevron — matches embed line 172. */
.liv-contact .ff-el-input--content select {
	background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239A9A9A' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
	background-repeat: no-repeat;
	background-position: right 14px center;
	padding-right: 36px;
	cursor: pointer;
}
.liv-contact .ff-el-input--content select option {
	background: var(--liv-ink);
	color: var(--fg-1);
}

/* Input icons keyed off [data-name]. */
.liv-contact .ff-el-group[data-name="your_name"] .ff-el-input--content::before,
.liv-contact .ff-el-group[data-name="email"] .ff-el-input--content::before,
.liv-contact .ff-el-group[data-name="input_text"] .ff-el-input--content::before {
	display: none;
}
.liv-contact .ff-el-group:focus-within .ff-el-input--content::before {
	opacity: 1;
}
.liv-contact .ff-el-group[data-name="your_name"] .ff-el-input--content::before {
	background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239A9A9A' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><path d='M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2'/><circle cx='12' cy='7' r='4'/></svg>");
}
.liv-contact .ff-el-group[data-name="email"] .ff-el-input--content::before {
	background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239A9A9A' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='5' width='18' height='14' rx='1'/><polyline points='3 7 12 13 21 7'/></svg>");
}
.liv-contact .ff-el-group[data-name="input_text"] .ff-el-input--content::before {
	background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239A9A9A' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><path d='M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72c.12.96.32 1.9.6 2.81a2 2 0 0 1-.45 2.11L8 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45c.91.28 1.85.48 2.81.6A2 2 0 0 1 22 16.92z'/></svg>");
}

/* Message textarea = larger canvas, no icon.
 * Field-name-agnostic — any textarea inside the form gets the dark canvas so
 * it can't be broken by renaming the Fluent Forms field. */
.liv-contact .frm-fluent-form textarea,
.liv-contact .frm-fluent-form textarea.ff-el-form-control {
	display: block;
	width: 100%;
	min-height: 220px;
	padding: 10px 3px;
	background: var(--bg-inset) !important;
	border: 1px solid var(--border-soft);
	border-radius: 10px;
	color: var(--fg-1);
	font: inherit;
	font-size: 16px;
	line-height: 1.65;
	resize: vertical;
	transition: border-color 140ms var(--ease-out), box-shadow 140ms var(--ease-out);
	outline: 0;
	box-sizing: border-box;
}
.liv-contact .frm-fluent-form textarea:focus {
	border-color: var(--liv-green);
	box-shadow: 0 0 0 3px rgba(139, 197, 63, 0.15);
}
.liv-contact .frm-fluent-form textarea::placeholder {
	color: var(--fg-4);
}

/* Message group fills the right column vertically so the textarea bottom-aligns
 * with the identity column's callout. Uses :has() to find whichever group
 * contains the textarea, regardless of Fluent Forms field name. */
.liv-contact .frm-fluent-form > .ff-t-container > .ff-t-cell:last-child {
	display: flex;
	flex-direction: column;
}
.liv-contact .frm-fluent-form > .ff-t-container > .ff-t-cell:last-child > .ff-el-group:has(textarea) {
	flex: 1;
	display: flex;
	flex-direction: column;
	min-height: 0;
}
.liv-contact .frm-fluent-form > .ff-t-container > .ff-t-cell:last-child > .ff-el-group:has(textarea) > .ff-el-input--content {
	flex: 1;
	display: flex;
	min-height: 0;
}
.liv-contact .frm-fluent-form > .ff-t-container > .ff-t-cell:last-child > .ff-el-group:has(textarea) textarea {
	flex: 1;
	height: 100%;
	min-height: 220px;
}

/* Agreement checkbox occupies the bottom-bar left slot. */
.liv-contact .frm-fluent-form > .ff-el-group[data-name="gdpr-agreement"] {
	grid-area: agree;
	padding: 24px 40px;
	border-top: 1px solid var(--border-hairline);
	margin: 0;
}
.liv-contact .ff-el-group[data-name="gdpr-agreement"] > .ff-el-input--label {
	display: none;
}
.liv-contact .ff-el-group[data-name="gdpr-agreement"] .ff-el-form-check {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	font-size: 12px;
	color: var(--fg-2);
	line-height: 1.5;
	max-width: 560px;
	padding: 0;
	margin: 0;
}
.liv-contact .ff-el-group[data-name="gdpr-agreement"] input[type="checkbox"] {
	width: 20px;
	height: 20px;
	flex-shrink: 0;
	margin: 0;
	accent-color: var(--liv-green);
	cursor: pointer;
}
.liv-contact .ff-el-group[data-name="gdpr-agreement"] label,
.liv-contact .ff-el-group[data-name="gdpr-agreement"] .ff-el-form-check-label {
	font-size: 12px;
	color: var(--fg-2);
	margin: 0;
	cursor: pointer;
	font-weight: 400;
	letter-spacing: 0;
	text-transform: none;
}
.liv-contact .ff-el-group[data-name="gdpr-agreement"] label a,
.liv-contact .ff-el-group[data-name="gdpr-agreement"] .ff-el-form-check-label a {
	color: var(--fg-1);
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* Submit button group occupies the bottom-bar right slot.
 * Defensive: targets every wrapper Fluent Forms ships across versions, and
 * also catches the case where the submit landed inside a container (no longer
 * a direct child of .frm-fluent-form) by matching any group that contains
 * the submit button. */
.liv-contact .frm-fluent-form > .ff-el-group.ff-el-submit-btn,
.liv-contact .frm-fluent-form > div.ff_submit_btn_wrapper,
.liv-contact .frm-fluent-form .ff-el-group:has(> .ff-btn-submit),
.liv-contact .frm-fluent-form .ff-el-group:has(> button.ff-btn[type="submit"]) {
	grid-area: submit;
	padding: 24px 40px;
	border-top: 1px solid var(--border-hairline);
	margin: 0;
	display: flex;
	justify-content: flex-end;
	align-items: center;
}

/* Submit button visuals — !important across the board because Fluent Forms'
 * own .frm-fluent-form button.ff-btn-submit rule has higher specificity (3
 * classes) than ours (2 classes), and the form admin's "Button Style" panel
 * can inject inline color styles that beat any normal cascade. We force the
 * lime pill regardless. */
.liv-contact .ff-btn-submit,
.liv-contact button.ff-btn[type="submit"] {
	display: inline-flex !important;
	width: auto !important;
	max-width: max-content !important;
	align-items: center !important;
	gap: 14px !important;
	padding: 14px 22px 14px 28px !important;
	background: var(--liv-green) !important;
	background-color: var(--liv-green) !important;
	color: var(--liv-black) !important;
	border: 0 !important;
	border-radius: 999px !important;
	font: inherit;
	font-size: 12px !important;
	font-weight: 700 !important;
	letter-spacing: 0.18em !important;
	text-transform: uppercase !important;
	cursor: pointer !important;
	box-shadow: 0 8px 28px var(--liv-green-glow) !important;
	transition: transform 140ms var(--ease-out), box-shadow 140ms var(--ease-out), background 140ms var(--ease-out);
	white-space: nowrap !important;
	text-decoration: none !important;
	height: auto !important;
}
.liv-contact .ff-btn-submit:hover:not(:disabled),
.liv-contact button.ff-btn[type="submit"]:hover:not(:disabled) {
	transform: translateY(-1px);
	box-shadow: 0 12px 32px var(--liv-green-glow) !important;
	background: var(--liv-green) !important;
	background-color: var(--liv-green) !important;
	color: var(--liv-black) !important;
}
.liv-contact .ff-btn-submit:disabled,
.liv-contact button.ff-btn[type="submit"]:disabled {
	background: var(--liv-charcoal) !important;
	background-color: var(--liv-charcoal) !important;
	color: var(--fg-4) !important;
	box-shadow: none !important;
	cursor: not-allowed !important;
}
.liv-contact .ff-btn-submit::after {
	content: "";
	width: 26px;
	height: 26px;
	border-radius: 50%;
	display: inline-block;
	background-color: var(--liv-black);
	background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238BC53F' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><line x1='5' y1='12' x2='19' y2='12'/><polyline points='12 5 19 12 12 19'/></svg>");
	background-repeat: no-repeat;
	background-position: center;
	flex-shrink: 0;
}
.liv-contact .ff-btn-submit:disabled::after {
	background-color: var(--liv-ink);
	background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236B6B6B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><line x1='5' y1='12' x2='19' y2='12'/><polyline points='12 5 19 12 12 19'/></svg>");
}

/* FluentForms loading spinner overlay tweak — keep the brand color on dark. */
.liv-contact .frm-fluent-form.ff-form-loading::before {
	background: rgba(0, 0, 0, 0.4);
}

/* Success message replaces the form after submit. */
.liv-contact .ff-message-success {
	padding: 80px 48px;
	text-align: center;
	background: var(--liv-black);
	color: var(--fg-1);
	border: 0;
	border-radius: 0;
	font-size: 16px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 16px;
	margin: 0;
}
.liv-contact .ff-message-success::before {
	content: "";
	width: 64px;
	height: 64px;
	border-radius: 50%;
	background-color: rgba(139, 197, 63, 0.12);
	background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 24 24' fill='none' stroke='%238BC53F' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>");
	background-repeat: no-repeat;
	background-position: center;
	border: 1px solid var(--liv-green);
	display: inline-block;
}

/* Inline validation error messages. */
.liv-contact .error.text-danger,
.liv-contact .text-danger {
	color: #ff9a9a;
	font-size: 12px;
	margin-top: 4px;
	letter-spacing: 0;
	text-transform: none;
	font-weight: 500;
}

/* ─── Responsive ─────────────────────────────────────────── */

/* Smaller laptops — bump width up so the form doesn't strangle. */
@media (max-width: 1200px) {
	.liv-contact { width: 92%; }
}

@media (max-width: 880px) {
	.liv-contact { margin-block: clamp(0.5rem, 1.5vw, 0.75rem) clamp(1.25rem, 4vw, 2rem); border-radius: 10px; }

	.liv-contact__top { padding: 20px 24px; }
	.liv-contact__top-meta { display: none; }

	.liv-contact .frm-fluent-form {
		grid-template-columns: 1fr;
		grid-template-areas:
			"body"
			"agree"
			"submit";
	}
	.liv-contact .frm-fluent-form > .ff-t-container {
		grid-template-columns: 1fr;
	}
	.liv-contact .frm-fluent-form > .ff-t-container > .ff-t-cell:first-child {
		border-right: 0;
		border-bottom: 1px solid var(--border-hairline);
	}
	.liv-contact .frm-fluent-form > .ff-t-container > .ff-t-cell {
		padding: 28px 24px;
	}
	.liv-contact .frm-fluent-form > .ff-el-group[data-name="gdpr-agreement"],
	.liv-contact .frm-fluent-form > .ff-el-group.ff-el-submit-btn,
	.liv-contact .frm-fluent-form > div.ff_submit_btn_wrapper {
		padding: 20px 24px;
	}
	.liv-contact .frm-fluent-form > .ff-el-group.ff-el-submit-btn,
	.liv-contact .frm-fluent-form > div.ff_submit_btn_wrapper,
	.liv-contact .frm-fluent-form .ff-el-group:has(> .ff-btn-submit),
	.liv-contact .frm-fluent-form .ff-el-group:has(> button.ff-btn[type="submit"]) {
		justify-content: stretch;
	}
	.liv-contact .ff-btn-submit,
	.liv-contact button.ff-btn[type="submit"] {
		justify-content: space-between;
		width: 100% !important;
		max-width: none;
	}
}
