/* it-motive Design Kit – Formulare (Frontend, ab 3.41) */

.itm-fm-wrapper {
	--fm-accent: #2b6cb0;
	--fm-error: #c53030;
	--fm-border: #c9d0d8;
	--fm-radius: 6px;
	--fm-gap: 18px;
	--fm-col-gap: 20px;

	/* !important: Thrive setzt in seinen Containern teils content-box. */
	box-sizing: border-box !important;
	position: relative;
	width: 100%;
	max-width: 100%;
	color: #1f2933;
}

.itm-fm-wrapper *,
.itm-fm-wrapper *::before,
.itm-fm-wrapper *::after {
	box-sizing: border-box !important;
}

.itm-fm-form {
	margin: 0;
}

.itm-fm-form[hidden],
.itm-fm-success[hidden],
.itm-fm-error[hidden],
.itm-fm-message[hidden] {
	display: none !important;
}

.itm-fm-sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

.itm-fm-required-note {
	margin: 0 0 14px;
	color: #5b6673;
	font-size: 0.85rem;
}

.itm-fm-req {
	margin-left: 2px;
	color: var(--fm-error);
}

/* ---------- Raster: zweispaltig nur ab Tablet ---------- */
.itm-fm-fields {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--fm-gap) var(--fm-col-gap);
}

@media (min-width: 640px) {
	.itm-fm-wrapper.cols-2 .itm-fm-fields {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.itm-fm-wrapper.cols-2 .itm-fm-field.width-full {
		grid-column: 1 / -1;
	}
}

/* ---------- Feld ---------- */
.itm-fm-field {
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
}

.itm-fm-label {
	display: block;
	margin: 0 0 6px;
	padding: 0;
	color: inherit;
	font-size: 0.95rem;
	font-weight: 600;
	line-height: 1.4;
}

.itm-fm-help {
	margin: -2px 0 8px;
	color: #5b6673;
	font-size: 0.85rem;
	line-height: 1.45;
}

.itm-fm-input {
	display: block;
	width: 100%;
	max-width: 100%;
	min-height: 44px;
	margin: 0;
	padding: 10px 12px;
	border: 1px solid var(--fm-border);
	border-radius: var(--fm-radius);
	background: #fff;
	box-shadow: none;
	color: inherit;
	font: inherit;
	font-size: 1rem;
	line-height: 1.4;
	transition: border-color 0.2s, box-shadow 0.2s;
}

textarea.itm-fm-input {
	min-height: 120px;
	resize: vertical;
}

.itm-fm-input:focus {
	border-color: var(--fm-accent);
	outline: 2px solid var(--fm-accent);
	outline-offset: 0;
}

.itm-fm-field.is-invalid .itm-fm-input {
	border-color: var(--fm-error);
}

.itm-fm-error {
	margin: 6px 0 0;
	color: var(--fm-error);
	font-size: 0.85rem;
	font-weight: 600;
}

/* Auswahl und Einwilligung */
.itm-fm-options {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.itm-fm-check {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin: 0;
	font-weight: 400;
	line-height: 1.45;
	cursor: pointer;
}

.itm-fm-check input {
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
	margin: 2px 0 0;
	accent-color: var(--fm-accent);
}

.itm-fm-check input:focus-visible {
	outline: 2px solid var(--fm-accent);
	outline-offset: 2px;
}

.itm-fm-consent {
	font-size: 0.92rem;
}

.itm-fm-consent a {
	color: var(--fm-accent);
}

.itm-fm-field.is-invalid .itm-fm-check input {
	outline: 2px solid var(--fm-error);
	outline-offset: 1px;
}

.itm-fm-heading {
	margin: 10px 0 4px !important;
	padding: 0;
	color: inherit;
	font-size: 1.15rem;
	font-weight: 700;
	line-height: 1.35;
}

/* Fallenfeld für Bots: außerhalb des Sichtbereichs (nicht display:none, das erkennen manche Bots). */
.itm-fm-hp {
	position: absolute !important;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* ---------- Button und Meldungen ---------- */
.itm-fm-actions {
	display: flex;
	margin-top: 22px;
}

.itm-fm-wrapper.btn-center .itm-fm-actions {
	justify-content: center;
}

.itm-fm-submit {
	min-height: 46px;
	margin: 0;
	padding: 12px 28px;
	border: 0;
	border-radius: var(--fm-radius);
	background: var(--fm-accent);
	color: #fff;
	font: inherit;
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	transition: filter 0.2s, opacity 0.2s;
}

.itm-fm-wrapper.btn-full .itm-fm-submit {
	width: 100%;
}

.itm-fm-submit:hover {
	filter: brightness(1.08);
}

.itm-fm-submit:focus-visible {
	outline: 2px solid var(--fm-accent);
	outline-offset: 3px;
}

.itm-fm-submit:disabled {
	cursor: wait;
	opacity: 0.7;
}

.itm-fm-message {
	margin: 14px 0 0;
	font-size: 0.95rem;
}

.itm-fm-message.is-error {
	color: var(--fm-error);
	font-weight: 600;
}

.itm-fm-success {
	padding: 24px;
	border-left: 4px solid var(--fm-accent);
	border-radius: var(--fm-radius);
	background: #f0f6fc;
}

.itm-fm-success:focus {
	outline: none;
}

.itm-fm-success-title {
	margin: 0 0 6px;
	font-size: 1.2rem;
	font-weight: 700;
}

.itm-fm-success-text p {
	margin: 0 0 0.6em;
}

.itm-fm-success-text p:last-child {
	margin-bottom: 0;
}

.itm-fm-preview-note {
	margin: 0 0 12px;
	color: #8a5a00;
	font-size: 0.85rem;
}

/* ---------- Ab 3.42: Bedingungen, Schritte, Zusammenfassung, Anmeldung ---------- */
.itm-fm-field[hidden],
.itm-fm-seats[hidden],
.itm-fm-notice[hidden],
.itm-fm-closed[hidden],
.itm-fm-prev[hidden],
.itm-fm-next[hidden],
.itm-fm-submit[hidden],
.itm-fm-success-main[hidden],
.itm-fm-success-waitlist[hidden],
.itm-fm-progress-steps li[hidden] {
	display: none !important;
}

/* Schritte: erst mit Script nur den aktuellen zeigen (ohne Script alle untereinander). */
.itm-fm-wrapper.is-steps-ready .itm-fm-step:not(.is-current) {
	display: none;
}

.itm-fm-wrapper.is-demo-all .itm-fm-step {
	display: block !important;
}

.itm-fm-step + .itm-fm-step {
	margin-top: var(--fm-gap);
}

.itm-fm-progress {
	margin: 0 0 20px;
}

.itm-fm-progress-label {
	margin: 0 0 6px;
	color: #5b6673;
	font-size: 0.85rem;
	font-weight: 600;
}

.itm-fm-progress-track {
	height: 6px;
	overflow: hidden;
	border-radius: 999px;
	background: var(--fm-track, #e2e8f0);
}

.itm-fm-progress-bar {
	display: block;
	height: 100%;
	border-radius: inherit;
	background: var(--fm-accent);
	transition: width 0.3s ease;
}

.itm-fm-progress-steps {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 18px;
	margin: 0;
	padding: 0;
	list-style: none;
	counter-reset: none;
}

.itm-fm-progress-steps li {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	color: #5b6673;
	font-size: 0.9rem;
}

.itm-fm-progress-num {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	border: 2px solid var(--fm-track, #e2e8f0);
	border-radius: 50%;
	background: #fff;
	font-size: 0.8rem;
	font-weight: 700;
}

.itm-fm-progress-steps li.is-done .itm-fm-progress-num {
	border-color: var(--fm-accent);
	color: var(--fm-accent);
}

.itm-fm-progress-steps li.is-current {
	color: inherit;
	font-weight: 600;
}

.itm-fm-progress-steps li.is-current .itm-fm-progress-num {
	border-color: var(--fm-accent);
	background: var(--fm-accent);
	color: #fff;
}

.itm-fm-wrapper.has-steps .itm-fm-actions {
	gap: 12px;
}

.itm-fm-wrapper.has-steps.btn-full .itm-fm-actions > button {
	flex: 1 1 0;
}

.itm-fm-next {
	min-height: 46px;
	margin: 0;
	padding: 12px 28px;
	border: 0;
	border-radius: var(--fm-radius);
	background: var(--fm-accent);
	color: #fff;
	font: inherit;
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
}

.itm-fm-prev {
	min-height: 46px;
	margin: 0;
	padding: 12px 22px;
	border: 1px solid var(--fm-border);
	border-radius: var(--fm-radius);
	background: #fff;
	color: inherit;
	font: inherit;
	font-size: 1rem;
	line-height: 1.2;
	cursor: pointer;
}

.itm-fm-next:hover {
	filter: brightness(1.08);
}

.itm-fm-prev:hover {
	border-color: var(--fm-accent);
}

.itm-fm-next:focus-visible,
.itm-fm-prev:focus-visible,
.itm-fm-summary-edit:focus-visible {
	outline: 2px solid var(--fm-accent);
	outline-offset: 3px;
}

/* Zusammenfassung */
.itm-fm-summary {
	margin: 0;
	padding: 0;
	border-top: 1px solid var(--fm-border);
}

.itm-fm-summary-row {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 2px 16px;
	padding: 10px 0;
	border-bottom: 1px solid var(--fm-border);
}

@media (min-width: 640px) {
	.itm-fm-summary-row {
		grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
	}
}

.itm-fm-summary dt {
	margin: 0;
	color: #5b6673;
	font-size: 0.9rem;
	font-weight: 600;
}

.itm-fm-summary dd {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 4px 12px;
	margin: 0;
}

.itm-fm-summary-value {
	white-space: pre-line;
	overflow-wrap: anywhere;
}

.itm-fm-summary-edit {
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	color: var(--fm-accent);
	font: inherit;
	font-size: 0.85rem;
	text-decoration: underline;
	cursor: pointer;
}

/* Anmeldung: freie Plätze, Warteliste, geschlossen */
.itm-fm-seats {
	display: inline-block;
	margin: 0 0 14px;
	padding: 4px 12px;
	border-radius: 999px;
	background: var(--fm-seats-bg, #fff4e5);
	color: var(--fm-seats-color, #8a4b00);
	font-size: 0.9rem;
	font-weight: 600;
}

.itm-fm-notice,
.itm-fm-closed {
	margin: 0 0 16px;
	padding: 14px 16px;
	border-left: 4px solid var(--fm-notice-border, #d69e2e);
	border-radius: var(--fm-radius);
	background: var(--fm-notice-bg, #fffaf0);
	font-size: 0.95rem;
	line-height: 1.5;
}

.itm-fm-closed p {
	margin: 0;
}

.itm-fm-success-waitlist + .itm-fm-success-main,
.itm-fm-success-main + .itm-fm-success-waitlist {
	margin-top: 16px;
}

/* ---------- Ab 3.44: Datei-Upload ---------- */
.itm-fm-file-zone {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 96px;
	padding: 18px 16px;
	border: 2px dashed var(--fm-border);
	border-radius: var(--fm-radius);
	background: var(--fm-file-bg, #f8fafc);
	color: #5b6673;
	text-align: center;
	transition: border-color 0.2s, background-color 0.2s;
}

.itm-fm-file-zone:hover,
.itm-fm-file-zone.is-dragover {
	border-color: var(--fm-accent);
	background: #f0f6fc;
}

.itm-fm-file-zone:focus-within {
	border-color: var(--fm-accent);
	outline: 2px solid var(--fm-accent);
	outline-offset: 2px;
}

/* Das echte Feld liegt unsichtbar über der Fläche: Klick und Ablegen funktionieren direkt. */
.itm-fm-file-input {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	opacity: 0;
	cursor: pointer;
}

.itm-fm-file-text {
	pointer-events: none;
	font-size: 0.95rem;
	line-height: 1.45;
}

.itm-fm-file-text strong {
	color: var(--fm-accent);
}

.itm-fm-file-icon {
	display: block;
	width: 26px;
	height: 26px;
	margin: 0 auto 6px;
	background: var(--fm-accent);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M19.35 10.04A7.49 7.49 0 0 0 12 4C9.11 4 6.6 5.64 5.35 8.04A5.994 5.994 0 0 0 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM14 13v4h-4v-4H7l5-5 5 5h-3z'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M19.35 10.04A7.49 7.49 0 0 0 12 4C9.11 4 6.6 5.64 5.35 8.04A5.994 5.994 0 0 0 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM14 13v4h-4v-4H7l5-5 5 5h-3z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.itm-fm-file-hint {
	margin: 6px 0 0;
	color: #5b6673;
	font-size: 0.8rem;
}

.itm-fm-file-list {
	margin: 8px 0 0;
	padding: 0;
	list-style: none;
}

.itm-fm-file-list:empty {
	display: none;
}

.itm-fm-file-list li {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0 0 6px;
	padding: 8px 10px;
	border: 1px solid var(--fm-border);
	border-radius: var(--fm-radius);
	background: #fff;
	font-size: 0.9rem;
}

.itm-fm-file-name {
	flex: 1 1 auto;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.itm-fm-file-size {
	flex: 0 0 auto;
	color: #5b6673;
	font-size: 0.8rem;
}

.itm-fm-file-remove {
	flex: 0 0 auto;
	width: 28px;
	height: 28px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: #5b6673;
	font-size: 18px;
	line-height: 28px;
	cursor: pointer;
}

.itm-fm-file-remove:hover,
.itm-fm-file-remove:focus-visible {
	background: #fde8e8;
	color: var(--fm-error);
	outline: none;
}

.itm-fm-field.is-invalid .itm-fm-file-zone {
	border-color: var(--fm-error);
}

/* ---------- Ab 3.44.1: gegen Theme-Stile für Absätze absichern ----------
   Manche Themes (z. B. Thrive Theme) setzen p { color; font-size; margin } mit höherer Spezifität. Meldungen und
   Hinweise sind <p> – sie wurden dadurch schwarz und groß. Design-Werte aus dem Symbol bleiben stärker
   (#instanz … !important). */
.itm-fm-wrapper .itm-fm-error,
.itm-fm-wrapper .itm-fm-message.is-error {
	color: var(--fm-error) !important;
	font-size: 0.85rem !important;
	font-weight: 600 !important;
	line-height: 1.4 !important;
}

.itm-fm-wrapper .itm-fm-error {
	margin: 6px 0 0 !important;
}

.itm-fm-wrapper .itm-fm-message {
	margin: 14px 0 0 !important;
	font-size: 0.95rem !important;
	line-height: 1.45 !important;
}

.itm-fm-wrapper .itm-fm-help,
.itm-fm-wrapper .itm-fm-file-hint,
.itm-fm-wrapper .itm-fm-required-note {
	color: #5b6673 !important;
	font-size: 0.85rem !important;
	line-height: 1.45 !important;
}

.itm-fm-wrapper .itm-fm-help {
	margin: -2px 0 8px !important;
}

.itm-fm-wrapper .itm-fm-success-title {
	margin: 0 0 6px !important;
	font-size: 1.2rem !important;
	font-weight: 700 !important;
	line-height: 1.3 !important;
}

.itm-fm-wrapper .itm-fm-success-text p {
	margin: 0 0 0.6em !important;
}

/* Fokus/Sprung zu einem Feld: Platz für feste Seitenköpfe lassen (ab 3.44.1). */
.itm-fm-wrapper .itm-fm-field,
.itm-fm-wrapper .itm-fm-success,
.itm-fm-wrapper {
	scroll-margin-top: var(--itm-dk-scroll-offset, 120px);
}
