/**
 * Mobile Safari / iOS: abgeschnittene Datums- und Eingabefelder
 * Global für alle FBM-Plugins (lädt spät nach Plugin-CSS).
 */

/* Flex/Grid: Kinder dürfen schrumpfen */
.fbm-form-row,
.fbm-form-row.two-columns,
.fbm-form-group,
.fbm-form-row .fbm-form-group,
.fbm-custom-form-container,
.fbm-ui-modal-container:not(.fbm-legal-modal-container):not(.fbm-calendar-contact-modal-container):not(.fbm-ui-modal-container--compact),
.fbm-ui-modal-body,
.fbm-ui-modal-content,
.fbm-modal-container,
.fbmp-profile-card,
.fbmp-profile-section,
.fbm-cfw-panel,
.fbm-cfw__field,
.fbm-cfw__grid,
.fbm-contacts-edit-modal-container {
	min-width: 0;
	max-width: 100%;
}

/* Kein Clipping an Datums-Wrappern */
.fbm-date-input {
	overflow: visible;
}

/* Formular-Container: auf schmalen Screens nicht horizontal clippen */
@media (max-width: 768px) {
	.fbm-custom-form-container,
	.fbm-auth-container .fbm-custom-form-container,
	.fbm-ui-modal-body,
	.fbm-ui-modal-content,
	.fbm-contacts-edit-modal-container,
	.fbm-calendar-form-modal-root .fbm-ui-modal-body,
	.fbm-calendar-form-modal-root .fbm-ui-modal-content {
		overflow-x: visible;
	}
}

/* Alle FBM-Formularsteuerungen: volle Breite, kein Überlauf */
.fbm-form-group input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.fbm-form-group select,
.fbm-form-group textarea,
.fbm-form-control,
.fbm-settings-field-input,
.fbm-cfw-panel input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.fbm-cfw-panel select,
.fbm-cfw-panel textarea,
.fbm-cfw__field input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.fbm-cfw__field select,
.fbm-cfw__field textarea,
.form-group input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.form-group select,
.form-group textarea {
	box-sizing: border-box;
	display: block;
	inline-size: 100%;
	width: 100%;
	max-width: 100%;
	min-width: 0;
}

/* Datums-/Zeitfelder: iOS Mindestbreite neutralisieren */
.fbm-form-group input[type="date"],
.fbm-form-group input[type="time"],
.fbm-form-group input[type="datetime-local"],
.fbm-form-group input[type="month"],
.fbm-form-group input[type="week"],
.fbm-form-control[type="date"],
.fbm-form-control[type="time"],
.fbm-form-control[type="datetime-local"],
.fbm-settings-field-input[type="date"],
.fbm-settings-field-input[type="datetime-local"],
.fbm-cfw-panel input[type="date"],
.fbm-cfw-panel input[type="time"],
.fbm-cfw-panel input[type="datetime-local"],
.fbm-date-input input[type="date"],
#fbm-calendar-entry-form input[type="date"],
#fbm-calendar-entry-form input[type="time"],
#fbm-calendar-entry-form input[type="datetime-local"] {
	-webkit-min-logical-width: 0;
	min-height: 44px;
	line-height: 1.25;
}

/* iOS: interner Datums-/Zeit-Text wird sonst rechts abgeschnitten */
.fbm-form-group input[type="date"]::-webkit-date-and-time-value,
.fbm-form-group input[type="time"]::-webkit-date-and-time-value,
.fbm-form-group input[type="datetime-local"]::-webkit-date-and-time-value,
.fbm-form-control[type="date"]::-webkit-date-and-time-value,
.fbm-form-control[type="time"]::-webkit-date-and-time-value,
.fbm-form-control[type="datetime-local"]::-webkit-date-and-time-value,
.fbm-settings-field-input[type="date"]::-webkit-date-and-time-value,
.fbm-settings-field-input[type="datetime-local"]::-webkit-date-and-time-value,
.fbm-cfw-panel input[type="date"]::-webkit-date-and-time-value,
.fbm-cfw-panel input[type="time"]::-webkit-date-and-time-value,
.fbm-date-input input[type="date"]::-webkit-date-and-time-value,
#fbm-calendar-entry-form input[type="date"]::-webkit-date-and-time-value,
#fbm-calendar-entry-form input[type="time"]::-webkit-date-and-time-value,
#fbm-calendar-entry-form input[type="datetime-local"]::-webkit-date-and-time-value {
	display: block;
	min-width: 0;
	overflow: visible;
	text-align: left;
	margin: 0;
	padding: 0;
}

/* iOS Safari: -webkit-fill-available (wie Kalender-Plugin) */
@supports (-webkit-touch-callout: none) {
	.fbm-form-group input[type="date"],
	.fbm-form-group input[type="time"],
	.fbm-form-group input[type="datetime-local"],
	.fbm-form-control[type="date"],
	.fbm-form-control[type="time"],
	.fbm-form-control[type="datetime-local"],
	.fbm-settings-field-input[type="date"],
	.fbm-settings-field-input[type="datetime-local"],
	.fbm-cfw-panel input[type="date"],
	.fbm-cfw-panel input[type="time"],
	.fbm-date-input input[type="date"],
	#fbm-calendar-entry-form input[type="date"],
	#fbm-calendar-entry-form input[type="time"],
	#fbm-calendar-entry-form input[type="datetime-local"] {
		width: -webkit-fill-available;
		max-width: -webkit-fill-available;
	}
}

/* Mobile: 16px verhindert Zoom und verbessert Lesbarkeit */
@media (max-width: 768px) {
	.fbm-form-group input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
	.fbm-form-group select,
	.fbm-form-group textarea,
	.fbm-form-control,
	.fbm-settings-field-input,
	.fbm-cfw-panel input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
	.fbm-cfw-panel select,
	.fbm-cfw-panel textarea,
	.fbm-cfw__field input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
	.fbm-cfw__field select,
	.fbm-cfw__field textarea,
	.form-group input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
	.form-group select,
	.form-group textarea {
		font-size: 16px;
	}

	.fbm-form-row,
	.fbm-form-row.two-columns {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 480px) {
	.fbm-custom-form-container {
		padding-left: max(16px, env(safe-area-inset-left, 0px));
		padding-right: max(16px, env(safe-area-inset-right, 0px));
	}
}
