/* Gravity Forms — Theme Integration
 *
 * Maps GF variables to theme.json design tokens.
 * Targets both .gform-theme (Orbital, current) and .gravity-theme (legacy).
 *
 * Note: GF's Orbital theme applies inline gform_style_settings that override
 * normal CSS. Use !important on visual property overrides for buttons/inputs.
 */

.gform_wrapper.gform-theme,
.gform_wrapper.gravity-theme {
	/* Primary (submit button, focus rings, progress bars) */
	--gf-color-primary: var(--wp--preset--color--primary);
	--gf-color-primary-rgb: 0, 0, 0;
	--gf-color-primary-darker: var(--wp--preset--color--main);
	--gf-color-primary-lighter: var(--wp--preset--color--primary);
	--gf-color-primary-contrast: var(--wp--preset--color--primary-accent);
	--gf-color-primary-contrast-rgb: 255, 255, 255;

	/* Secondary (secondary buttons) */
	--gf-color-secondary: var(--wp--preset--color--tertiary);
	--gf-color-secondary-contrast: var(--wp--preset--color--main);

	/* Input controls */
	--gf-color-in-ctrl: var(--wp--preset--color--base);
	--gf-color-in-ctrl-contrast: var(--wp--preset--color--main);
	--gf-color-in-ctrl-primary: var(--wp--preset--color--primary);
	--gf-color-in-ctrl-dark: var(--wp--preset--color--main);

	/* Outside controls (labels, descriptions) */
	--gf-color-out-ctrl-dark: var(--wp--preset--color--main);
	--gf-color-out-ctrl-light: rgba(0, 0, 0, 0.1);

	/* Labels */
	--gf-ctrl-label-color-primary: var(--wp--preset--color--main);
	--gf-ctrl-label-color-secondary: var(--wp--preset--color--main);

	/* Borders */
	--gf-ctrl-border-color: var(--wp--preset--color--border-light);
	--gf-radius: 0.5rem;

	/* Typography */
	font-family: var(--wp--preset--font-family--body);
	--gf-font-size-secondary: var(--wp--preset--font-size--x-small);
	--gf-font-size-tertiary: var(--wp--preset--font-size--x-small);
}

/* ===== Martel dark form treatment (mockup: MARTEL Contact.dc.html) =====
 *
 * Unscoped on purpose: every form on this site is a Gravity Form, and the site
 * is dark throughout, so these apply to any form anywhere rather than only
 * inside the contact section.
 *
 * The submit arrow is a background-image rather than an inline SVG. It used to
 * be injected by a gform_submit_button_1 filter that rewrote GF's
 * <input type="submit"> into a <button> via DOMDocument just to hold the icon;
 * CSS does the same job against GF's native input, so that filter is gone.
 * Same technique as .martel-btn-dark in assets/styles/core/button.css.
 */
.gform_wrapper { --gf-color-primary: var(--wp--preset--color--primary); }
/* Intro copy already explains asterisks; GF's legend renders near-invisible on the dark bg */
.gform_wrapper .gform_required_legend { display: none; }
.gform_wrapper .gform_fields { grid-row-gap: 26px; grid-column-gap: 26px; }
.gform_wrapper .gfield_label { font-size: 12px; font-weight: 700; letter-spacing: var(--wp--custom--letter-spacing--wide); text-transform: uppercase; color: rgba(255,255,255,.72); }
.gform_wrapper .gfield_label .gfield_required { color: inherit; }
.gform_wrapper input[type="text"],
.gform_wrapper input[type="email"],
.gform_wrapper input[type="tel"],
.gform_wrapper select,
.gform_wrapper textarea { width: 100%; background: var(--wp--preset--color--surface); border: 1px solid var(--wp--preset--color--border-dark); border-radius: 2px; color: #fff; font-family: inherit; font-size: 16px; font-weight: 600; padding: 15px 18px; transition: border-color .3s ease, background .3s ease; }
.gform_wrapper input:focus,
.gform_wrapper select:focus,
.gform_wrapper textarea:focus { outline: none; border-color: var(--wp--preset--color--primary); background-image: linear-gradient(rgba(255,255,255,.02), rgba(255,255,255,.02)); }
/* The `outline: none` above would strip the brand.css ring from keyboard focus
   too, leaving only the red border - a hue change on an already-bordered field,
   which is not enough on its own for 2.4.7. These selectors are (0,2,1) like the
   rule above and sit after it, so they win the outline back. Inset (negative
   offset) and white-only, no dark halo: these fields only ever sit on the dark
   `surface` panel, where white alone is ~14:1. */
.gform_wrapper input:focus-visible,
.gform_wrapper select:focus-visible,
.gform_wrapper textarea:focus-visible { outline: 2px solid #fff; outline-offset: -4px; box-shadow: none; }
.gform_wrapper ::placeholder { color: rgba(255,255,255,.35); }
.gform_wrapper select { height: auto; min-height: 0; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' stroke='%23ffffff' stroke-opacity='.6' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 18px center; padding-right: 44px; }
.gform_wrapper textarea { min-height: 150px; }
/* scoped under .gform_wrapper: GF's own footer rule is (0,2,0) and outranks a bare .gform_footer */
.gform_wrapper .gform_footer { margin-top: 30px; display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.gform_wrapper .gform_button { display: inline-flex !important; align-items: center; background: var(--wp--preset--color--primary) !important; border: 1px solid var(--wp--preset--color--primary) !important; border-radius: 2px !important; color: #fff !important; cursor: pointer; font-family: inherit !important; font-size: 13px !important; font-weight: 700 !important; letter-spacing: var(--wp--custom--letter-spacing--wide) !important; text-transform: uppercase !important; padding: 18px 68px 18px 36px !important; transition: transform .25s ease, box-shadow .3s ease; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='17' viewBox='0 0 36 32' fill='none'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M18.8721 0.219637C19.165 -0.0732015 19.6397 -0.0732233 19.9326 0.219637L34.8506 15.1376C34.933 15.2201 34.9894 15.3186 35.0254 15.4218C35.1389 15.694 35.0857 16.0196 34.8643 16.2411L19.9463 31.1591C19.6535 31.4518 19.1786 31.4518 18.8857 31.1591C18.5929 30.8662 18.5929 30.3914 18.8857 30.0985L32.4824 16.4999H0.75C0.336011 16.4996 -3.61744e-08 16.164 0 15.7499C3.62117e-08 15.3357 0.336763 14.9999 0.750977 14.9999H32.5918L18.8721 1.28018C18.5792 0.987294 18.5792 0.512526 18.8721 0.219637Z' fill='%23ffffff'/%3E%3C/svg%3E") !important; background-repeat: no-repeat !important; background-position: right 36px center !important; }
.gform_wrapper .gform_button:hover { transform: translateY(-2px); box-shadow: 0 16px 36px rgba(200,16,46,.34); }
.gform_wrapper .gform_validation_errors,
.gform_wrapper .gfield_validation_message { background: none; border: none; color: var(--wp--preset--color--red-bright); font-size: 13px; font-weight: 600; padding: 6px 0 0; }
.gform_wrapper .gfield_error input,
.gform_wrapper .gfield_error textarea,
.gform_wrapper .gfield_error select { border-color: var(--wp--preset--color--red-bright); }
.martel-contactform__success { text-align: left; padding: 34px 0; }
.martel-contactform__success .martel-contactform__check { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; background: rgba(70,167,88,.14); color: #6fcf85; font-size: 20px; font-weight: 800; margin-bottom: 18px; }
.martel-contactform__success h3 { font-size: 26px; font-weight: 700; color: #fff; margin: 0 0 10px; }
.martel-contactform__success p { font-size: 15.5px; font-weight: 600; line-height: 1.6; color: rgba(255,255,255,.66); margin: 0; }
@media (prefers-reduced-motion: reduce) { .gform_wrapper .gform_button, .gform_wrapper input, .gform_wrapper select, .gform_wrapper textarea { transition: none; } }
