/* WP Consultant Toolkit — Gravity Form widget. Based on .form-group / .btn-primary in outputs/style.css.
 * Only the form itself; a heading or card around it is built in Elementor.
 *
 * The form itself is styled through the Gravity Forms CSS API (the --gf-*
 * custom properties of the Orbital theme), so hover, focus, error and
 * disabled states keep working for every field type. Gravity Forms defines
 * those properties on .gform_wrapper itself (partly inline, with an ID
 * selector), so they are re-declared one level deeper, on its children:
 * the form inherits from there. Derived properties are re-declared too,
 * because a var() is resolved where it is declared.
 *
 * The widget's Elementor controls only set --wpct-gf-* properties on the
 * widget; the defaults below follow the design.
 */

/* Fill the container, also when it centers its items. Zero specificity, so a
   width set in Elementor (Advanced > Layout) still wins. */
:where(.elementor-widget-wpct-gravity-form) {
	width: 100%;
}

.wpct-gform-notice {
	padding: 24px;
	border: 1px dashed #dce4eb;
	border-radius: 16px;
	color: #52657b;
	text-align: center;
}

/* The form: Gravity Forms CSS API. */
.wpct-gform .gform_wrapper.gform-theme > * {
	/* Spacing */
	--gf-form-gap-x: var(--wpct-gf-gap-x, 18px);
	--gf-form-gap-y: var(--wpct-gf-gap-y, 20px);
	--gf-label-space-primary: var(--wpct-gf-label-space, 7px);
	--gf-form-footer-margin-y-start: var(--wpct-gf-footer-space, 28px);
	--gf-field-choice-gap: 12px;

	/* Labels (primary = field label, secondary = choice label, tertiary = sub-label) */
	--gf-ctrl-label-color-primary: var(--wpct-gf-label-color, #07182f);
	--gf-ctrl-label-font-size-primary: .84rem;
	--gf-ctrl-label-font-weight-primary: 800;
	--gf-ctrl-label-line-height-primary: 1.4;
	--gf-ctrl-label-color-secondary: var(--wpct-gf-choice-color, #52657b);
	--gf-ctrl-label-font-size-secondary: .92rem;
	--gf-ctrl-label-font-weight-secondary: 500;
	--gf-ctrl-label-line-height-secondary: 1.5;
	--gf-ctrl-label-color-tertiary: var(--wpct-gf-desc-color, #738399);
	--gf-ctrl-label-font-size-tertiary: .75rem;
	--gf-ctrl-label-color-req: var(--wpct-gf-required-color, #c5413b);
	--gf-ctrl-label-font-size-req: .72rem;
	--gf-ctrl-label-font-weight-req: 600;

	/* Fields */
	--gf-ctrl-size: var(--wpct-gf-field-h, 52px);
	--gf-ctrl-line-height: 1.5;
	--gf-ctrl-padding-x: var(--wpct-gf-field-px, 1rem);
	--gf-ctrl-font-size: 1rem;
	--gf-ctrl-color: var(--wpct-gf-field-color, #13243a);
	--gf-ctrl-color-hover: var(--gf-ctrl-color);
	--gf-ctrl-color-focus: var(--gf-ctrl-color);
	--gf-ctrl-color-error: var(--gf-ctrl-color);
	--gf-ctrl-bg-color: var(--wpct-gf-field-bg, #ffffff);
	--gf-ctrl-bg-color-hover: var(--gf-ctrl-bg-color);
	--gf-ctrl-bg-color-focus: var(--gf-ctrl-bg-color);
	--gf-ctrl-bg-color-error: var(--gf-ctrl-bg-color);
	--gf-ctrl-border-width: var(--wpct-gf-field-border-w, 1px);
	--gf-ctrl-border-color: var(--wpct-gf-field-border, #bac8d5);
	--gf-ctrl-border-color-hover: var(--wpct-gf-field-border-hover, #93a6b8);
	--gf-ctrl-border-color-focus: var(--wpct-gf-focus, #245bff);
	--gf-ctrl-border-color-error: var(--wpct-gf-error, #c5413b);
	--gf-ctrl-radius: var(--wpct-gf-field-radius, 10px);
	--gf-ctrl-radius-max-sm: min(var(--gf-ctrl-radius), 2px);
	--gf-ctrl-radius-max-md: min(var(--gf-ctrl-radius), 3px);
	--gf-ctrl-radius-max-lg: min(var(--gf-ctrl-radius), 8px);
	--gf-ctrl-shadow: none;
	--gf-ctrl-outline-offset: 0;
	--gf-ctrl-outline-color-focus: var(--wpct-gf-focus-ring, rgba(36, 91, 255, .15));
	--gf-ctrl-outline-width-focus: 3px;
	--gf-ctrl-placeholder-color: var(--wpct-gf-placeholder, #8a99ab);
	--gf-ctrl-textarea-height: 145px; /* Field size "Small"; Medium/Large are taller (Gravity Forms field setting). */
	--gf-ctrl-textarea-radius: var(--gf-ctrl-radius);
	--gf-ctrl-textarea-padding-y: .8rem;

	/* Checkboxes and radio buttons */
	--gf-ctrl-choice-size: var(--wpct-gf-choice-size, 22px);
	--gf-ctrl-choice-check-color: var(--wpct-gf-check, #245bff);
	--gf-ctrl-checkbox-check-radius: var(--wpct-gf-check-radius, 6px);

	/* Descriptions and validation */
	--gf-ctrl-desc-color: var(--wpct-gf-desc-color, #738399);
	--gf-ctrl-desc-font-size: .75rem;
	--gf-ctrl-desc-color-error: var(--wpct-gf-error, #c5413b);
	--gf-form-validation-color: var(--wpct-gf-error, #c5413b);
	--gf-form-validation-heading-color: var(--gf-form-validation-color);
	--gf-form-validation-summary-color: var(--gf-form-validation-color);
	--gf-form-validation-heading-icon-color: var(--gf-form-validation-color);
	--gf-form-validation-border-color: color-mix(in srgb, var(--gf-form-validation-color) 25%, transparent);
	--gf-form-validation-heading-icon-border-color: var(--gf-form-validation-border-color);
	--gf-form-validation-bg-color: color-mix(in srgb, var(--gf-form-validation-color) 5%, #ffffff);
	--gf-form-validation-heading-icon-bg-color: transparent;
	--gf-form-validation-radius: var(--wpct-gf-field-radius, 10px);
	--gf-form-validation-shadow: none;

	/* Submit button */
	--gf-ctrl-btn-bg-color-primary: var(--wpct-gf-btn-bg, #245bff);
	--gf-ctrl-btn-bg-color-hover-primary: var(--wpct-gf-btn-bg-hover, #164ad8);
	--gf-ctrl-btn-bg-color-focus-primary: var(--gf-ctrl-btn-bg-color-hover-primary);
	--gf-ctrl-btn-color-primary: var(--wpct-gf-btn-color, #ffffff);
	--gf-ctrl-btn-color-hover-primary: var(--wpct-gf-btn-color-hover, #ffffff);
	--gf-ctrl-btn-color-focus-primary: var(--gf-ctrl-btn-color-hover-primary);
	--gf-ctrl-btn-border-color-primary: transparent;
	--gf-ctrl-btn-border-color-hover-primary: transparent;
	--gf-ctrl-btn-border-color-focus-primary: transparent;
	--gf-ctrl-btn-radius: var(--wpct-gf-btn-radius, 999px);
	--gf-ctrl-btn-size: var(--wpct-gf-btn-h, 50px);
	--gf-ctrl-btn-padding-x: var(--wpct-gf-btn-px, 1.25rem);
	--gf-ctrl-btn-font-family: "Manrope", Arial, sans-serif;
	--gf-ctrl-btn-font-size: .92rem;
	--gf-ctrl-btn-font-weight: 800;
	/* Shadow in the button color, so it follows a changed background. */
	--gf-ctrl-btn-shadow: 0 10px 25px color-mix(in srgb, var(--wpct-gf-btn-bg, #245bff) 22%, transparent);
	--gf-ctrl-btn-shadow-hover: 0 14px 30px color-mix(in srgb, var(--wpct-gf-btn-bg, #245bff) 30%, transparent);
	--gf-ctrl-btn-shadow-focus: var(--gf-ctrl-btn-shadow-hover);
}

/* Submit button: lift on hover (as .btn in the design). Mouse only, never
   with reduced motion. The selector outranks Gravity Forms' own button rule. */
.wpct-gform .gform_wrapper.gform-theme .gform_footer .gform_button.button {
	line-height: 1.15;
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
	.wpct-gform--lift .gform_wrapper.gform-theme .gform_footer .gform_button.button {
		transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease, color .18s ease;
	}

	.wpct-gform--lift .gform_wrapper.gform-theme .gform_footer .gform_button.button:hover {
		transform: translateY(-2px);
	}
}

/* Confirmation after sending (replaces the form). */
.wpct-gform .gform_confirmation_wrapper .gform_confirmation_message {
	padding: 20px 22px;
	border: 1px solid color-mix(in srgb, var(--wpct-gf-success, #1f9d76) 30%, transparent);
	border-radius: 18px;
	color: var(--wpct-gf-success-text, #07182f);
	background: color-mix(in srgb, var(--wpct-gf-success, #1f9d76) 8%, #ffffff);
	font-size: 1rem;
	line-height: 1.6;
}
