.tgfb-form-wrapper {
	margin: 0 auto;
	color: var(--tgfb-text-color, #333);
	font-size: var(--tgfb-font-size, 16px);
}

.tgfb-form-wrapper * {
	box-sizing: border-box;
}

.tgfb-honeypot {
	position: absolute !important;
	left: -9999px !important;
	top: -9999px;
	height: 0;
	width: 0;
	overflow: hidden;
}

.tgfb-fields-grid {
	display: flex;
	flex-wrap: wrap;
	gap: var(--tgfb-field-spacing, 18px) 4%;
}

.tgfb-field {
	width: 100%;
	display: flex;
	flex-direction: column;
}

.tgfb-field.tgfb-width-half {
	width: 48%;
}

@media (max-width: 600px) {
	.tgfb-field.tgfb-width-half {
		width: 100%;
	}
}

.tgfb-form-wrapper[data-label-position="inline"] .tgfb-field:not(.tgfb-field-checkbox):not(.tgfb-field-consent):not(.tgfb-field-captcha) {
	flex-direction: row;
	align-items: center;
	flex-wrap: wrap;
}

.tgfb-form-wrapper[data-label-position="inline"] .tgfb-label {
	width: 35%;
	margin-bottom: 0;
	padding-right: 10px;
}

.tgfb-form-wrapper[data-label-position="inline"] .tgfb-input,
.tgfb-form-wrapper[data-label-position="inline"] select.tgfb-input {
	width: 65%;
	flex: 1;
}

.tgfb-label {
	font-size: var(--tgfb-label-font-size, 14px);
	color: var(--tgfb-label-color, #222);
	font-weight: 600;
	margin-bottom: 6px;
	display: inline-block;
}

.tgfb-required {
	color: var(--tgfb-error-color, #d63638);
}

.tgfb-input,
select.tgfb-input,
textarea.tgfb-input {
	width: 100%;
	background: var(--tgfb-bg-color, #fff);
	color: var(--tgfb-text-color, #333);
	border: var(--tgfb-border-width, 1px) solid var(--tgfb-border-color, #d7d7d7);
	border-radius: var(--tgfb-border-radius, 6px);
	padding: var(--tgfb-field-padding, 12px);
	font-size: var(--tgfb-font-size, 16px);
	font-family: inherit;
	transition: border-color .18s ease, box-shadow .18s ease;
	line-height: 1.4;
}

.tgfb-input:focus,
select.tgfb-input:focus,
textarea.tgfb-input:focus {
	outline: none;
	border-color: var(--tgfb-primary-color, #1e73be);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--tgfb-primary-color, #1e73be) 20%, transparent);
}

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

.tgfb-checkbox-single,
.tgfb-checkbox-option,
.tgfb-radio-option {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: var(--tgfb-font-size, 16px);
	cursor: pointer;
	font-weight: 400;
}

.tgfb-checkbox-single input,
.tgfb-checkbox-option input,
.tgfb-radio-option input {
	width: 18px;
	height: 18px;
	accent-color: var(--tgfb-primary-color, #1e73be);
	flex-shrink: 0;
}

.tgfb-option-group {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-top: 4px;
}

.tgfb-captcha-row {
	display: flex;
	align-items: center;
	gap: 8px;
}

.tgfb-captcha-question {
	font-weight: 600;
	white-space: nowrap;
}

.tgfb-captcha-answer {
	max-width: 100px;
}

.tgfb-submit-row {
	margin-top: var(--tgfb-field-spacing, 18px);
	display: flex;
	align-items: center;
	gap: 12px;
}

.tgfb-submit-btn {
	background: var(--tgfb-primary-color, #1e73be);
	color: var(--tgfb-primary-text-color, #fff);
	border: none;
	border-radius: var(--tgfb-button-radius, 6px);
	padding: var(--tgfb-button-padding-v, 12px) var(--tgfb-button-padding-h, 28px);
	font-size: var(--tgfb-font-size, 16px);
	font-weight: 600;
	cursor: pointer;
	transition: filter .15s ease, transform .1s ease;
}

.tgfb-submit-btn:hover {
	filter: brightness(0.92);
}

.tgfb-submit-btn:active {
	transform: translateY(1px);
}

.tgfb-submit-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.tgfb-form-wrapper[data-full-width="yes"] .tgfb-submit-btn,
.tgfb-submit-btn.tgfb-full-width {
	width: 100%;
}

.tgfb-spinner {
	display: none;
	width: 18px;
	height: 18px;
	border: 2px solid var(--tgfb-border-color, #ccc);
	border-top-color: var(--tgfb-primary-color, #1e73be);
	border-radius: 50%;
	animation: tgfb-spin 0.7s linear infinite;
}

.tgfb-form.tgfb-loading .tgfb-spinner {
	display: inline-block;
}

@keyframes tgfb-spin {
	to { transform: rotate(360deg); }
}

.tgfb-response-message {
	margin-top: 14px;
	padding: 12px 14px;
	border-radius: var(--tgfb-border-radius, 6px);
	display: none;
	font-size: 14px;
}

.tgfb-response-message.tgfb-success {
	display: block;
	background: color-mix(in srgb, var(--tgfb-success-color, #1e8a3c) 12%, white);
	color: var(--tgfb-success-color, #1e8a3c);
	border: 1px solid var(--tgfb-success-color, #1e8a3c);
}

.tgfb-response-message.tgfb-error {
	display: block;
	background: color-mix(in srgb, var(--tgfb-error-color, #d63638) 12%, white);
	color: var(--tgfb-error-color, #d63638);
	border: 1px solid var(--tgfb-error-color, #d63638);
}

.tgfb-field.tgfb-field-error .tgfb-input,
.tgfb-field.tgfb-field-error select.tgfb-input,
.tgfb-field.tgfb-field-error textarea.tgfb-input {
	border-color: var(--tgfb-error-color, #d63638);
}

.tgfb-error-box {
	background: #fdecec;
	border: 1px solid #d63638;
	color: #d63638;
	padding: 10px 14px;
	border-radius: 6px;
}
