/* =============================================================================
   CSB Contact Forms – Stylesheet
   Alle Klassen sind eindeutig präfixiert mit "csb-contact-form__"
   und können in den Enfold-Einstellungen (CSS) überschrieben werden.
   ============================================================================= */

/* ---------------------------------------------------------------------------
   Wrapper & Layout
   --------------------------------------------------------------------------- */

.csb-contact-form-wrap {
	width: 100%;
	box-sizing: border-box;
}

.csb-contact-form__title {
	margin-bottom: 1.25em;
}

/* Flex-Zeile: alle Felder in einer Reihe, umbrechen bei Bedarf */
.csb-contact-form__fields {
	display: flex;
	flex-wrap: wrap;
	column-gap: 16px;
	margin-bottom: 16px;
}

/* ---------------------------------------------------------------------------
   Spaltenbreiten (überschreibbar via Custom CSS)
   --------------------------------------------------------------------------- */

.csb-contact-form__col--1-1 { flex: 0 0 100%; max-width: 100%; }
.csb-contact-form__col--1-2 { flex: 0 0 calc(50% - 8px);  max-width: calc(50% - 8px); }
.csb-contact-form__col--1-3 { flex: 0 0 calc(33.333% - 11px); max-width: calc(33.333% - 11px); }
.csb-contact-form__col--2-3 { flex: 0 0 calc(66.666% - 5px);  max-width: calc(66.666% - 5px); }
.csb-contact-form__col--1-4 { flex: 0 0 calc(25% - 12px); max-width: calc(25% - 12px); }
.csb-contact-form__col--3-4 { flex: 0 0 calc(75% - 4px);  max-width: calc(75% - 4px); }

/* Responsive: ab 600 px alles einspalt */
@media ( max-width: 600px ) {
	.csb-contact-form__col--1-1,
	.csb-contact-form__col--1-2,
	.csb-contact-form__col--1-3,
	.csb-contact-form__col--2-3,
	.csb-contact-form__col--1-4,
	.csb-contact-form__col--3-4 {
		flex: 0 0 100%;
		max-width: 100%;
	}
}

/* ---------------------------------------------------------------------------
   Feld-Wrapper
   --------------------------------------------------------------------------- */

.csb-contact-form__field-wrap {
	box-sizing: border-box;
}

.csb-contact-form__field-inner {
	display: flex;
	flex-direction: column;
	height: 100%;
}

/* ---------------------------------------------------------------------------
   Labels
   --------------------------------------------------------------------------- */

.csb-contact-form__label {
	display: block;
	margin-bottom: 5px;
	font-weight: 600;
	font-size: 0.9em;
}

.csb-contact-form__legend {
	font-weight: 600;
	font-size: 0.9em;
	margin-bottom: 6px;
	padding: 0;
	border: none;
	float: none;
	width: auto;
}

/* Pflicht-Markierung */
.csb-contact-form__required {
	color: #d32f2f;
	margin-left: 2px;
}

/* Screen-reader-only Text für Pflichtfeld-Info */
.screen-reader-text {
	clip: rect(1px, 1px, 1px, 1px);
	height: 1px;
	overflow: hidden;
	position: absolute;
	white-space: nowrap;
	width: 1px;
}

/* ---------------------------------------------------------------------------
   Eingabefelder
   --------------------------------------------------------------------------- */

.csb-contact-form__input,
.csb-contact-form__textarea,
.csb-contact-form__select {
	width: 100%;
	box-sizing: border-box;
	padding: 10px 14px;
	border: 1px solid #ccc;
	border-radius: 4px;
	font-size: 1em;
	font-family: inherit;
	color: inherit;
	background: #fff;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.csb-contact-form__input:focus,
.csb-contact-form__textarea:focus,
.csb-contact-form__select:focus {
	outline: none;
	border-color: #0073aa;
	box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.25);
}

/* Fehlerzustand */
.csb-contact-form__input[aria-invalid="true"],
.csb-contact-form__textarea[aria-invalid="true"],
.csb-contact-form__select[aria-invalid="true"] {
	border-color: #d32f2f;
	box-shadow: 0 0 0 2px rgba(211, 47, 47, 0.2);
}

.csb-contact-form__textarea {
	min-height: 130px;
	resize: vertical;
}

/* ---------------------------------------------------------------------------
   Checkboxen & Radio-Buttons
   --------------------------------------------------------------------------- */

.csb-contact-form__fieldset {
	border: none;
	margin: 0;
	padding: 0;
}

.csb-contact-form__checkbox-wrap,
.csb-contact-form__radio-wrap {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	margin-bottom: 6px;
}

.csb-contact-form__checkbox,
.csb-contact-form__radio {
	margin-top: 3px;
	flex-shrink: 0;
	width: 16px;
	height: 16px;
	cursor: pointer;
	accent-color: #0073aa;
}

.csb-contact-form__checkbox-label,
.csb-contact-form__radio-label {
	cursor: pointer;
	font-size: 0.95em;
	line-height: 1.4;
}

/* ---------------------------------------------------------------------------
   Dateiupload
   --------------------------------------------------------------------------- */

.csb-contact-form__file-wrap {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.csb-contact-form__file {
	font-size: 0.9em;
	padding: 6px 0;
}

.csb-contact-form__file-hint {
	font-size: 0.8em;
	color: #666;
}

/* ---------------------------------------------------------------------------
   Datenschutz-Checkbox (DSGVO)
   --------------------------------------------------------------------------- */

.csb-contact-form__privacy-wrap {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 12px;
	background: #f8f8f8;
	border: 1px solid #e0e0e0;
	border-radius: 4px;
}

.csb-contact-form__privacy-checkbox {
	margin-top: 3px;
	flex-shrink: 0;
	width: 18px;
	height: 18px;
	cursor: pointer;
	accent-color: #0073aa;
}

.csb-contact-form__privacy-label {
	font-size: 0.9em;
	line-height: 1.5;
	cursor: pointer;
}

.csb-contact-form__privacy-label a {
	color: #0073aa;
	text-decoration: underline;
}

/* ---------------------------------------------------------------------------
   Captcha-Bereich
   --------------------------------------------------------------------------- */

.csb-contact-form__captcha-wrap {
	margin-bottom: 16px;
}

/* ---------------------------------------------------------------------------
   Submit-Button
   --------------------------------------------------------------------------- */

.csb-contact-form__submit-wrap {
	margin-top: 8px;
}

.csb-contact-form__submit-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 12px 28px;
	background: #0073aa;
	color: #fff;
	border: none;
	border-radius: 4px;
	font-size: 1em;
	font-family: inherit;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.2s ease, opacity 0.2s ease;
}

.csb-contact-form__submit-btn:hover {
	background: #005a87;
}

.csb-contact-form__submit-btn:focus {
	outline: none;
	box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.4);
}

.csb-contact-form__submit-btn:disabled {
	cursor: not-allowed;
	opacity: 0.7;
}

/* Lade-Spinner */
.csb-contact-form__submit-spinner {
	display: inline-block;
	width: 16px;
	height: 16px;
	border: 2px solid rgba(255, 255, 255, 0.4);
	border-top-color: #fff;
	border-radius: 50%;
	animation: csb-spin 0.7s linear infinite;
	flex-shrink: 0;
}

@keyframes csb-spin {
	to { transform: rotate(360deg); }
}

/* ---------------------------------------------------------------------------
   Erfolgs- und Fehlermeldungen
   --------------------------------------------------------------------------- */

.csb-contact-form__success {
	padding: 16px 20px;
	background: #e8f5e9;
	border: 1px solid #a5d6a7;
	border-radius: 4px;
	color: #1b5e20;
	font-size: 1em;
	line-height: 1.5;
}

.csb-contact-form__error-general {
	padding: 14px 18px;
	background: #ffebee;
	border: 1px solid #ef9a9a;
	border-radius: 4px;
	color: #b71c1c;
	font-size: 0.95em;
	margin-bottom: 16px;
}

.csb-contact-form__field-error {
	display: block;
	margin-top: 4px;
	color: #d32f2f;
	font-size: 0.82em;
	line-height: 1.4;
}

/* ---------------------------------------------------------------------------
   Honeypot (nie sichtbar machen)
   --------------------------------------------------------------------------- */

.csb-contact-form__honeypot {
	position: absolute !important;
	left: -9999px !important;
	top: -9999px !important;
	opacity: 0 !important;
	height: 0 !important;
	overflow: hidden !important;
	pointer-events: none !important;
}
