/* =========================================================
   WPForms an das dunkle Trompetercorps-Design angleichen
   ---------------------------------------------------------
   Hohe Spezifität + gezieltes !important, damit das Theme-
   Design auch gegen das mitgelieferte WPForms-Styling
   ("Modern"/Full Styling) gewinnt. Zusätzlich empfiehlt es
   sich, in WPForms unter Einstellungen das eigene Styling
   auf "Nur Basis" zu reduzieren.
   Gilt nur innerhalb des Themes (Body-Klasse .tch-has-design).
   ========================================================= */

/* Container */
.tch-has-design .wpforms-container,
.tch-has-design .wpforms-container-full {
	font-family: var(--serif);
	color: var(--paper);
	max-width: 100%;
}

/* Feld-Abstände */
.tch-has-design .wpforms-container .wpforms-field {
	padding: 0 0 1.1rem;
}

/* --------------------------------------------------------
   Felder nebeneinander anordnen
   --------------------------------------------------------
   WPForms rendert die Felder untereinander. Um zwei Felder
   in eine Zeile zu setzen, vergib im WPForms-Formular-Editor
   dem Feld unter "Erweitert → CSS-Klassen" die Klasse
   "tch-half" (zwei nebeneinander).

   WICHTIG: WPForms fügt aus Spam-Schutz-Gründen unsichtbare
   Zusatzfelder zwischen die echten Felder ein. Diese dürfen
   das Layout nicht stören. Deshalb: Die Paarung läuft rein
   über die Klasse .tch-half (kein Zählen per nth-child, das
   die versteckten Felder mitzählen würde), und die versteckten
   Felder werden aus dem Layout genommen.
   -------------------------------------------------------- */

/* Feldliste als Flex-Zeile */
.tch-has-design .wpforms-container .wpforms-form .wpforms-field-container {
	display: flex;
	flex-wrap: wrap;
	gap: 0 1.2rem;
	align-items: flex-start;
}

/* Versteckte Anti-Spam-/Honeypot-Felder komplett aus dem Layout nehmen.
   (field_9: Input aria-hidden + tabindex=-1 · field_10: inline position:absolute) */
.tch-has-design .wpforms-container .wpforms-form .wpforms-field:has(> input[aria-hidden="true"]),
.tch-has-design .wpforms-container .wpforms-form .wpforms-field[style*="position: absolute"],
.tch-has-design .wpforms-container .wpforms-form .wpforms-field[style*="position:absolute"] {
	display: none !important;
	width: 0 !important;
	flex: 0 0 0 !important;
	margin: 0 !important;
	padding: 0 !important;
}

/* Standard: jedes sichtbare Feld über die volle Breite */
.tch-has-design .wpforms-container .wpforms-form .wpforms-field-container > .wpforms-field {
	flex: 1 1 100%;
	box-sizing: border-box;
	min-width: 0;
}

/* Halbe Breite: die per tch-half markierten Felder – zwei pro Zeile.
   Keine Zählung nötig, die Klasse selbst bestimmt die Breite. */
.tch-has-design .wpforms-container .wpforms-form .wpforms-field-container > .wpforms-field.tch-half {
	flex: 1 1 calc(50% - .6rem);
}

/* Auf schmalen Bildschirmen alles untereinander */
@media (max-width: 640px) {
	.tch-has-design .wpforms-container .wpforms-form .wpforms-field-container > .wpforms-field.tch-half {
		flex: 1 1 100%;
	}
}

/* Labels */
.tch-has-design .wpforms-container .wpforms-field-label {
	font-family: var(--display);
	text-transform: uppercase;
	letter-spacing: .12em;
	font-size: .8rem;
	font-weight: 500;
	color: var(--white);
	margin-bottom: .5rem;
}

/* Pflichtfeld-Sternchen in Crimson */
.tch-has-design .wpforms-container .wpforms-required-label {
	color: var(--crimson);
}

/* Sublabels und Hinweise dezent */
.tch-has-design .wpforms-container .wpforms-field-sublabel,
.tch-has-design .wpforms-container .wpforms-field-description {
	font-family: var(--mono);
	text-transform: none;
	letter-spacing: 0;
	font-size: .78rem;
	color: var(--muted);
}

/* Eingabefelder, Textareas, Selects – mit !important gegen WPForms-Styling */
.tch-has-design .wpforms-container .wpforms-form .wpforms-field-small,
.tch-has-design .wpforms-container .wpforms-form .wpforms-field-medium,
.tch-has-design .wpforms-container .wpforms-form .wpforms-field-large {
	max-width: 100% !important;
	width: 100% !important;
}
.tch-has-design .wpforms-container .wpforms-form input[type="text"],
.tch-has-design .wpforms-container .wpforms-form input[type="email"],
.tch-has-design .wpforms-container .wpforms-form input[type="tel"],
.tch-has-design .wpforms-container .wpforms-form input[type="url"],
.tch-has-design .wpforms-container .wpforms-form input[type="number"],
.tch-has-design .wpforms-container .wpforms-form input[type="date"],
.tch-has-design .wpforms-container .wpforms-form input[type="datetime-local"],
.tch-has-design .wpforms-container .wpforms-form select,
.tch-has-design .wpforms-container .wpforms-form textarea {
	width: 100% !important;
	max-width: 100% !important;
	background-color: var(--charcoal) !important;
	border: 1px solid var(--line) !important;
	border-radius: 12px !important;
	color: var(--white) !important;
	font-family: var(--serif) !important;
	font-size: 1rem !important;
	padding: .85rem 1rem !important;
	box-shadow: none !important;
	transition: border-color .2s, box-shadow .2s, background-color .2s;
	box-sizing: border-box !important;
}

.tch-has-design .wpforms-container .wpforms-form textarea {
	min-height: 150px !important;
	resize: vertical;
}

/* Platzhaltertext */
.tch-has-design .wpforms-container ::placeholder {
	color: var(--muted) !important;
	opacity: 1;
}

/* Fokus-Zustand mit Crimson-Rahmen */
.tch-has-design .wpforms-container .wpforms-form input:focus,
.tch-has-design .wpforms-container .wpforms-form select:focus,
.tch-has-design .wpforms-container .wpforms-form textarea:focus {
	outline: none !important;
	border-color: var(--crimson) !important;
	box-shadow: 0 0 0 3px rgba(196, 62, 69, .18) !important;
	background-color: var(--charcoal-2) !important;
}

/* Select-Pfeil sichtbar auf Dunkel */
.tch-has-design .wpforms-container .wpforms-form select {
	appearance: none;
	-webkit-appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a9a9b2' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") !important;
	background-repeat: no-repeat !important;
	background-position: right 1rem center !important;
	padding-right: 2.6rem !important;
}

/* Checkbox / Radio */
.tch-has-design .wpforms-container .wpforms-form input[type="checkbox"],
.tch-has-design .wpforms-container .wpforms-form input[type="radio"] {
	accent-color: var(--crimson);
	width: auto !important;
	margin-right: .5rem;
}

/* Einwilligungs-Text lesbar */
.tch-has-design .wpforms-container .wpforms-field-checkbox label,
.tch-has-design .wpforms-container .wpforms-field-gdpr-checkbox label {
	font-family: var(--serif);
	text-transform: none;
	letter-spacing: 0;
	font-size: .92rem;
	color: var(--paper);
	font-weight: 400;
}

.tch-has-design .wpforms-container .wpforms-field-checkbox a,
.tch-has-design .wpforms-container .wpforms-field-gdpr-checkbox a {
	color: var(--crimson);
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* Absende-Button im Theme-Stil – deckt beide WPForms-Markup-Varianten ab
   (klassisch: input[type=submit] · modern: button[type=submit]) */
.tch-has-design .wpforms-container .wpforms-form button[type="submit"],
.tch-has-design .wpforms-container .wpforms-form input[type="submit"],
.tch-has-design .wpforms-container .wpforms-form .wpforms-submit,
.tch-has-design .wpforms-container button.wpforms-submit,
.tch-has-design .wpforms-container input.wpforms-submit {
	display: inline-block !important;
	width: auto !important;
	font-family: var(--display) !important;
	text-transform: uppercase !important;
	letter-spacing: .09em !important;
	font-weight: 500 !important;
	font-size: .9rem !important;
	line-height: 1.2 !important;
	color: #fff !important;
	background-color: var(--crimson) !important;
	background-image: none !important;
	border: 1px solid transparent !important;
	border-radius: var(--radius-pill) !important;
	padding: .95rem 1.9rem !important;
	margin-top: .4rem !important;
	cursor: pointer;
	box-shadow: 0 4px 14px rgba(196, 62, 69, .28) !important;
	transition: transform .28s var(--ease-bounce), background-color .2s var(--ease-soft), box-shadow .28s var(--ease-soft);
}

.tch-has-design .wpforms-container .wpforms-form button[type="submit"]:hover,
.tch-has-design .wpforms-container .wpforms-form input[type="submit"]:hover,
.tch-has-design .wpforms-container .wpforms-form .wpforms-submit:hover,
.tch-has-design .wpforms-container button.wpforms-submit:hover,
.tch-has-design .wpforms-container input.wpforms-submit:hover {
	background-color: var(--crimson-bright) !important;
	transform: translateY(-2px);
	box-shadow: 0 8px 22px rgba(196, 62, 69, .36) !important;
}

.tch-has-design .wpforms-container .wpforms-form button[type="submit"]:focus-visible,
.tch-has-design .wpforms-container .wpforms-form input[type="submit"]:focus-visible,
.tch-has-design .wpforms-container .wpforms-form .wpforms-submit:focus-visible,
.tch-has-design .wpforms-container button.wpforms-submit:focus-visible,
.tch-has-design .wpforms-container input.wpforms-submit:focus-visible {
	outline: 3px solid var(--brass) !important;
	outline-offset: 2px;
}

/* Fehlermeldungen */
.tch-has-design .wpforms-container .wpforms-error,
.tch-has-design .wpforms-container label.wpforms-error {
	color: var(--crimson-bright) !important;
	font-family: var(--mono);
	font-size: .8rem;
}

.tch-has-design .wpforms-container .wpforms-form input.wpforms-error,
.tch-has-design .wpforms-container .wpforms-form textarea.wpforms-error,
.tch-has-design .wpforms-container .wpforms-form select.wpforms-error {
	border-color: var(--crimson-bright) !important;
}

/* Bestätigungsmeldung nach dem Absenden */
.tch-has-design .wpforms-confirmation-container-full {
	background: var(--charcoal-2) !important;
	border: 1px solid var(--line) !important;
	border-left: 3px solid var(--crimson) !important;
	border-radius: 12px;
	color: var(--paper) !important;
	font-family: var(--serif);
	padding: 1.2rem 1.4rem;
}
