/* ============================================================
   Gravity Forms — Diaphane skin
   ------------------------------------------------------------
   Maps the default Gravity Forms markup to the visual identity
   of the original `.contact-form` block (cf-* classes).

   Scoped under `.contact-form` so other Gravity forms on the
   site (if any are added later for ops/admin use) keep their
   default look.

   Field layout in Gravity admin should be configured as:
   - All fields default size = "Large"
   - Use "Field Size: Two Columns" via the Layout panel where
     two fields share a row (Name + Société, Email + Téléphone)
   - Message = paragraph (textarea), full width
   - Submit text = "Envoyer le message →"
   ============================================================ */

/* Reset Gravity's wrapper paddings — our outer .contact-form already styles the box. */
.contact-form .gform_wrapper.gravity-theme,
.contact-form .gform_wrapper {
	margin: 0;
	padding: 0;
}
.contact-form .gform_wrapper form {
	display: flex;
	flex-direction: column;
	gap: 24px;
}
.contact-form .gform_wrapper .gform_body { width: 100%; }
.contact-form .gform_wrapper .gform_validation_errors,
.contact-form .gform_wrapper .gform_required_legend { display: none; }

/* Field grid — two columns by default, single column at max-width 900px. */
.contact-form .gform_wrapper .gform_fields {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 20px 20px;
}
.contact-form .gform_wrapper .gfield {
	min-width: 0;
	display: flex;
	flex-direction: column;
}
.contact-form .gform_wrapper .gfield--width-full,
.contact-form .gform_wrapper .gfield_html,
.contact-form .gform_wrapper .ginput_container_textarea,
.contact-form .gform_wrapper .gfield[data-js-reload] { grid-column: 1 / -1; }

/* Fields that should always span full width (even if Gravity defaults them to half) */
.contact-form .gform_wrapper .gfield--type-textarea,
.contact-form .gform_wrapper .gfield--type-radio,
.contact-form .gform_wrapper .gfield--type-checkbox,
.contact-form .gform_wrapper .gfield--type-select { grid-column: 1 / -1; }

/* Labels — mono kicker style. */
.contact-form .gform_wrapper .gfield_label {
	font-family: var(--f-mono);
	font-size: 11px;
	letter-spacing: .16em;
	text-transform: uppercase;
	color: var(--ink-2);
	display: block;
	margin: 0 0 10px;
	font-weight: 400;
}
.contact-form .gform_wrapper .gfield_description {
	font-family: var(--f-display);
	font-size: 13px;
	color: var(--ink-3);
	font-style: italic;
	margin: 6px 0 0;
	letter-spacing: 0;
	text-transform: none;
	padding: 0;
}

/* Text-like inputs — bottom-only border, transparent background. */
.contact-form .gform_wrapper .ginput_container input[type="text"],
.contact-form .gform_wrapper .ginput_container input[type="email"],
.contact-form .gform_wrapper .ginput_container input[type="tel"],
.contact-form .gform_wrapper .ginput_container input[type="url"],
.contact-form .gform_wrapper .ginput_container input[type="number"] {
	font: inherit;
	font-size: 16px;
	color: var(--ink);
	background: transparent;
	border: 0;
	border-bottom: 1px solid var(--rule);
	border-radius: 0;
	padding: 10px 0 12px;
	width: 100%;
	box-shadow: none;
	transition: border-color .18s ease;
	min-height: auto;
}

/* Textarea — boxed style. */
.contact-form .gform_wrapper .ginput_container textarea {
	font: inherit;
	font-size: 16px;
	color: var(--ink);
	background: var(--bg-alt);
	border: 1px solid var(--rule);
	border-radius: 0;
	padding: 14px 16px;
	width: 100%;
	min-height: 120px;
	resize: vertical;
	line-height: 1.5;
	box-shadow: none;
	transition: border-color .18s ease;
}

/* Select — keep visual consistency with text inputs. */
.contact-form .gform_wrapper .ginput_container select {
	font: inherit;
	font-size: 16px;
	color: var(--ink);
	background: transparent;
	border: 0;
	border-bottom: 1px solid var(--rule);
	border-radius: 0;
	padding: 10px 0 12px;
	width: 100%;
	box-shadow: none;
}

/* Hover / focus states. */
.contact-form .gform_wrapper input:hover,
.contact-form .gform_wrapper textarea:hover,
.contact-form .gform_wrapper select:hover { border-color: var(--ink-2); }
.contact-form .gform_wrapper input:focus,
.contact-form .gform_wrapper textarea:focus,
.contact-form .gform_wrapper select:focus { outline: 0; border-color: var(--accent); }

.contact-form .gform_wrapper input::placeholder,
.contact-form .gform_wrapper textarea::placeholder { color: var(--ink-3); opacity: 1; }

/* Radio "segmented" control — mirrors .cf-segmented from the original site. */
.contact-form .gform_wrapper .ginput_container_radio .gfield_radio {
	display: flex;
	flex-direction: row;
	flex-wrap: nowrap;
	border: 1px solid var(--rule);
	background: var(--bg-alt);
	overflow: hidden;
	width: 100%;
	margin: 0;
	padding: 0;
	list-style: none;
	gap: 0;
}
.contact-form .gform_wrapper .ginput_container_radio .gchoice {
	flex: 1 1 0;
	margin: 0;
	padding: 0;
	display: flex;
	border-right: 1px solid var(--rule);
}
.contact-form .gform_wrapper .ginput_container_radio .gchoice:last-child { border-right: 0; }

.contact-form .gform_wrapper .ginput_container_radio .gchoice input[type="radio"] {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
	pointer-events: none;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
}
.contact-form .gform_wrapper .ginput_container_radio .gchoice label {
	flex: 1 1 0;
	margin: 0;
	text-align: center;
	padding: 12px 16px;
	font-size: 14px;
	font-weight: 500;
	color: var(--ink-2);
	cursor: pointer;
	transition: background .18s ease, color .18s ease;
	letter-spacing: 0;
	text-transform: none;
	font-family: var(--f-body);
}
.contact-form .gform_wrapper .ginput_container_radio .gchoice label:hover {
	color: var(--ink);
	background: color-mix(in oklab, var(--bg-alt) 50%, var(--bg));
}
.contact-form .gform_wrapper .ginput_container_radio .gchoice input[type="radio"]:checked + label {
	background: var(--ink);
	color: var(--bg);
}
.contact-form .gform_wrapper .ginput_container_radio .gchoice input[type="radio"]:focus-visible + label {
	outline: 2px solid var(--accent);
	outline-offset: -2px;
}

/* Checkbox lists — keep the default Gravity look but neutralize colors. */
.contact-form .gform_wrapper .ginput_container_checkbox .gfield_checkbox {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.contact-form .gform_wrapper .ginput_container_checkbox .gchoice label {
	font-size: 15px;
	color: var(--ink);
	font-weight: 400;
	letter-spacing: 0;
	text-transform: none;
	margin-left: 8px;
	cursor: pointer;
}

/* Footer / Submit. */
.contact-form .gform_wrapper .gform_footer {
	margin: 8px 0 0;
	padding: 28px 0 0;
	border-top: 1px solid var(--rule);
	display: flex;
	justify-content: flex-end;
	gap: 12px;
}
/* Submit — high-specificity + !important on color rules.
   Gravity's own gravity-theme / orbital CSS targets `.gform_wrapper button`
   with the same class-count specificity as ours, so without forcing the
   cascade here, the WP theme blue wins and the button renders blue. */
body .contact-form .gform_wrapper .gform_footer input[type="submit"],
body .contact-form .gform_wrapper .gform_footer button[type="submit"],
body .contact-form .gform_wrapper.gravity-theme .gform_footer input[type="submit"],
body .contact-form .gform_wrapper.gravity-theme .gform_footer button[type="submit"] {
	min-width: 220px;
	justify-content: space-between;
	/* Reuse .btn .btn-primary visual rules. */
	display: inline-flex;
	align-items: center;
	gap: 12px;
	padding: 14px 20px;
	font-family: var(--f-body);
	font-size: 15px;
	font-weight: 600;
	letter-spacing: .01em;
	background: var(--accent) !important;
	color: var(--accent-ink) !important;
	border: 1px solid var(--accent) !important;
	border-radius: 0 !important;
	cursor: pointer;
	transition: background .18s ease, border-color .18s ease, transform .18s ease;
	text-transform: none;
	box-shadow: none !important;
}
body .contact-form .gform_wrapper .gform_footer input[type="submit"]:hover,
body .contact-form .gform_wrapper .gform_footer button[type="submit"]:hover,
body .contact-form .gform_wrapper.gravity-theme .gform_footer input[type="submit"]:hover,
body .contact-form .gform_wrapper.gravity-theme .gform_footer button[type="submit"]:hover {
	background: var(--accent-2) !important;
	border-color: var(--accent-2) !important;
}
body .contact-form .gform_wrapper .gform_footer input[type="submit"]:focus-visible,
body .contact-form .gform_wrapper .gform_footer button[type="submit"]:focus-visible {
	outline: 2px solid var(--ink);
	outline-offset: 3px;
}

/* Required indicator — visual override.
   Gravity 2.10 / Orbital ignores `$form['requiredIndicator']` set via
   gform_pre_render in some configurations and renders the localized
   "(Nécessaire)" anyway. Rather than fight the API, we hide that text
   and inject a "*" via ::before on the same element. Works regardless
   of whether the underlying class is _text or _asterisk. */
.contact-form .gform_wrapper .gfield_label > .gfield_required {
	display: inline-block;
	margin-left: 4px;
	font-size: 0;            /* hides any localized "(Nécessaire)" text */
	line-height: 1;
	vertical-align: baseline;
}
.contact-form .gform_wrapper .gfield_label > .gfield_required::before {
	content: "*";
	font-size: 13px;
	font-weight: 600;
	color: var(--accent);
}
/* Strip the noisy "« (Nécessaire) » indique les champs nécessaires" legend
   at the top of the form — redundant with per-field markers. */
.contact-form .gform_wrapper .gform_required_legend,
.contact-form .gform_wrapper .gform_heading .gform_required_legend {
	display: none !important;
}

/* Inline arrow appended to submit (Gravity doesn't render the <span class="arrow">,
   so we add a CSS pseudo-element for the same visual cue). */
.contact-form .gform_wrapper .gform_footer input[type="submit"]::after,
.contact-form .gform_wrapper .gform_footer button[type="submit"]::after {
	content: "→";
	font-family: var(--f-display);
	font-style: italic;
	font-size: 17px;
	font-weight: 400;
	margin-left: 12px;
	transition: transform .18s ease;
}
.contact-form .gform_wrapper .gform_footer input[type="submit"]:hover::after,
.contact-form .gform_wrapper .gform_footer button[type="submit"]:hover::after {
	transform: translateX(4px);
}

/* Validation errors — keep a discreet, on-brand red. */
.contact-form .gform_wrapper .gfield_error .gfield_label { color: var(--accent); }
.contact-form .gform_wrapper .gfield_error input,
.contact-form .gform_wrapper .gfield_error textarea,
.contact-form .gform_wrapper .gfield_error select { border-color: var(--accent); }
.contact-form .gform_wrapper .validation_message {
	font-family: var(--f-body);
	font-size: 13px;
	color: var(--accent);
	margin-top: 6px;
	font-weight: 500;
	letter-spacing: 0;
	text-transform: none;
	padding: 0;
	background: transparent;
	border: 0;
}

/* Confirmation message after submission. */
.contact-form .gform_confirmation_wrapper,
.contact-form .gform_confirmation_message {
	font-family: var(--f-body);
	font-size: 16px;
	line-height: 1.55;
	color: var(--ink);
	background: var(--bg-alt);
	border: 1px solid var(--rule);
	padding: 24px;
}

/* Mobile — single column. */
@media (max-width: 900px) {
	.contact-form .gform_wrapper .gform_fields {
		grid-template-columns: 1fr;
	}
	.contact-form .gform_wrapper .gfield--width-half,
	.contact-form .gform_wrapper .gfield--width-third,
	.contact-form .gform_wrapper .gfield--width-quarter,
	.contact-form .gform_wrapper .gfield { grid-column: 1 / -1; }
	.contact-form .gform_wrapper .ginput_container_radio .gfield_radio {
		flex-direction: column;
	}
	.contact-form .gform_wrapper .ginput_container_radio .gchoice {
		border-right: 0;
		border-bottom: 1px solid var(--rule);
	}
	.contact-form .gform_wrapper .ginput_container_radio .gchoice:last-child { border-bottom: 0; }
	.contact-form .gform_wrapper .gform_footer { justify-content: stretch; }
	.contact-form .gform_wrapper .gform_footer input[type="submit"],
	.contact-form .gform_wrapper .gform_footer button[type="submit"] {
		flex: 1 1 auto;
		justify-content: center;
		min-width: 0;
	}
}

/* Placeholder helper shown when Gravity isn't installed yet. */
.contact-form-placeholder {
	grid-column: 7 / -1;
}
@media (max-width: 900px) {
	.contact-form-placeholder { grid-column: 1 / -1; }
}
