/**
 * Form Manager — public styles.
 */

.fm-form-wrap {
	--fm-gap: 1rem;
	--fm-radius: 8px;
	--fm-border: #d0d5dd;
	--fm-focus: #2563eb;
	--fm-text: #1f2937;
	--fm-muted: #6b7280;
	--fm-bg: #fff;
	--fm-error: #b42318;
	--fm-success: #027a48;
	max-width: 100%;
	position: relative;
}

.fm-form {
	color: var(--fm-text);
}

.fm-fields {
	display: flex;
	flex-wrap: wrap;
	gap: var(--fm-gap);
}

.fm-fields--stacked .fm-field,
.fm-fields--stacked .fm-width-half,
.fm-fields--stacked .fm-width-third {
	flex: 0 0 100%;
	max-width: 100%;
}

.fm-fields--inline {
	align-items: flex-end;
}

.fm-fields--inline .fm-field {
	flex: 1 1 auto;
	min-width: 140px;
}

.fm-fields--inline .fm-field--submit {
	flex: 0 0 auto;
}

.fm-field {
	box-sizing: border-box;
	flex: 0 0 100%;
	max-width: 100%;
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
}

.fm-width-half {
	flex: 0 0 calc(50% - var(--fm-gap) / 2);
	max-width: calc(50% - var(--fm-gap) / 2);
}

.fm-width-third {
	flex: 0 0 calc(33.333% - var(--fm-gap) * 2 / 3);
	max-width: calc(33.333% - var(--fm-gap) * 2 / 3);
}

@media (max-width: 640px) {
	.fm-width-half,
	.fm-width-third {
		flex: 0 0 100%;
		max-width: 100%;
	}
}

.fm-label {
	font-weight: 600;
	font-size: 0.925rem;
}

.fm-required {
	color: var(--fm-error);
}

.fm-control {
	width: 100%;
	box-sizing: border-box;
	padding: 0.65rem 0.75rem;
	border: 1px solid var(--fm-border);
	border-radius: var(--fm-radius);
	background: var(--fm-bg);
	font: inherit;
	line-height: 1.4;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.fm-control:focus {
	outline: none;
	border-color: var(--fm-focus);
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.fm-control.is-invalid {
	border-color: var(--fm-error);
}

.fm-help {
	margin: 0;
	font-size: 0.8rem;
	color: var(--fm-muted);
}

.fm-options {
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
}

.fm-option {
	display: flex;
	align-items: flex-start;
	gap: 0.5rem;
	font-weight: 400;
	cursor: pointer;
}

.fm-submit {
	appearance: none;
	border: 0;
	border-radius: var(--fm-radius);
	background: #111827;
	color: #fff;
	padding: 0.75rem 1.25rem;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	transition: opacity 0.15s ease, transform 0.15s ease;
}

.fm-submit:hover {
	opacity: 0.9;
}

.fm-submit:disabled {
	opacity: 0.6;
	cursor: wait;
}

.fm-messages {
	margin-top: 0.75rem;
	min-height: 1.25rem;
}

.fm-message {
	padding: 0.75rem 1rem;
	border-radius: var(--fm-radius);
	font-size: 0.925rem;
}

.fm-message--success {
	background: #ecfdf3;
	color: var(--fm-success);
	border: 1px solid #abefc6;
}

.fm-message--error {
	background: #fef3f2;
	color: var(--fm-error);
	border: 1px solid #fecdca;
}

.fm-field-error {
	margin: 0;
	font-size: 0.8rem;
	color: var(--fm-error);
}

.fm-card {
	background: #f8fafc;
	border: 1px solid var(--fm-border);
	border-radius: 12px;
	padding: 1.5rem;
}

.fm-card__title {
	margin: 0 0 1rem;
	font-size: 1.25rem;
}

.fm-form.is-loading {
	opacity: 0.75;
	pointer-events: none;
}

/* Anti-spam honeypot — visually hidden, still in DOM */
.fm-antispam {
	position: absolute !important;
	left: -9999px !important;
	width: 1px !important;
	height: 1px !important;
	overflow: hidden !important;
	opacity: 0 !important;
	pointer-events: none !important;
}

.fm-hp-label,
.fm-hp-input {
	display: block;
}

/* ---- Dent template ---- */

.fm-template-dent {
	--fm-dent-green: #7ac143;
	--fm-dent-green-hover: #6bb036;
	--fm-dent-line: #d9d9d9;
	--fm-dent-placeholder: #b0b0b0;
	--fm-dent-text: #4a4a4a;
	--fm-dent-privacy: #8a8a8a;
	max-width: none;
	width: 100%;
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 18px;
}

.fm-dent__intro {
	margin: 0 0 2rem;
	color: var(--fm-dent-text);
	font-size: 1.05em;
	line-height: 1.55;
	font-weight: 400;
}

.fm-fields--dent {
	display: flex;
	flex-direction: column;
	gap: 0;
}

.fm-template-dent .fm-fields--dent .fm-field {
	flex: 0 0 100%;
	max-width: 100%;
	margin: 0 0 1.75rem;
	gap: 0;
}

.fm-template-dent .fm-fields--dent .fm-field--submit {
	margin: 0.5rem 0 0;
}

.fm-template-dent .fm-label,
.fm-template-dent .fm-help,
.fm-template-dent .fm-required {
	display: none;
}

.fm-template-dent .fm-control {
	width: 100%;
	padding: 0.4rem 0 0.75rem;
	border: 0;
	border-bottom: 1px solid var(--fm-dent-line);
	border-radius: 0;
	background: transparent;
	box-shadow: none;
	font-size: 1.05em;
	line-height: 1.45;
	color: var(--fm-dent-text);
}

.fm-template-dent textarea.fm-control {
	min-height: 4.5rem;
	resize: vertical;
}

.fm-template-dent .fm-control::placeholder {
	color: var(--fm-dent-placeholder);
	opacity: 1;
}

.fm-template-dent .fm-control:focus {
	outline: none;
	border-bottom-color: var(--fm-dent-green);
	box-shadow: none;
}

.fm-template-dent .fm-control.is-invalid {
	border-bottom-color: var(--fm-error);
}

.fm-template-dent .fm-options {
	padding-top: 0.25rem;
}

.fm-dent__submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.65rem;
	width: 100%;
	padding: 1rem 1.35rem;
	border: 0;
	border-radius: 6px;
	background: var(--fm-dent-green);
	color: #fff;
	font-size: 1.1em;
	font-weight: 600;
	letter-spacing: 0.01em;
	cursor: pointer;
	transition: background-color 0.15s ease, transform 0.15s ease;
}

.fm-dent__submit:hover {
	background: var(--fm-dent-green-hover);
	opacity: 1;
}

.fm-dent__submit:disabled {
	opacity: 0.7;
}

.fm-dent__submit-icon {
	font-size: 1.15rem;
	line-height: 1;
	font-weight: 400;
}

.fm-dent__privacy {
	margin: 1rem 0 0;
	color: var(--fm-dent-privacy);
	font-size: 0.9em;
	line-height: 1.45;
	text-align: left;
}

.fm-dent__privacy a {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.fm-dent__privacy a:hover {
	color: var(--fm-dent-text);
}

.fm-template-dent .fm-field--consent {
	margin: 0.25rem 0 1.25rem;
}

.fm-template-dent .fm-field--consent .fm-label,
.fm-template-dent .fm-field--consent .fm-required {
	display: inline;
}

.fm-dent__consent {
	display: flex;
	align-items: flex-start;
	gap: 0.65rem;
	margin: 0;
	color: var(--fm-dent-privacy);
	font-size: 0.9em;
	line-height: 1.45;
	font-weight: 400;
	cursor: pointer;
}

.fm-dent__consent-input {
	flex: 0 0 auto;
	width: 1.15em;
	height: 1.15em;
	margin: 0.15em 0 0;
	accent-color: var(--fm-dent-green);
	cursor: pointer;
}

.fm-dent__consent-text {
	flex: 1 1 auto;
}

.fm-dent__consent-text a {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.fm-dent__consent-text a:hover {
	color: var(--fm-dent-text);
}

.fm-dent__consent-text .fm-required {
	display: inline;
	color: var(--fm-error);
	margin-left: 0.15em;
}

.fm-template-dent .fm-field--consent.is-invalid .fm-dent__consent,
.fm-template-dent .fm-dent__consent-input.is-invalid + .fm-dent__consent-text {
	color: var(--fm-error);
}

.fm-template-dent .fm-messages {
	margin-top: 1rem;
}

.fm-template-dent .fm-field-error {
	margin-top: 0.35rem;
}

/* ---- Priem template ---- */

.fm-form-wrap.fm-form-wrap--priem,
.fm-form-wrap .fm-form.fm-template-priem {
	--fm-priem-border: #d4d4d4;
	--fm-priem-border-focus: #999;
	--fm-priem-placeholder: #9e9e9e;
	--fm-priem-text: #222;
	--fm-priem-muted: #666;
	--fm-priem-btn: #000;
	--fm-priem-btn-hover: #222;
	width: 100%;
	max-width: none;
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 16px;
	line-height: 1.4;
}

.fm-form-wrap--priem .fm-antispam,
.fm-form.fm-template-priem .fm-antispam {
	position: absolute !important;
	left: -9999px !important;
	top: auto !important;
	width: 1px !important;
	height: 1px !important;
	overflow: hidden !important;
	opacity: 0 !important;
	visibility: hidden !important;
	pointer-events: none !important;
}

.fm-form-wrap--priem .fm-priem,
.fm-form.fm-template-priem .fm-priem {
	width: 100%;
}

.fm-form-wrap--priem .fm-fields--priem,
.fm-form.fm-template-priem .fm-fields--priem {
	display: flex;
	flex-direction: column;
	flex-wrap: nowrap;
	gap: 0;
}

.fm-form-wrap--priem .fm-fields--priem > .fm-field,
.fm-form.fm-template-priem .fm-fields--priem > .fm-field {
	flex: 0 0 100%;
	max-width: 100%;
	margin: 0 0 12px;
	gap: 0;
	padding: 0;
}

.fm-form-wrap--priem .fm-fields--priem > .fm-field--consent,
.fm-form.fm-template-priem .fm-fields--priem > .fm-field--consent {
	margin: 4px 0 20px;
}

.fm-form-wrap--priem .fm-fields--priem > .fm-field--submit,
.fm-form.fm-template-priem .fm-fields--priem > .fm-field--submit {
	margin: 0;
}

.fm-form-wrap--priem .fm-label,
.fm-form-wrap--priem .fm-help,
.fm-form-wrap--priem .fm-required,
.fm-form.fm-template-priem .fm-label,
.fm-form.fm-template-priem .fm-help,
.fm-form.fm-template-priem .fm-required {
	display: none !important;
}

.fm-form-wrap--priem input.fm-control,
.fm-form-wrap--priem select.fm-control,
.fm-form-wrap--priem textarea.fm-control,
.fm-form.fm-template-priem input.fm-control,
.fm-form.fm-template-priem select.fm-control,
.fm-form.fm-template-priem textarea.fm-control {
	display: block;
	width: 100%;
	box-sizing: border-box;
	height: auto;
	min-height: 48px;
	margin: 0;
	padding: 13px 16px;
	border: 1px solid var(--fm-priem-border) !important;
	border-radius: 6px !important;
	background: #fff !important;
	box-shadow: none !important;
	font-size: 16px !important;
	line-height: 1.35 !important;
	color: var(--fm-priem-text) !important;
	-webkit-appearance: none;
	appearance: none;
}

.fm-form-wrap--priem input.fm-control::placeholder,
.fm-form-wrap--priem textarea.fm-control::placeholder,
.fm-form.fm-template-priem input.fm-control::placeholder,
.fm-form.fm-template-priem textarea.fm-control::placeholder {
	color: var(--fm-priem-placeholder);
	opacity: 1;
}

.fm-form-wrap--priem input.fm-control:focus,
.fm-form-wrap--priem select.fm-control:focus,
.fm-form-wrap--priem textarea.fm-control:focus,
.fm-form.fm-template-priem input.fm-control:focus,
.fm-form.fm-template-priem select.fm-control:focus,
.fm-form.fm-template-priem textarea.fm-control:focus {
	outline: none;
	border-color: var(--fm-priem-border-focus) !important;
	box-shadow: none !important;
}

.fm-form-wrap--priem .fm-priem__consent,
.fm-form.fm-template-priem .fm-priem__consent {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin: 0;
	color: var(--fm-priem-muted);
	font-size: 13px;
	line-height: 1.45;
	font-weight: 400;
	cursor: pointer;
}

.fm-form-wrap--priem .fm-priem__consent-input,
.fm-form.fm-template-priem .fm-priem__consent-input {
	flex: 0 0 16px;
	width: 16px;
	height: 16px;
	margin: 2px 0 0;
	accent-color: var(--fm-priem-btn);
	cursor: pointer;
}

.fm-form-wrap--priem .fm-priem__consent-text,
.fm-form.fm-template-priem .fm-priem__consent-text {
	flex: 1 1 auto;
	min-width: 0;
}

.fm-form-wrap--priem .fm-priem__consent-text a,
.fm-form.fm-template-priem .fm-priem__consent-text a {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.fm-form-wrap--priem button.fm-priem__submit,
.fm-form.fm-template-priem button.fm-priem__submit {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 52px;
	margin: 0;
	padding: 14px 24px;
	border: 0 !important;
	border-radius: 999px !important;
	background: var(--fm-priem-btn) !important;
	color: #fff !important;
	font-size: 16px !important;
	font-weight: 600;
	letter-spacing: 0;
	cursor: pointer;
	transition: background-color 0.15s ease;
}

.fm-form-wrap--priem button.fm-priem__submit:hover,
.fm-form.fm-template-priem button.fm-priem__submit:hover {
	background: var(--fm-priem-btn-hover) !important;
	opacity: 1;
}

.fm-form-wrap--priem button.fm-priem__submit:disabled,
.fm-form.fm-template-priem button.fm-priem__submit:disabled {
	opacity: 0.7;
	cursor: wait;
}

.fm-form-wrap--priem .fm-messages,
.fm-form.fm-template-priem .fm-messages {
	margin-top: 16px;
}

.fm-form-wrap--priem .fm-field-error,
.fm-form.fm-template-priem .fm-field-error {
	margin-top: 6px;
	font-size: 13px;
}
