/*
 * Gravity Forms styling — approved "Option A · Quiet & Airy" board.
 *
 * Implemented via the Orbital theme-framework CSS API: overrides of the
 * documented --gf-* custom properties, scoped to the framework wrapper
 * (docs.gravityforms.com/design-overview + /submit-button-css-selectors).
 * The doubled class (.gform-theme.gform-theme--framework) outranks the
 * plugin's own defaults, which are declared on the single class, so this
 * wins regardless of stylesheet order. All values are BHC tokens.
 */
.gform-theme.gform-theme--framework {
	/* Focus/selection color system: brand green ring + darker hover. */
	--gf-color-primary: var(--bhc-color-brand);
	--gf-color-primary-darker: var(--bhc-color-brand-dark);

	/* Controls: white fields, hairline borders, site radius. */
	--gf-ctrl-bg-color: var(--bhc-color-paper);
	--gf-ctrl-border-color: var(--bhc-color-line);
	--gf-ctrl-radius: var(--bhc-radius);
	--gf-ctrl-font-size: 1rem; /* >= 16px so iOS Safari doesn't zoom on focus. */

	/* Labels in heading ink at 600; descriptions muted. */
	--gf-ctrl-label-color-primary: var(--bhc-color-heading);
	--gf-ctrl-label-font-weight-primary: 600;
	--gf-ctrl-desc-color: var(--bhc-color-muted);

	/*
	 * Submit button: the site's md .btn spec (buttons.css / tokens.css) —
	 * 48px box, 22px side padding, text-scale label, sentence case.
	 * The framework sizes buttons from --gf-ctrl-btn-size (min-height),
	 * --gf-ctrl-btn-padding-x/-y and --gf-ctrl-btn-font-size; the per-form
	 * inline block re-points font-size/size/padding-x at the size-tier vars,
	 * so the "md" tier (GF's default) is set alongside each base var.
	 */
	--gf-ctrl-btn-bg-color-primary: var(--bhc-color-accent);
	--gf-ctrl-btn-bg-color-hover-primary: var(--bhc-color-accent-dark);
	--gf-ctrl-btn-color-primary: var(--bhc-color-on-accent);
	--gf-ctrl-btn-radius: var(--bhc-radius);
	--gf-ctrl-btn-size: var(--bhc-btn-h);
	--gf-ctrl-btn-size-md: var(--bhc-btn-h);
	--gf-ctrl-btn-padding-y: 0;
	--gf-ctrl-btn-padding-x: var(--bhc-btn-pad-x);
	--gf-ctrl-btn-padding-x-md: var(--bhc-btn-pad-x);
	--gf-ctrl-btn-font-size: var(--bhc-size-btn);
	--gf-ctrl-btn-font-size-md: var(--bhc-size-btn);
	--gf-ctrl-btn-font-weight: 700;
	--gf-ctrl-btn-line-height: 1.2;
}

/*
 * Single-button footers get a full-width, centered submit. No --gf-*
 * variable controls button width, so this is the one raw-selector rule
 * (built on the docs' submit-button selectors). The :not(:has(...)) guard
 * leaves multi-button footers — multi-page previous/next rows — at their
 * default widths.
 */
.gform-theme.gform-theme--framework .gform_footer:not(:has(.gform_previous_button, .gform_next_button)) button[type="submit"].gform_button,
.gform-theme.gform-theme--framework .gform_page_footer:not(:has(.gform_previous_button, .gform_next_button)) button[type="submit"].gform_button {
	width: 100%;
	justify-content: center;
	text-align: center;
}

/*
 * The required-field legend ('"*" indicates required fields') is visual
 * noise; asterisks on the labels carry the meaning. Hidden per Chris.
 */
.gform-theme--framework .gform_required_legend {
	display: none;
}

/* Tighter vertical rhythm between field rows (default is looser). */
.gform-theme--framework .gform_fields {
	--gf-form-gap-y: 20px;
}

/*
 * Consent-field fine print (the SMS disclaimer box) hidden per Chris —
 * the wrapper is hidden rather than just its inner text so no empty
 * bordered shell remains. The consent text still travels with the
 * submission; this is display only.
 */
.gform-theme--framework .gfield_consent_description {
	display: none;
}

/*
 * ---- Rating scales (form 284: /rating/ + ?rtype=emoji|refer) ----
 *
 * Orbital-native rebuild of the old gravity-theme/Styles-Pro tile scales
 * (gf_list_5col + gfsp_o_* died with the theme switch; Divi grays dropped
 * per Chris). Fields opt in via their cssClass: rating-scale-numeric (1-5),
 * rating-scale-emoji (3 choices), rating-scale-refer (Yes/No).
 *
 * Markup (Orbital): .gchoice > input.gfield-choice-input + label. The radio
 * stays in the accessibility tree; the label is the visible tile. Checked
 * state rides :checked + label; keyboard focus rides :focus-visible + label.
 */

.gform-theme.gform-theme--framework .gfield.rating-scale-numeric .gfield_radio,
.gform-theme.gform-theme--framework .gfield.rating-scale-emoji .gfield_radio,
.gform-theme.gform-theme--framework .gfield.rating-scale-refer .gfield_radio {
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	gap: var(--bhc-space-1);
}

.gform-theme.gform-theme--framework .gfield.rating-scale-numeric .gchoice,
.gform-theme.gform-theme--framework .gfield.rating-scale-emoji .gchoice,
.gform-theme.gform-theme--framework .gfield.rating-scale-refer .gchoice {
	position: relative;
	display: flex;
	max-width: none;
}

.gform-theme.gform-theme--framework .gfield.rating-scale-numeric .gfield-choice-input,
.gform-theme.gform-theme--framework .gfield.rating-scale-emoji .gfield-choice-input,
.gform-theme.gform-theme--framework .gfield.rating-scale-refer .gfield-choice-input {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: 0;
	opacity: 0;
	pointer-events: none;
}

.gform-theme.gform-theme--framework .gfield.rating-scale-numeric .gchoice label,
.gform-theme.gform-theme--framework .gfield.rating-scale-emoji .gchoice label,
.gform-theme.gform-theme--framework .gfield.rating-scale-refer .gchoice label {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: var(--bhc-btn-h);
	margin: 0;
	padding: 0.625rem 1rem;
	border: 1px solid var(--bhc-color-line);
	border-radius: var(--bhc-radius);
	background: var(--bhc-color-paper);
	color: var(--bhc-color-ink);
	font-size: 1rem;
	font-weight: 600;
	text-align: center;
	cursor: pointer;
	transition: border-color 0.12s ease, background 0.12s ease;
}

.gform-theme.gform-theme--framework .gfield.rating-scale-numeric .gchoice label:hover,
.gform-theme.gform-theme--framework .gfield.rating-scale-emoji .gchoice label:hover,
.gform-theme.gform-theme--framework .gfield.rating-scale-refer .gchoice label:hover {
	border-color: var(--bhc-color-brand);
}

.gform-theme.gform-theme--framework .gfield.rating-scale-numeric .gfield-choice-input:checked + label,
.gform-theme.gform-theme--framework .gfield.rating-scale-emoji .gfield-choice-input:checked + label,
.gform-theme.gform-theme--framework .gfield.rating-scale-refer .gfield-choice-input:checked + label {
	border-color: var(--bhc-color-brand-dark);
	background: var(--bhc-color-brand-dark);
	color: var(--bhc-color-on-accent);
}

.gform-theme.gform-theme--framework .gfield.rating-scale-numeric .gfield-choice-input:focus-visible + label,
.gform-theme.gform-theme--framework .gfield.rating-scale-emoji .gfield-choice-input:focus-visible + label,
.gform-theme.gform-theme--framework .gfield.rating-scale-refer .gfield-choice-input:focus-visible + label {
	outline: 2px solid var(--bhc-color-brand);
	outline-offset: 2px;
}

/* Numeric 1-5: five equal squares in a row. */
.gform-theme.gform-theme--framework .gfield.rating-scale-numeric .gchoice {
	flex: 1 1 0;
	min-width: 52px;
	max-width: 88px;
}

/* Emoji: three roomier cards; stack on narrow screens. */
.gform-theme.gform-theme--framework .gfield.rating-scale-emoji .gchoice {
	flex: 1 1 160px;
}

.gform-theme.gform-theme--framework .gfield.rating-scale-emoji .gchoice label {
	padding: 0.875rem 1rem;
	font-size: var(--bhc-size-h4);
	font-weight: 700;
}

/* Refer: two generous Yes/No tiles. */
.gform-theme.gform-theme--framework .gfield.rating-scale-refer .gchoice {
	flex: 1 1 140px;
	max-width: 220px;
}
