/**
 * FastFormz / SO Forms — BEM-scoped front styles (CSS variables from inline style on .so-form).
 */
.so-form__wrapper {
	box-sizing: border-box;
}
.so-form__wrapper *,
.so-form__wrapper *::before,
.so-form__wrapper *::after {
	box-sizing: inherit;
}

.so-form {
	max-width: var(--so-container-max-width, 720px);
	margin: 0 auto;
	padding: var(--so-container-padding, 24px);
	background: var(--so-container-bg, #fff);
	border-radius: var(--so-container-radius, 8px);
	box-shadow: var(--so-container-shadow, 0 1px 3px rgba(0, 0, 0, 0.08));
	border-style: solid;
	border-color: var(--so-container-border-color, #c3c4c7);
	border-width: var(--so-container-border-width, 0px);
}

/*
 * Embedded-in-modal safety:
 * Some popup/modal implementations put content into a fixed-height, scrollable, flex column container.
 * If the form becomes a flex item, it can be stretched to the container height and create "filler space"
 * between the last field and the submit actions. Default to content-sized behavior.
 */
.so-form__wrapper form.so-form,
.so-form__wrapper .so-form.so-form {
	height: auto !important;
	min-height: 0 !important;
	flex: 0 0 auto !important;
	align-self: flex-start !important;
	/* If a modal theme/plugin forces full-height flex layouts on forms, undo it. */
	display: block !important;
	justify-content: flex-start !important;
}
.so-form__wrapper form.so-form > .so-form__layout,
.so-form__wrapper .so-form.so-form > .so-form__layout {
	min-height: 0 !important;
	flex: 0 0 auto !important;
}
.so-form__wrapper form.so-form > .so-form__actions,
.so-form__wrapper .so-form.so-form > .so-form__actions {
	position: static;
	margin-top: 1.25rem !important;
}

.so-form[data-so-container-border-shape="none"] {
	border-width: 0;
	border-color: transparent;
}

.so-form[data-so-container-border-shape="square"] {
	border-radius: 0;
}

.so-form[data-so-container-border-shape="rounded"] {
	border-radius: var(--so-container-radius, 8px);
}

.so-form__layout {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

/* Form headline (settings): inside bordered .so-form */
.so-form__headline {
	margin: 0 0 1rem;
	line-height: 1.35;
	word-wrap: break-word;
}

.so-form__headline--plain {
	font-size: var(--so-label-size, 14px);
	font-weight: var(--so-label-weight, 600);
}

.so-form__headline__plain {
	margin: 0;
}

/* Theme/popup heading rules often override color:inherit; use headline token + higher specificity. */
.so-form__wrapper .so-form .so-form__headline--plain,
.so-form__wrapper .so-form .so-form__headline--plain .so-form__headline__plain {
	color: var(--so-form-headline-color, inherit) !important;
}

.so-form__wrapper .so-form .so-form__headline--rich .so-form__headline__inner,
.so-form__wrapper .so-form .so-form__headline--rich .so-form__headline__inner :where(h1, h2, h3, h4, h5, h6, p, li, span, a, strong, em, b, i) {
	color: var(--so-form-headline-color, inherit) !important;
}

.so-form__headline--rich .so-form__headline__inner > :first-child {
	margin-top: 0;
}

.so-form__headline--rich .so-form__headline__inner > :last-child {
	margin-bottom: 0;
}

.so-form__headline--rich h1,
.so-form__headline--rich h2,
.so-form__headline--rich h3,
.so-form__headline--rich h4,
.so-form__headline--rich h5,
.so-form__headline--rich h6 {
	font-family: inherit;
	line-height: 1.25;
	margin: 0.45em 0;
}

.so-form__headline--rich p {
	margin: 0.4em 0;
}

.so-form__headline--rich a {
	text-decoration: underline;
}

.so-form__headline--rich strong,
.so-form__headline--rich b {
	font-weight: 700;
}

.so-form__row {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
}

.so-form__col {
	flex: 1 1 220px;
	min-width: 0;
}

.so-form__field {
	margin-bottom: 0.75rem;
}

.so-form__label,
.so-form__legend {
	display: block;
	margin-bottom: 0.35rem;
	font-size: var(--so-label-size, 14px);
	font-weight: var(--so-label-weight, 600);
}

.so-form__wrapper .so-form .so-form__label,
.so-form__wrapper .so-form .so-form__legend {
	color: var(--so-label-color, #1d2327) !important;
}

/* Labels inside inputs (compact forms); hidden once the field has a value. */
.so-form--inside-labels .so-form__field--inside-label {
	position: relative;
}

.so-form__wrapper .so-form.so-form--inside-labels .so-form__inside-label {
	position: absolute;
	left: calc(0.65rem + var(--so-input-border-width, 1px));
	right: 0.65rem;
	top: 50%;
	z-index: 1;
	margin: 0;
	padding: 0;
	pointer-events: none;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	transform: translateY(-50%);
	transition: opacity 0.12s ease, visibility 0.12s ease;
	color: var(--so-label-color, #1d2327) !important;
	font-size: var(--so-label-size, 14px);
	font-weight: var(--so-label-weight, 600);
}

.so-form--inside-labels .so-form__field--inside-label[data-so-field-type="textarea"] .so-form__inside-label,
.so-form--inside-labels .so-form__field--inside-label[data-so-field-type="long_text"] .so-form__inside-label {
	top: calc(0.55rem + var(--so-input-border-width, 1px));
	transform: none;
}

.so-form--inside-labels .so-form__field--inside-label.so-form__field--has-value .so-form__inside-label {
	opacity: 0;
	visibility: hidden;
}

/* Scoped under .so-form / .so-form__wrapper so theme globals (e.g. input[type="text"]) do not override tokens. */
.so-form__wrapper .so-form .so-form__input,
.so-form__wrapper .so-form textarea,
.so-form__wrapper .so-form select,
.so-form__wrapper .so-form input[type="text"],
.so-form__wrapper .so-form input[type="email"],
.so-form__wrapper .so-form input[type="url"],
.so-form__wrapper .so-form input[type="tel"],
.so-form__wrapper .so-form input[type="number"],
.so-form__wrapper .so-form input[type="search"],
.so-form__wrapper .so-form input[type="password"],
.so-form__wrapper .so-form input.so-form__datepicker {
	width: 100%;
	max-width: 100%;
	padding: 0.55rem 0.65rem;
	background-color: var(--so-input-bg, #fff);
	color: var(--so-input-color, #1d2327);
	border: var(--so-input-border-width, 1px) solid var(--so-input-border, #c3c4c7);
	border-radius: var(--so-input-radius, 4px);
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.so-form__wrapper .so-form .so-form__input:focus,
.so-form__wrapper .so-form textarea:focus,
.so-form__wrapper .so-form select:focus,
.so-form__wrapper .so-form input[type="text"]:focus,
.so-form__wrapper .so-form input[type="email"]:focus,
.so-form__wrapper .so-form input[type="url"]:focus,
.so-form__wrapper .so-form input[type="tel"]:focus,
.so-form__wrapper .so-form input[type="number"]:focus,
.so-form__wrapper .so-form input[type="search"]:focus,
.so-form__wrapper .so-form input[type="password"]:focus,
.so-form__wrapper .so-form input.so-form__datepicker:focus {
	outline: none;
	border-color: var(--so-input-focus, #2271b1);
	box-shadow: 0 0 0 1px var(--so-input-focus, #2271b1);
}

.so-form__choices--horizontal {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem 1.25rem;
}
.so-form__choices--vertical .so-form__choice {
	display: block;
	margin-bottom: 0.35rem;
}

.so-form__button {
	cursor: pointer;
	border: none;
	padding: 0.65rem 1.25rem;
	font-size: 1rem;
	border-radius: var(--so-button-radius, 6px);
}
.so-form__wrapper .so-form .so-form__button--primary {
	background-color: var(--so-button-bg, #2271b1);
	color: var(--so-button-color, #fff);
	border: var(--so-button-border-width, 0) solid var(--so-button-border-color, #2271b1);
}
.so-form__wrapper .so-form .so-form__button--primary:hover,
.so-form__wrapper .so-form .so-form__button--primary:focus {
	background-color: var(--so-button-bg-hover, #135e96);
	color: var(--so-button-color-hover, #fff);
}
.so-form__button--secondary {
	background: #f0f0f1;
	color: #1d2327;
	margin-right: 0.5rem;
}

.so-form__actions {
	margin-top: 1.25rem;
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	align-items: center;
}

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

.so-form__captcha-panel {
	display: flow-root;
	margin: 1.25rem 0 0;
	padding: 1rem;
	background: #f6f7f7;
	border-radius: var(--so-input-radius, 4px);
	border: 1px solid var(--so-input-border, #c3c4c7);
}

.so-form__captcha-legend {
	float: left;
	width: 100%;
	margin: 0 0 0.35rem;
	padding: 0;
	font-size: var(--so-label-size, 14px);
	font-weight: var(--so-label-weight, 600);
	color: var(--so-label-color, #1d2327);
}

.so-form__captcha-hint {
	margin: 0 0 0.75rem;
	font-size: 14px;
	line-height: 1.45;
	color: #50575e;
}

.so-form__recaptcha-legal {
	margin: 0 0 0.75rem;
	font-size: 12px;
	line-height: 1.45;
	color: #50575e;
}

.so-form__recaptcha-legal a {
	color: #2271b1;
}

.so-form__recaptcha-v2-fieldset .so-form__recaptcha--v2 {
	min-height: 78px;
}

.so-form__rscaptcha-img {
	display: block;
	margin-bottom: 0.75rem;
	border: 1px solid #c3c4c7;
	background: #fff;
}

.so-form__rscaptcha .so-form__input {
	max-width: 14rem;
}

.so-form__terms-scroll {
	max-height: 160px;
	overflow: auto;
	border: 1px solid #c3c4c7;
	padding: 0.75rem;
	margin-bottom: 0.5rem;
	background: #fafafa;
}

.so-form__rate--stars .so-form__star input {
	position: absolute;
	opacity: 0;
}
.so-form__rate--stars .so-form__star span {
	font-size: 1.75rem;
	color: #dcdcde;
	cursor: pointer;
}
.so-form__rate--stars .so-form__star input:focus + span,
.so-form__rate--stars .so-form__star input:checked + span {
	color: #dba617;
}

.so-form__progress {
	height: 6px;
	background: #f0f0f1;
	border-radius: 999px;
	overflow: hidden;
	margin-bottom: 0.75rem;
}
.so-form__progress-bar {
	height: 100%;
	background: #2271b1;
	transition: width 0.25s ease;
}

.so-form__steps {
	display: flex;
	gap: 0.5rem;
	list-style: none;
	margin: 0 0 1rem;
	padding: 0;
}
.so-form__steps li {
	padding: 0.25rem 0.5rem;
	border-radius: 4px;
	background: #f0f0f1;
	font-size: 12px;
}
.so-form__steps li.is-active {
	background: #2271b1;
	color: #fff;
}

.so-form__messages {
	margin-top: 1rem;
	padding: 0.75rem 1rem;
	border-radius: 4px;
}
.so-form__messages--error {
	background: var(--so-message-error-bg, #fcf0f1);
	color: var(--so-message-error-color, #8a2424);
}
.so-form__messages--success {
	background: var(--so-message-success-bg, #edfaef);
	color: var(--so-message-success-color, #1e4620);
}

.so-form__help {
	font-size: 12px;
	color: #50575e;
	margin: 0.25rem 0 0;
}

.so-form__required {
	color: #d63638;
}

.so-form__modal {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.45);
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
}
.so-form__modal-inner {
	background: #fff;
	padding: 1.25rem;
	border-radius: 8px;
	max-width: 640px;
	max-height: 90vh;
	overflow: auto;
}

@media (max-width: 600px) {
	.so-form__row {
		flex-direction: column;
	}
}
