/*
 * en2x – Kontaktformular (Contact Form 7).
 *
 * We do NOT rebuild the form as a module – Contact Form 7 keeps handling
 * validation, mail, spam and the GDPR consent. We only restyle it: the CF7 form
 * content is wrapped in .en2x-kontaktformular (see the form markup in the CF7
 * editor), so every rule here is scoped to that wrapper and never leaks onto
 * other forms. Layout: light grey box, headline, two columns (Name/E-Mail left,
 * message right), bordered fields with bold placeholder labels, consent + submit.
 * en2x design: no radii; colours from the global tokens. Font inherited (Rubik).
 */

.en2x-kontaktformular {
	background: #f0f0f3;
	padding: clamp(28px, 4vw, 56px);
	box-sizing: border-box;
	font-family: inherit;
	color: var(--en2x-color-headline, #250F51);
}

.en2x-kontaktformular__title {
	margin: 0 0 28px;
	font-size: clamp(22px, 3vw, 30px);
	font-weight: 700;
	line-height: 1.15;
	text-transform: uppercase;
	color: var(--en2x-color-headline, #250F51);
}

/* CF7 auto-wraps controls in <p>; neutralise that spacing inside our form. */
.en2x-kontaktformular p {
	margin: 0;
}

/* Two columns: Name + E-Mail (stacked) left, message right. */
.en2x-kontaktformular__grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 20px 24px;
	align-items: start;
}

.en2x-kontaktformular__col {
	display: flex;
	flex-direction: column;
	gap: 20px;
	min-width: 0;
}

.en2x-kontaktformular .wpcf7-form-control-wrap {
	display: block;
}

/* Text inputs + textarea: white, aubergine border, no radius, bold placeholder.
 * Element+class selectors so they beat Salient's generic input styling. */
.en2x-kontaktformular input.wpcf7-text,
.en2x-kontaktformular textarea.wpcf7-textarea {
	width: 100%;
	box-sizing: border-box;
	margin: 0;
	padding: 16px 20px;
	background: #fff;
	border: 2px solid var(--en2x-color-headline, #250F51);
	border-radius: 0;
	color: var(--en2x-color-headline, #250F51);
	font-family: inherit;
	font-size: 16px;
	line-height: 1.4;
	box-shadow: none;
}

.en2x-kontaktformular textarea.wpcf7-textarea {
	/* Match the height of the two stacked fields on the left (Name + E-Mail + the
	 * 20px gap), like the template, instead of CF7's tall default (rows=10). The
	 * grid then keeps both columns level. Still user-resizable. */
	height: 138px;
	min-height: 0;
	resize: vertical;
	display: block;
}

.en2x-kontaktformular input.wpcf7-text::placeholder,
.en2x-kontaktformular textarea.wpcf7-textarea::placeholder {
	color: var(--en2x-color-headline, #250F51);
	font-weight: 700;
	opacity: 1;
}

.en2x-kontaktformular input.wpcf7-text:focus,
.en2x-kontaktformular textarea.wpcf7-textarea:focus {
	outline: none;
	border-color: var(--en2x-color-primary, #221182);
	box-shadow: none;
}

/* Consent row (checkbox + GDPR text). */
.en2x-kontaktformular__consent {
	margin: 24px 0 0;
	font-size: 14px;
	line-height: 1.5;
	color: #50575e;
}

.en2x-kontaktformular__consent .wpcf7-list-item {
	margin: 0;
	display: flex;
	gap: 10px;
	align-items: flex-start;
}

.en2x-kontaktformular__consent .wpcf7-list-item-label {
	flex: 1 1 auto;
}

.en2x-kontaktformular__consent input[type="checkbox"] {
	margin-top: 2px;
	flex: 0 0 auto;
}

.en2x-kontaktformular__consent a {
	color: var(--en2x-color-primary, #221182);
}

/* Submit button (en2x primary, uppercase, rectangular). */
.en2x-kontaktformular input.wpcf7-submit {
	margin-top: 22px;
	padding: 14px 30px;
	background: var(--en2x-color-primary, #221182);
	color: #fff;
	border: 0;
	border-radius: 0;
	font-family: inherit;
	font-size: 14px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	cursor: pointer;
	box-shadow: none;
	transition: background-color 0.15s ease;
}

.en2x-kontaktformular input.wpcf7-submit:hover,
.en2x-kontaktformular input.wpcf7-submit:focus-visible {
	background: #190b63;
}

/* CF7 response/validation messages. */
.en2x-kontaktformular .wpcf7-response-output {
	margin: 20px 0 0;
	border-radius: 0;
}

/* Responsive: single column on tablet/mobile. */
@media (max-width: 782px) {
	.en2x-kontaktformular__grid {
		grid-template-columns: 1fr;
	}
}
