.sfem-wrapper {
	width: 100%;
	max-width: 720px;
	margin: 1.5rem 0;
	container-type: inline-size;
}

.sfem-form {
	display: grid;
	gap: var(--sfem-row-gap, 16px);
	direction: inherit;
}

.sfem-form-title {
	margin: 0 0 0.5rem;
}

.sfem-form-description {
	margin-bottom: 1rem;
	color: #4b5563;
}

.sfem-fields-grid {
	display: grid;
	grid-template-columns: repeat(var(--sfem-columns-desktop, 1), minmax(0, 1fr));
	column-gap: var(--sfem-field-gap, 16px);
	row-gap: var(--sfem-row-gap, 16px);
}

.sfem-field {
	display: grid;
	gap: 0.4rem;
	min-width: 0;
}

.sfem-layout-vertical .sfem-fields-grid {
	grid-template-columns: 1fr;
}

.sfem-layout-two_columns .sfem-fields-grid {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.sfem-layout-inline .sfem-fields-grid {
	align-items: end;
}

.sfem-width-100 {
	grid-column: span var(--sfem-columns-desktop, 1);
}

.sfem-width-50 {
	grid-column: span 1;
}

.sfem-width-33,
.sfem-width-25 {
	grid-column: span 1;
}

.sfem-label {
	font-weight: 600;
}

.sfem-required {
	color: #b32d2e;
}

.sfem-form input[type="text"],
.sfem-form input[type="email"],
.sfem-form input[type="tel"],
.sfem-form input[type="number"],
.sfem-form input[type="date"],
.sfem-form input[type="time"],
.sfem-form input[type="url"],
.sfem-form input[type="file"],
.sfem-form select,
.sfem-form textarea {
	width: 100%;
	max-width: 100%;
	border: 1px solid #c3c4c7;
	border-radius: 6px;
	padding: 0.7rem 0.8rem;
	background: #fff;
	color: #1d2327;
	font: inherit;
	box-sizing: border-box;
}

.sfem-form textarea {
	min-height: 120px;
	resize: vertical;
}

.sfem-form input:focus,
.sfem-form select:focus,
.sfem-form textarea:focus {
	outline: 3px solid rgba(34, 113, 177, 0.15);
	outline-offset: 0;
	border-color: #2271b1;
}

.sfem-input-affix {
	display: flex;
	align-items: stretch;
}

.sfem-input-affix span {
	display: inline-flex;
	align-items: center;
	border: 1px solid #c3c4c7;
	background: #f6f7f7;
	padding: 0 0.75rem;
	color: #50575e;
}

.sfem-input-affix span:first-child {
	border-radius: 6px 0 0 6px;
	border-right: 0;
}

.sfem-input-affix span:last-child {
	border-radius: 0 6px 6px 0;
	border-left: 0;
}

.sfem-input-affix input {
	border-radius: 0;
}

.sfem-choices {
	display: grid;
	gap: 0.45rem;
}

.sfem-choices-horizontal {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem 1rem;
}

.sfem-choices-cards {
	grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.sfem-choice {
	display: flex;
	gap: 0.5rem;
	align-items: flex-start;
}

.sfem-choices-cards .sfem-choice {
	border: 1px solid #c3c4c7;
	border-radius: 6px;
	padding: 0.75rem;
	background: #fff;
}

.sfem-help {
	color: #646970;
	font-size: 0.92rem;
}

.sfem-error,
.sfem-form-errors {
	color: #b32d2e;
	font-size: 0.92rem;
}

.sfem-form-errors {
	display: none;
	border: 1px solid #f0b7bd;
	border-radius: 4px;
	padding: 0.75rem;
	background: #fcf0f1;
}

.sfem-form-errors.is-visible {
	display: block;
}

.sfem-field-has-error input,
.sfem-field-has-error select,
.sfem-field-has-error textarea {
	border-color: #b32d2e;
}

.sfem-message {
	border-radius: 4px;
	padding: 0.85rem 1rem;
	margin-bottom: 1rem;
}

.sfem-success {
	background: #edfaef;
	border: 1px solid #8bd69b;
	color: #0a6b24;
}

.sfem-message.sfem-error {
	background: #fcf0f1;
	border: 1px solid #f0b7bd;
	color: #b32d2e;
}

.sfem-submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 42px;
	border: 0;
	border-radius: 6px;
	padding: 0.7rem 1.1rem;
	background: #1d2327;
	color: #fff;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.sfem-button-align-center .sfem-submit-field {
	justify-content: center;
}

.sfem-button-align-right .sfem-submit-field {
	justify-content: end;
}

.sfem-button-align-stretch .sfem-submit {
	width: 100%;
}

.sfem-submit-field {
	display: flex;
}

.sfem-submit:hover,
.sfem-submit:focus {
	background: #2271b1;
	color: #fff;
}

.sfem-submit.is-busy {
	opacity: 0.7;
	cursor: wait;
}

.sfem-hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.sfem-conditional-hidden {
	display: none !important;
}

.sfem-counter {
	color: #646970;
	font-size: 0.82rem;
	text-align: end;
}

.sfem-admin-message {
	border: 1px solid #dcdcde;
	padding: 0.75rem;
	background: #fff;
	color: #1d2327;
}

@media (max-width: 600px) {
	.sfem-wrapper {
		max-width: 100%;
	}

	.sfem-fields-grid {
		grid-template-columns: repeat(var(--sfem-columns-mobile, 1), minmax(0, 1fr));
	}

	.sfem-field {
		grid-column: 1 / -1;
	}

	.sfem-mobile-button-full .sfem-submit {
		width: 100%;
	}
}

@media (min-width: 601px) and (max-width: 900px) {
	.sfem-fields-grid {
		grid-template-columns: repeat(var(--sfem-columns-tablet, 1), minmax(0, 1fr));
	}
}
