/**
 * Gravity Forms → General Engineering design system. Loaded only when Gravity Forms is active.
 * Checked against Gravity Forms 3.2.2 (Orbital theme, markup version 2).
 *
 * Colours, input radius and label/description sizes are set through the `gform_default_styles`
 * filter in inc/forms.php: GF prints them as CSS variables on #gform_wrapper_{id}, which outrank
 * this file. The Orbital variables below cover what that filter can't (fonts, sizes, button type).
 * Selectors that restyle GF markup start with .gform-theme--framework so they beat GF's own rules.
 *
 * Forms come from scripts/build-forms.php: quote form class `ge-quote-form`, contact `ge-contact-form`.
 * Target markup + states: design system components FormField, ServicePicker, FileDropzone, QuoteForm.
 */

.gform-theme--orbital {
	--gf-color-danger: var(--danger); /* not covered by gform_default_styles: error borders, messages, required asterisk */
	--gf-ctrl-border-width: 1.5px;
	--gf-ctrl-size-md: 48px;
	--gf-ctrl-font-family: var(--font-body);
	--gf-ctrl-font-size: 17px;
	--gf-ctrl-label-font-family-primary: var(--font-condensed);
	--gf-ctrl-label-font-weight-primary: 600;
	--gf-ctrl-btn-font-family: var(--font-condensed);
	--gf-ctrl-btn-font-size: 19px;
	--gf-ctrl-btn-font-weight: 600;
	--gf-ctrl-btn-text-transform: uppercase;
	--gf-ctrl-btn-letter-spacing: 0.5px;
	--gf-form-gap-y: var(--space-5);
}

/* Section headings ("1 Service", "2 Project details", "3 Your information"): GF Section fields */
.ge-quote-form .gsection { counter-increment: ge-sec; border: 0; border-top: 1px solid var(--rule); padding-top: var(--space-6); }
.ge-quote-form .gsection:first-child { border-top: 0; padding-top: 0; }
.ge-quote-form .gsection_title { display: flex; align-items: center; gap: var(--space-3); font-family: var(--font-condensed); font-style: normal; font-weight: 700; font-size: 24px; text-transform: uppercase; }
.ge-quote-form .gsection_title::before { content: counter(ge-sec); display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--brand-blue); color: var(--white); font-size: 18px; }

/* Service picker: Radio field with the CSS class "ge-service-picker". Target `.gchoice > .gform-field-label`:
   the fieldset's <legend> carries .gform-field-label too. The invisible radio covers the whole
   tile, so the tile is the click target; arrow keys move between options as with any radio group. */
.gform-theme--framework .gfield.ge-service-picker .gfield_radio { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: var(--space-3); }
.gform-theme--framework .gfield.ge-service-picker .gchoice { position: relative; display: block; }
.gform-theme--framework .gfield.ge-service-picker .gfield-choice-input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.gform-theme--framework .gfield.ge-service-picker .gchoice > .gform-field-label { display: grid; justify-items: start; align-content: start; gap: var(--space-2); box-sizing: border-box; height: 100%; min-height: 96px; margin: 0; padding: var(--space-4) var(--space-7) var(--space-4) var(--space-4); border: 1.5px solid var(--control-border); border-radius: var(--radius-md); background: var(--surface); font-family: var(--font-condensed); font-weight: 700; font-size: 18px; line-height: 1.1; text-transform: uppercase; color: var(--text); cursor: pointer; }
.gform-theme--framework .gfield.ge-service-picker .gchoice > .gform-field-label::before { content: ""; width: 32px; height: 32px; background: var(--text-accent); -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat; }
.gform-theme--framework .gfield.ge-service-picker [value="cylinder"] + .gform-field-label { --i: url(../icons/ruler.svg); }
.gform-theme--framework .gfield.ge-service-picker [value="repair"] + .gform-field-label { --i: url(../icons/wrench.svg); }
.gform-theme--framework .gfield.ge-service-picker [value="cnc"] + .gform-field-label { --i: url(../icons/gauge.svg); }
.gform-theme--framework .gfield.ge-service-picker [value="fabrication"] + .gform-field-label { --i: url(../icons/flame.svg); }
.gform-theme--framework .gfield.ge-service-picker [value="engineering"] + .gform-field-label { --i: url(../icons/cog.svg); }
.gform-theme--framework .gfield.ge-service-picker .gchoice:hover .gform-field-label { border-color: var(--text-accent); }
.gform-theme--framework .gfield.ge-service-picker .gfield-choice-input:checked + .gform-field-label { border: 2px solid var(--brand-blue); box-shadow: inset 0 0 0 1px var(--brand-blue); background: var(--surface-alt); }
.gform-theme--framework .gfield.ge-service-picker .gfield-choice-input:focus-visible + .gform-field-label { outline: 3px solid var(--focus); outline-offset: 2px; }
/* Selected badge: blue disc (on the tile) with a white check (on the label), so the state isn't colour alone. */
.gform-theme--framework .gfield.ge-service-picker .gchoice:has(.gfield-choice-input:checked)::after,
.gform-theme--framework .gfield.ge-service-picker .gfield-choice-input:checked + .gform-field-label::after { content: ""; position: absolute; z-index: 1; top: 10px; right: 10px; width: 24px; height: 24px; border-radius: 50%; background: var(--brand-blue); pointer-events: none; }
.gform-theme--framework .gfield.ge-service-picker .gfield-choice-input:checked + .gform-field-label::after { z-index: 2; background: var(--on-accent); border-radius: 0; transform: scale(0.62); -webkit-mask: url(../icons/check.svg) center / contain no-repeat; mask: url(../icons/check.svg) center / contain no-repeat; }

/* Multi-file upload → dropzone */
.gform-theme--framework .ge-quote-form .gform_drop_area { display: grid; justify-items: center; gap: var(--space-2); padding: var(--space-6) var(--space-5); border: 2px dashed var(--control-border); border-radius: var(--radius-md); background: var(--surface-alt); }
.gform-theme--framework .ge-quote-form .gform_drop_instructions { font-family: var(--font-condensed); font-weight: 700; font-size: 20px; text-transform: uppercase; }
.gform-theme--framework .ge-quote-form .ginput_preview { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: var(--space-3); padding: 10px var(--space-4); border: 1px solid var(--rule); border-radius: var(--radius-md); margin-top: var(--space-2); }

/* Submit buttons share the theme's parallelogram-to-rectangle button (ge.css, Buttons). Red is reserved for
   Request a Quote, so only the quote form's submit stays red; every other form's submit is brand blue with the
   navy hover of the Blue button style. :where() keeps these below ge.css's hover rule, which swaps in the hover fill. */
.gform-theme.gform-theme--framework.gform_wrapper form button:is(.gform-button, .gform_button)[type="submit"] { --ge-btn-rest: var(--brand-blue); --ge-btn-fill-hover: var(--navy-800); }
.gform-theme.gform-theme--framework.gform_wrapper form:where(.ge-quote-form) button:is(.gform-button, .gform_button)[type="submit"] { --ge-btn-rest: var(--brand-red); --ge-btn-fill-hover: var(--brand-red-hover); }

/* Errors (FormField): a 2px danger border plus a message with the alert icon, never colour alone.
   GF already sets aria-invalid/aria-describedby and a linked error summary that takes focus. */
.gform-theme--framework .gfield_error { --gf-ctrl-border-width: 2px; }
.gform-theme--framework .gfield_validation_message, .gform-theme--framework .validation_message { display: flex; align-items: flex-start; gap: var(--space-2); color: var(--danger); font-weight: 600; font-size: 14px; }
.gform-theme--framework .gfield_validation_message::before, .gform-theme--framework .validation_message::before { content: ""; flex: none; width: 16px; height: 16px; margin-top: 2px; background: currentColor; -webkit-mask: url(../icons/circle-alert.svg) center / contain no-repeat; mask: url(../icons/circle-alert.svg) center / contain no-repeat; }

/* Per-service "What to include" note (HTML fields shown by the chosen service): steel panel with a brand-blue rule */
.ge-form-guide { padding: var(--space-4) var(--space-5); border-left: 4px solid var(--brand-blue); background: var(--surface-alt); }
.ge-form-guide p { margin: 0; font-size: 15px; line-height: 1.5; color: var(--text); }
.ge-form-guide .ge-form-guide__title { margin-bottom: var(--space-1); font-family: var(--font-condensed); font-weight: 700; font-size: 17px; letter-spacing: .3px; text-transform: uppercase; }

/* Confidentiality note beside the inline submit button */
.gform-theme--framework .ge-quote-form .gfield--type-html { align-self: center; }
.ge-form-note { margin: 0; font-size: 15px; line-height: 1.4; color: var(--text-muted); }

/* Inline confirmation (replaces the form after an AJAX submit): success icon plus words */
.ge-form-confirmation { display: grid; gap: var(--space-3); padding: var(--space-5); border-left: 4px solid var(--success); background: var(--surface-alt); }
.ge-form-confirmation p { margin: 0; }
.ge-form-confirmation__title { display: flex; align-items: center; gap: var(--space-2); font-family: var(--font-condensed); font-weight: 700; font-size: 24px; line-height: 1.1; text-transform: uppercase; color: var(--success); }
.ge-form-confirmation__title::before { content: ""; flex: none; width: 24px; height: 24px; background: currentColor; -webkit-mask: url(../icons/check.svg) center / contain no-repeat; mask: url(../icons/check.svg) center / contain no-repeat; }
