/*
 * Formie (v4) – Frontend-Styles CITEC Suisse
 *
 * Formie lädt sein Theme mit `useCssLayers => true` in einem CSS-Layer.
 * Diese Datei ist bewusst NICHT gelayert und gewinnt daher ohne !important.
 * Selektoren sind mit #mainbody gescoped, um die globalen Regeln aus
 * bootstrap.css / citec.css / form.css (z. B. `#mainbody input`,
 * `label { width: 200px }`) sauber zu überschreiben.
 *
 * Abstände (identisch zum bisherigen Formular):
 *   Label → Feld: 5px · Feld → Feld: 10px · letztes Feld → Button: 10px
 */

#mainbody .formie-form {
	--cs-text: #333;
	--cs-muted: #666;
	--cs-border: #999;
	--cs-border-hover: #666;
	--cs-accent: #dc911b;        /* Orange der Links/Buttons */
	--cs-accent-dark: #b8740f;
	--cs-focus: rgba(220, 145, 27, .25);
	--cs-error: #b00020;
	--cs-field-height: 40px;

	font-family: Verdana, Arial, sans-serif;
	font-size: 15px;
	line-height: 1.4;
	color: var(--cs-text);
	max-width: 100%;
}

/* ---------- Abstände ---------- */
#mainbody .formie-form .formie-row {
	gap: 10px;
	margin-bottom: 10px;
}

#mainbody .formie-form .formie-field {
	margin: 0;
	padding: 0;
}

/* ---------- Labels ---------- */
#mainbody .formie-form label,
#mainbody .formie-form legend {
	display: block;
	width: auto;                 /* hebt `label { width: 200px }` aus citec.css auf */
	max-width: 100%;
	margin: 0 0 5px;
	padding: 0;
	border: 0;
	font-family: inherit;
	font-size: 15px;
	font-weight: bold;
	line-height: 20px;
	color: var(--cs-text);
}

#mainbody .formie-form .formie-required {
	color: var(--cs-accent);
}

#mainbody .formie-form .formie-instructions {
	margin: -2px 0 5px;
	font-size: 13px;
	color: var(--cs-muted);
}

/* ---------- Eingabefelder ---------- */
#mainbody .formie-form input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="hidden"]):not([type="file"]),
#mainbody .formie-form select,
#mainbody .formie-form textarea {
	display: block;
	box-sizing: border-box;
	width: 100%;
	min-height: var(--cs-field-height);
	margin: 0;
	padding: 8px 12px;
	border: 1px solid var(--cs-border);
	border-radius: 2px;
	background-color: #fff;
	box-shadow: none;
	font-family: inherit;
	font-size: 15px;             /* Bootstrap setzt html auf 10px → rem-Werte aus dem Theme wären zu klein */
	line-height: 1.4;
	color: var(--cs-text);
	transition: border-color .15s ease, box-shadow .15s ease;
}

#mainbody .formie-form input:hover,
#mainbody .formie-form select:hover,
#mainbody .formie-form textarea:hover {
	border-color: var(--cs-border-hover);
}

#mainbody .formie-form input:focus,
#mainbody .formie-form select:focus,
#mainbody .formie-form textarea:focus {
	outline: none;
	border-color: var(--cs-accent);
	box-shadow: 0 0 0 3px var(--cs-focus);
}

#mainbody .formie-form ::placeholder {
	color: #999;
	opacity: 1;
}

/* Dropdown: Platz für den Pfeil des Formie-Themes */
#mainbody .formie-form select {
	height: var(--cs-field-height);
	padding-right: 36px;
	cursor: pointer;
}

/* Mehrzeiliger Text */
#mainbody .formie-form textarea {
	height: auto;
	min-height: 140px;
	resize: vertical;
}

/* Checkboxen / Radios */
#mainbody .formie-form input[type="checkbox"] + label,
#mainbody .formie-form input[type="radio"] + label {
	display: inline-block;
	margin-bottom: 0;
	font-weight: normal;
}

/* ---------- Fehler ---------- */
#mainbody .formie-form .formie-error input,
#mainbody .formie-form .formie-error select,
#mainbody .formie-form .formie-error textarea {
	border-color: var(--cs-error);
}

#mainbody .formie-form .formie-error-message {
	margin-top: 4px;
	font-size: 13px;
	color: var(--cs-error);
}

/* ---------- Button ---------- */
#mainbody .formie-form .formie-btn-wrapper,
#mainbody .formie-form .formie-btn-container {
	padding-top: 10px;
	margin: 0;
}

#mainbody .formie-form button[type="submit"],
#mainbody .formie-form .formie-submit {
	display: inline-block;
	width: auto;
	min-height: var(--cs-field-height);
	padding: 10px 28px;
	border: 0;
	border-radius: 2px;
	background: var(--cs-accent);
	font-family: inherit;
	font-size: 15px;
	font-weight: bold;
	line-height: 20px;
	color: #fff;
	cursor: pointer;
	transition: background-color .15s ease;
}

#mainbody .formie-form button[type="submit"]:hover,
#mainbody .formie-form button[type="submit"]:focus-visible,
#mainbody .formie-form .formie-submit:hover {
	background: var(--cs-accent-dark);
	color: #fff;
}

#mainbody .formie-form button[type="submit"]:focus-visible {
	outline: none;
	box-shadow: 0 0 0 3px var(--cs-focus);
}

/* ---------- Erfolgs-/Fehlermeldung des Formulars ---------- */
#mainbody .formie-alert {
	margin-bottom: 15px;
	padding: 12px 15px;
	border-radius: 2px;
	font-size: 15px;
}

/* ---------- reCAPTCHA ----------
 * Badge darf nicht display:none sein (sonst schlägt v3/invisible fehl).
 */
.grecaptcha-badge {
	visibility: hidden;
	pointer-events: none;
}
