/* Turnstile Widget Styling */
.form-element-type-TurnstileCaptcha.error-field .turnstile-placeholder {
	border: 1px solid #d32f2f;
	border-radius: 4px;
}

/* Form Builder Styles */
html .formcraft-css .form-cover-builder .fc-form .form-element.form-element-type-TurnstileCaptcha {
	display: inline-block;
}

.form-cover-builder .form-element-type-TurnstileCaptcha .turnstile-placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	border: 1px dashed #ccc;
	border-radius: 4px;
	width: 100%;
	height: 75px;
	transform-origin: 0% 0%;
	-webkit-transform-origin: 0% 0%;
	background-color: #f9f9f9;
	color: #666;
	font-size: 14px;
	font-weight: 500;
	text-align: center;
	position: relative;
}

.form-cover-builder .form-element-type-TurnstileCaptcha .turnstile-placeholder:before {
	content: "🛡️";
	margin-right: 8px;
	font-size: 16px;
}

/* Frontend Form Styles */
html .formcraft-css .fc-form .form-element.form-element-type-TurnstileCaptcha {
	display: block;
	margin-bottom: 15px;
}

/* Turnstile Widget Container */
.fc-form .turnstile-placeholder {
	width: 100%;
	max-width: 300px;
	margin: 0 auto;
	position: relative;
}

/* Responsive Design for Turnstile Widget */
@media (max-width: 768px) {
	.fc-form .turnstile-placeholder {
		max-width: 100%;
		overflow-x: auto;
	}
	
	/* Compact size on mobile */
	.fc-form .turnstile-placeholder[data-size="normal"] {
		transform: scale(0.85);
		transform-origin: 0 0;
	}
}

@media (max-width: 480px) {
	.fc-form .turnstile-placeholder[data-size="normal"] {
		transform: scale(0.75);
		transform-origin: 0 0;
	}
}

/* Error Message Styling */
.turnstile-error {
	color: #d32f2f !important;
	font-size: 14px !important;
	margin-top: 5px !important;
	display: block;
	line-height: 1.4;
	font-weight: 400;
}

.form-element-type-TurnstileCaptcha .turnstile-error {
	margin-top: 8px;
	padding: 8px 12px;
	background-color: #ffebee;
	border: 1px solid #ffcdd2;
	border-radius: 4px;
	position: relative;
}

.form-element-type-TurnstileCaptcha .turnstile-error:before {
	content: "⚠️";
	margin-right: 6px;
}

/* Loading State */
.turnstile-placeholder.loading {
	opacity: 0.6;
	pointer-events: none;
}

.turnstile-placeholder.loading:after {
	content: "Loading...";
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	background: rgba(255, 255, 255, 0.9);
	padding: 8px 16px;
	border-radius: 4px;
	font-size: 12px;
	color: #666;
}

/* Theme-specific adjustments */
.turnstile-placeholder[data-theme="dark"] {
	background-color: #2d2d2d;
	color: #fff;
}

.turnstile-placeholder[data-theme="light"] {
	background-color: #ffffff;
	color: #333;
}

/* Size-specific adjustments */
.turnstile-placeholder[data-size="compact"] {
	height: 65px;
	max-width: 130px;
}

.turnstile-placeholder[data-size="normal"] {
	height: 65px;
	max-width: 300px;
}

/* Admin Settings Preview Styles */
#turnstile-preview {
	margin: 15px 0;
	padding: 15px;
	border: 1px solid #ddd;
	border-radius: 4px;
	background-color: #f9f9f9;
	text-align: center;
}

#turnstile-preview h4 {
	margin: 0 0 10px 0;
	font-size: 14px;
	color: #666;
	font-weight: 500;
}

/* Success/Error Message Styling for Admin */
.turnstile-test-result {
	margin: 10px 0;
	padding: 10px 15px;
	border-radius: 4px;
	font-size: 14px;
	line-height: 1.4;
}

.turnstile-test-result.success {
	background-color: #e8f5e8;
	color: #2e7d32;
	border: 1px solid #c8e6c9;
}

.turnstile-test-result.error {
	background-color: #ffebee;
	color: #d32f2f;
	border: 1px solid #ffcdd2;
}

.turnstile-test-result.success:before {
	content: "✅ ";
}

.turnstile-test-result.error:before {
	content: "❌ ";
}

/* Button Styling */
.turnstile-btn {
	padding: 8px 16px;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	font-size: 14px;
	font-weight: 500;
	margin: 5px;
	transition: all 0.2s ease;
}

.turnstile-btn-primary {
	background-color: #1976d2;
	color: white;
}

.turnstile-btn-primary:hover {
	background-color: #1565c0;
}

.turnstile-btn-secondary {
	background-color: #757575;
	color: white;
}

.turnstile-btn-secondary:hover {
	background-color: #616161;
}

/* Help Section Styling */
.turnstile-help {
	margin-top: 20px;
	padding: 15px;
	background-color: #f5f5f5;
	border-radius: 4px;
	border-left: 4px solid #2196f3;
}

.turnstile-help h4 {
	margin: 0 0 10px 0;
	font-size: 16px;
	color: #333;
}

.turnstile-help p {
	margin: 8px 0;
	font-size: 14px;
	line-height: 1.5;
	color: #666;
}

.turnstile-help a {
	color: #1976d2;
	text-decoration: none;
}

.turnstile-help a:hover {
	text-decoration: underline;
}