/* Rodwick contact form: layout and look from rodwick.com/fr/nous-joindre/contact */
.rw-contact {
	--rw-blue: #003e7e;
	--rw-panel: #e5f0f7;
	--rw-text: #161a1d;
	--rw-field-h: 80px;
	background: var(--rw-panel);
	padding: 40px 24px 56px;
}

/* Two columns: left 5/12 (name, phone, email), right 7/12 (subject, message spanning the rest) */
.rw-contact .gform_wrapper .gform_fields {
	display: grid !important;
	grid-template-columns: 5fr 7fr;
	/* minmax: rows are 80px but grow when a validation message sits under a field (otherwise the next row covers it) */
	grid-template-rows: minmax(var(--rw-field-h), auto) minmax(var(--rw-field-h), auto) minmax(var(--rw-field-h), auto);
	align-items: stretch;
	grid-column-gap: 32px;
	grid-row-gap: 20px;
}
.rw-contact .gform_wrapper .gfield { grid-column: auto; }
.rw-contact .gform_wrapper .rw-f-name    { grid-column: 1; grid-row: 1; }
.rw-contact .gform_wrapper .rw-f-phone   { grid-column: 1; grid-row: 2; }
.rw-contact .gform_wrapper .rw-f-email   { grid-column: 1; grid-row: 3; }
.rw-contact .gform_wrapper .rw-f-subject { grid-column: 2; grid-row: 1; }
.rw-contact .gform_wrapper .rw-f-message { grid-column: 2; grid-row: 2 / span 2; display: flex; flex-direction: column; }
.rw-contact .gform_wrapper .rw-f-message .ginput_container { flex: 1 1 0; min-height: 0; position: relative; }
/* The textarea is absolutely positioned so its default rows do not drive the grid row height (rows only grow for validation messages). */
.rw-contact .gform_wrapper .rw-f-message textarea { position: absolute; inset: 0; height: 100% !important; min-height: 0 !important; }
.rw-contact .gform_wrapper .gfield { margin: 0; min-height: 0; }
.rw-contact .gform_wrapper .gform_validation_container { display: none !important; }

/* Fields: 80px, white, no border, placeholders only */
.rw-contact .gform_wrapper .gfield_label.hidden_label,
.rw-contact .gform_wrapper .gform_required_legend { display: none; }
.rw-contact .gform_wrapper input[type="text"],
.rw-contact .gform_wrapper input[type="email"],
.rw-contact .gform_wrapper input[type="tel"],
.rw-contact .gform_wrapper textarea {
	width: 100%;
	height: var(--rw-field-h);
	padding: 6px 12px;
	border: 0;
	border-radius: 0;
	background: #fff;
	box-shadow: none;
	font-family: inherit;
	font-size: 16px;
	line-height: 24px;
	color: var(--rw-text);
	box-sizing: border-box;
}
.rw-contact .gform_wrapper textarea {
	height: 100% !important;
	min-height: 100% !important;
	padding: 29px 12px;
	resize: none;
	display: block;
}
.rw-contact .gform_wrapper input::placeholder,
.rw-contact .gform_wrapper textarea::placeholder { color: #6c757d; opacity: 1; }
.rw-contact .gform_wrapper input:focus,
.rw-contact .gform_wrapper textarea:focus { outline: 2px solid var(--rw-blue); outline-offset: -2px; }
.rw-contact .gform_wrapper .gfield_validation_message,
.rw-contact .gform_wrapper .validation_message { background: transparent; border: 0; padding: 4px 0 0; color: #c02b0a; font-size: 13px; }
.rw-contact .gform_wrapper .gform_validation_errors { margin: 0 0 16px; }

/* Submit: dark-blue button with arrow, right-aligned, with the 3px bar inside at the left */
.rw-contact .gform_wrapper .gform_footer {
	display: flex;
	justify-content: flex-end;
	margin: 32px 0 0;
	padding: 0;
}
/* Gravity Forms' Orbital theme paints the button from CSS variables; override the variables and the properties. */
.rw-contact .gform_wrapper {
	--gf-ctrl-btn-bg-color-primary: #003e7e;
	--gf-ctrl-btn-bg-color-hover-primary: #fff;
	--gf-ctrl-btn-color-primary: #fff;
	--gf-ctrl-btn-color-hover-primary: #003e7e;
	--gf-ctrl-btn-border-color-primary: #003e7e;
	--gf-ctrl-btn-radius: 0;
	--gf-ctrl-btn-shadow: none;
	--gf-ctrl-btn-shadow-hover: none;
}
/* Same button as the Divi "Contactez-nous" / "Retour à nos produits" buttons on the site:
   dark blue, 50px, PT Serif 700 14px, FontAwesome arrow at left 50px, 3px white bar at left 5px */
.rw-contact .gform_wrapper .gform_footer .rw-btn-solid {
	position: relative;
	display: inline-block !important;
	height: 50px !important;
	min-height: 50px !important;
	margin: 0 !important;
	padding: 18px 20px 18px 65px !important;
	background: linear-gradient(#fff, #fff) 5px 0 / 3px 100% no-repeat, var(--rw-blue) !important;
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	color: #fff !important;
	font-family: inherit !important;
	font-size: 14px !important;
	font-weight: 700 !important;
	line-height: 14px !important;
	letter-spacing: 0;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease;
}
/* Font Awesome "arrow-right" as an SVG mask in the text colour (Divi only loads the Font Awesome font on pages that use one of its icons) */
.rw-contact .gform_wrapper .gform_footer .rw-btn-solid .rw-btn-arrow {
	/* spacing from rodwick.com: bar at 5px, arrow at 30px (15 × 13), text at 65px */
	position: absolute;
	left: 30px;
	top: 50%;
	width: 15px;
	height: 13px;
	transform: translateY(-50%);
	background: currentColor;
	-webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'><path d='M190.5 66.9l22.2-22.2c9.4-9.4 24.6-9.4 33.9 0L441 239c9.4 9.4 9.4 24.6 0 33.9L246.6 467.3c-9.4 9.4-24.6 9.4-33.9 0l-22.2-22.2c-9.5-9.5-9.3-25 .4-34.3L311.4 296H24c-13.3 0-24-10.7-24-24v-32c0-13.3 10.7-24 24-24h287.4L190.9 101.2c-9.8-9.3-10-24.8-.4-34.3z'/></svg>") center / contain no-repeat;
	mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'><path d='M190.5 66.9l22.2-22.2c9.4-9.4 24.6-9.4 33.9 0L441 239c9.4 9.4 9.4 24.6 0 33.9L246.6 467.3c-9.4 9.4-24.6 9.4-33.9 0l-22.2-22.2c-9.5-9.5-9.3-25 .4-34.3L311.4 296H24c-13.3 0-24-10.7-24-24v-32c0-13.3 10.7-24 24-24h287.4L190.9 101.2c-9.8-9.3-10-24.8-.4-34.3z'/></svg>") center / contain no-repeat;
}
.rw-contact .gform_wrapper .gform_footer .rw-btn-solid:hover,
.rw-contact .gform_wrapper .gform_footer .rw-btn-solid:focus-visible {
	background: linear-gradient(var(--rw-blue), var(--rw-blue)) 5px 0 / 3px 100% no-repeat, #fff !important;
	color: var(--rw-blue) !important;
	outline: 1px solid var(--rw-blue);
}
.rw-contact .gform_confirmation_message {
	padding: 8px 0;
	font-size: 16px;
	font-weight: 600;
	color: var(--rw-blue);
}

@media (max-width: 767px) {
	.rw-contact { padding: 24px 16px 32px; --rw-field-h: 56px; }
	.rw-contact .gform_wrapper .gform_fields { grid-template-columns: 1fr; grid-template-rows: none; grid-row-gap: 12px; }
	.rw-contact .gform_wrapper .gfield,
	.rw-contact .gform_wrapper .rw-f-name, .rw-contact .gform_wrapper .rw-f-phone, .rw-contact .gform_wrapper .rw-f-email,
	.rw-contact .gform_wrapper .rw-f-subject, .rw-contact .gform_wrapper .rw-f-message { grid-column: 1; grid-row: auto; }
	.rw-contact .gform_wrapper .rw-f-message { display: block; }
	.rw-contact .gform_wrapper .rw-f-message textarea { position: static; height: 150px !important; min-height: 150px !important; }
	.rw-contact .gform_wrapper textarea { height: 150px !important; min-height: 150px !important; padding: 16px 12px; }
	.rw-contact .gform_wrapper .gform_footer { justify-content: stretch; }
	.rw-contact .gform_wrapper .gform_footer .rw-btn-solid { width: 100%; justify-content: center; }
}
