/* ============================================================
   FLUENT FORMS — brand skin for build.jeradhill.com
   Maps Fluent Forms markup onto the design system's form specs.
   Every value references a token from tokens.css — no hard-coded
   colors, sizes, radii, or durations. The only literal colors are
   the white/ink glyphs baked into the check + chevron SVG data-URIs
   (they mirror --white / --ink, which cannot live inside a data-URI).
   Everything is scoped under .fluentform so nothing leaks out.
   ============================================================ */

/* ---- Field group rhythm ---- */
.fluentform .ff-el-group { margin: 0 0 var(--space-5); }
.fluentform .ff-t-container { display: flex; gap: var(--space-5); flex-wrap: wrap; }
.fluentform .ff-t-container > .ff-t-cell { flex: 1 1 220px; }

/* ---- Labels: eyebrow treatment ---- */
.fluentform .ff-el-input--label label,
.fluentform .ff-el-input--label > label {
	display: inline-block;
	margin: 0 0 var(--space-2);
	font-family: var(--font-sans);
	font-size: var(--fs-eyebrow);
	font-weight: var(--fw-bold);
	letter-spacing: var(--ls-eyebrow);
	text-transform: uppercase;
	color: var(--text-primary);
	line-height: 1.3;
}
.fluentform .ff-el-input--label .ff-el-is-required-mark,
.fluentform .ff-el-is-required > label:after { color: var(--danger); }

/* ---- Text inputs / textarea / select: Input `md` spec ---- */
.fluentform .ff-el-form-control {
	width: 100%;
	font-family: var(--font-sans);
	font-size: 15px;
	line-height: 1.4;
	color: var(--text-primary);
	background: var(--white);
	border: var(--border-width) solid var(--border-strong);
	border-radius: var(--radius-sm);
	padding: 11px 14px;
	outline: none;
	box-shadow: none;
	transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
	-webkit-appearance: none;
	appearance: none;
}
.fluentform .ff-el-form-control::placeholder { color: var(--text-muted); opacity: 1; }
.fluentform .ff-el-form-control:focus,
.fluentform .ff-el-form-control:focus-visible {
	border-color: var(--border-ink);
	box-shadow: var(--shadow-ring);
}

/* Textarea */
.fluentform textarea.ff-el-form-control {
	line-height: var(--lh-body);
	min-height: 140px;
	resize: vertical;
}

/* Select — ink chevron (mirrors --ink), appearance removed */
.fluentform select.ff-el-form-control {
	padding-right: 40px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%230b0b0a' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 12px center;
	background-size: 18px 18px;
}

/* ---- Checkboxes & radios ---- */
.fluentform .ff-el-form-check { display: flex; align-items: flex-start; gap: var(--space-3); margin-bottom: var(--space-2); }
.fluentform .ff-el-form-check-input,
.fluentform input[type="checkbox"].ff-el-form-check-input,
.fluentform input[type="radio"].ff-el-form-check-input {
	-webkit-appearance: none;
	appearance: none;
	flex: none;
	width: 18px;
	height: 18px;
	margin: 1px 0 0;
	background: var(--white);
	border: var(--border-width-strong) solid var(--border-ink);
	cursor: pointer;
	transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.fluentform input[type="checkbox"].ff-el-form-check-input { border-radius: var(--radius-xs); }
.fluentform input[type="radio"].ff-el-form-check-input { border-radius: var(--radius-full); }

.fluentform input[type="checkbox"].ff-el-form-check-input:checked {
	background-color: var(--ink);
	border-color: var(--ink);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: center;
}
.fluentform input[type="radio"].ff-el-form-check-input:checked {
	border-width: 5.5px; /* ink inner dot via thick ring */
	border-color: var(--ink);
	background-color: var(--white);
}
.fluentform .ff-el-form-check-input:focus-visible { outline: none; box-shadow: var(--shadow-ring); }

/* Option labels: sentence case, regular — NOT eyebrows */
.fluentform .ff-el-form-check-label,
.fluentform .ff-el-form-check label {
	font-family: var(--font-sans);
	font-size: 15px;
	font-weight: var(--fw-regular);
	letter-spacing: var(--ls-body);
	text-transform: none;
	color: var(--text-primary);
	line-height: var(--lh-body);
	cursor: pointer;
}

/* ---- Submit: primary Button `md` spec ---- */
.fluentform .ff-btn-submit,
.fluentform button.ff-btn-submit,
.fluentform .ff_btn_style {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--space-2);
	font-family: var(--font-sans);
	font-size: 12px;
	font-weight: var(--fw-bold);
	letter-spacing: 0.1em;
	text-transform: uppercase;
	line-height: 1;
	color: var(--action-contrast);
	background: var(--action);
	border: var(--border-width) solid var(--action);
	border-radius: var(--radius-sm);
	padding: 12px 24px;
	cursor: pointer;
	box-shadow: none;
	transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), transform var(--dur-fast) var(--ease);
}
.fluentform .ff-btn-submit:hover:not(:disabled),
.fluentform .ff_btn_style:hover:not(:disabled) {
	background: var(--action-hover);
	border-color: var(--action-hover);
	color: var(--action-contrast);
}
.fluentform .ff-btn-submit:active:not(:disabled) { transform: translateY(1px); }
.fluentform .ff-btn-submit:focus-visible { outline: none; box-shadow: var(--shadow-ring); }
.fluentform .ff-btn-submit:disabled { opacity: 0.4; cursor: not-allowed; }

/* ---- Validation ---- */
.fluentform .ff-el-form-control.error,
.fluentform .ff-el-form-control.has-error,
.fluentform .ff-el-is-error .ff-el-form-control {
	border-color: var(--danger);
}
.fluentform .error.text-danger,
.fluentform .ff-el-form-error,
.fluentform .error-text,
.fluentform .ff-el-is-error .text-danger {
	color: var(--danger);
	font-size: var(--fs-caption);
	margin-top: var(--space-2);
}

/* ---- Success message ---- */
.fluentform .ff-message-success,
.fluentform-success .ff-message-success {
	background: var(--surface-muted);
	border: var(--border-width) solid var(--border);
	border-left: 3px solid var(--success);
	border-radius: var(--radius-sm);
	padding: var(--space-4) var(--space-5);
	color: var(--text-primary);
	font-size: var(--fs-small);
}

/* ---- Help text ---- */
.fluentform .ff-el-help-message {
	font-size: var(--fs-caption);
	color: var(--text-muted);
	margin-top: var(--space-2);
}

/* ---- Section breaks ---- */
.fluentform .ff-el-section-break { margin: var(--space-10) 0 var(--space-6); }
.fluentform .ff-el-section-break-title,
.fluentform .ff-el-section-break h3 {
	font-family: var(--font-display);
	font-size: var(--fs-h5);
	font-weight: var(--fw-black);
	text-transform: uppercase;
	letter-spacing: var(--ls-heading);
	color: var(--text-primary);
	margin: 0 0 var(--space-3);
}
.fluentform .ff-el-section-break hr,
.fluentform hr {
	border: 0;
	border-top: var(--border-width) solid var(--border);
	margin: var(--space-4) 0 0;
}

/* ---- Inverse surface (form inside a black band) ---- */
.surface-inverse .fluentform .ff-el-input--label label,
[data-surface="inverse"] .fluentform .ff-el-input--label label,
.surface-inverse .fluentform .ff-el-form-check-label,
[data-surface="inverse"] .fluentform .ff-el-form-check-label,
.bjh-cta__form.is-on-dark .fluentform .ff-el-input--label label,
.bjh-cta__form.is-on-dark .fluentform .ff-el-form-check-label {
	color: var(--text-inverse);
}
.surface-inverse .fluentform .ff-el-help-message,
[data-surface="inverse"] .fluentform .ff-el-help-message,
.bjh-cta__form.is-on-dark .fluentform .ff-el-help-message {
	color: var(--text-on-inverse-muted);
}

/* ---- Inline waitlist form inside a CTA (hero / band) ---- */
.bjh-cta__form { margin: var(--space-6) 0 var(--space-4); max-width: 460px; }
.bjh-cta--band .bjh-cta__form { margin-inline: 0; }

/* On a dark surface the ink submit button would vanish — flip it to white. */
.bjh-cta__form.is-on-dark .fluentform .ff-btn-submit,
.surface-inverse .fluentform .ff-btn-submit {
	background: var(--white);
	color: var(--ink);
	border-color: var(--white);
}
.bjh-cta__form.is-on-dark .fluentform .ff-btn-submit:hover:not(:disabled),
.surface-inverse .fluentform .ff-btn-submit:hover:not(:disabled) {
	background: var(--neutral-100);
	border-color: var(--neutral-100);
	color: var(--ink);
}
.bjh-cta__form.is-on-dark .fluentform .ff-message-success,
.surface-inverse .fluentform .ff-message-success {
	background: rgba(255, 255, 255, 0.08);
	color: var(--text-inverse);
}

/* ============================================================
   ROBUST OVERRIDES
   Fluent Forms ships its own public stylesheet that can load AFTER
   this file (footer-printed on render) and per-form design settings
   can inject INLINE styles on the submit button. These rules are
   scoped tightly under the theme's .bjh-form wrapper (higher
   specificity than FF's defaults) and use !important only on the
   properties FF actually fights us on: input chrome + the submit
   button. Everything still resolves to tokens.
   ============================================================ */

/* Inputs / textarea / select — square, hairline, white, no FF rounding. */
.bjh-form .fluentform .ff-el-form-control {
	border: var(--border-width) solid var(--border-strong) !important;
	border-radius: var(--radius-sm) !important;
	background-color: var(--white) !important;
	box-shadow: none !important;
	-webkit-appearance: none !important;
	appearance: none !important;
}
.bjh-form .fluentform select.ff-el-form-control { appearance: none !important; }
.bjh-form .fluentform .ff-el-form-control:focus,
.bjh-form .fluentform .ff-el-form-control:focus-visible {
	border-color: var(--border-ink) !important;
	box-shadow: var(--shadow-ring) !important;
}

/* Submit — the design system's primary Button, beating FF's blue button
   and any inline styles from the form's design settings. */
.bjh-form .fluentform .ff-btn-submit,
.bjh-form .fluentform button.ff-btn-submit,
.bjh-form .fluentform .ff_btn_style,
.bjh-form .fluentform .ff-btn.ff-btn-submit {
	background: var(--action) !important;
	background-image: none !important;
	color: var(--action-contrast) !important;
	border: var(--border-width) solid var(--action) !important;
	border-radius: var(--radius-sm) !important;
	padding: 12px 24px !important;
	font-family: var(--font-sans) !important;
	font-size: 12px !important;
	font-weight: var(--fw-bold) !important;
	letter-spacing: 0.1em !important;
	text-transform: uppercase !important;
	line-height: 1 !important;
	box-shadow: none !important;
}
.bjh-form .fluentform .ff-btn-submit:hover:not(:disabled),
.bjh-form .fluentform .ff_btn_style:hover:not(:disabled) {
	background: var(--action-hover) !important;
	border-color: var(--action-hover) !important;
	color: var(--action-contrast) !important;
}
.bjh-form .fluentform .ff-btn-submit:focus-visible { box-shadow: var(--shadow-ring) !important; }

/* On a dark surface, flip the submit to white so it stays visible. */
.bjh-form.is-on-dark .fluentform .ff-btn-submit,
.surface-inverse .bjh-form .fluentform .ff-btn-submit {
	background: var(--white) !important;
	color: var(--ink) !important;
	border-color: var(--white) !important;
}
.bjh-form.is-on-dark .fluentform .ff-btn-submit:hover:not(:disabled),
.surface-inverse .bjh-form .fluentform .ff-btn-submit:hover:not(:disabled) {
	background: var(--neutral-100) !important;
	border-color: var(--neutral-100) !important;
	color: var(--ink) !important;
}
