/**
 * BotShield public / frontend styles.
 */

:root {
	--botshield-primary: #2563eb;
	--botshield-primary-light: #eff6ff;
	--botshield-border: #e2e8f0;
	--botshield-text: #0f172a;
	--botshield-muted: #64748b;
	--botshield-radius: 12px;
	--botshield-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}

.botshield-field {
	margin: 1.25em 0;
	clear: both;
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
}

/* Shared widget card */
.botshield-widget-card {
	background: #fff;
	border: 1px solid var(--botshield-border);
	border-radius: var(--botshield-radius);
	box-shadow: var(--botshield-shadow);
	overflow: hidden;
	max-width: 100%;
	box-sizing: border-box;
}

.botshield-widget-card__header {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 14px;
	background: linear-gradient(135deg, #eff6ff 0%, #f8fafc 100%);
	border-bottom: 1px solid var(--botshield-border);
	font-size: 0.8125rem;
	font-weight: 600;
	color: var(--botshield-text);
	text-align: start;
}

.botshield-widget-card__header .botshield-widget-card__icon {
	color: var(--botshield-primary);
	display: inline-flex;
	align-items: center;
	flex-shrink: 0;
}

.botshield-widget-card__body {
	padding: 12px;
	display: flex;
	justify-content: center;
	align-items: center;
	min-height: 72px;
	overflow: hidden;
	max-width: 100%;
	box-sizing: border-box;
}

.botshield-widget-card__body > div {
	max-width: 100%;
}

/* reCAPTCHA v2 */
.botshield-recaptcha-v2 .botshield-widget-card {
	width: fit-content;
	max-width: 100%;
	margin-inline: auto;
}

.botshield-recaptcha-v2 .g-recaptcha {
	display: inline-block;
	max-width: 100%;
	transform-origin: center top;
}

.botshield-recaptcha-v2--compact .botshield-widget-card__body {
	min-height: auto;
	padding: 8px 12px;
}

/* Turnstile */
.botshield-turnstile .botshield-widget-card {
	width: fit-content;
	max-width: 100%;
	margin-inline: auto;
}

.botshield-turnstile .botshield-widget-card__body {
	min-height: auto;
	padding: 8px 12px;
	width: auto;
	justify-content: center;
}

.botshield-turnstile .cf-turnstile {
	display: block;
	width: auto;
	line-height: 0;
}

.botshield-turnstile--compact .botshield-widget-card__body {
	min-height: auto;
}

.botshield-recaptcha-v3 {
	display: none;
}

.botshield-fallback-math[hidden] {
	display: none !important;
}

.botshield-fallback-math:not([hidden]) {
	display: block;
}

body.botshield-active:not(.botshield-engine-recaptcha-v3) .grecaptcha-badge {
	visibility: hidden !important;
	display: none !important;
}

.botshield-elementor-field {
	margin-bottom: 12px;
	width: 100%;
}

.botshield-elementor-field .botshield-field {
	margin: 0;
}

/* wp-login.php */
body.login {
	overflow-x: hidden;
}

body.login #login {
	width: 360px;
	max-width: calc(100vw - 32px);
	overflow: visible;
}

body.login .botshield-field {
	margin: 16px auto;
	max-width: 100%;
	width: 100%;
}

body.login .botshield-widget-card {
	width: fit-content;
	max-width: 100%;
	margin-inline: auto;
}

body.login .botshield-widget-card__body {
	overflow: visible;
}

body.login #loginform .botshield-field,
body.login #registerform .botshield-field,
body.login #lostpasswordform .botshield-field {
	overflow: visible;
}

body.login .botshield-recaptcha-v2--compact .g-recaptcha {
	transform: scale(0.92);
	transform-origin: center top;
}

body.login .botshield-turnstile--compact .cf-turnstile {
	transform: none;
}

#commentform .botshield-field,
#commentform .form-submit .botshield-field,
.woocommerce-form-login .botshield-field,
.woocommerce-form-register .botshield-field {
	margin-top: 16px;
	margin-bottom: 12px;
}

.botshield-digits-fields {
	margin: 0.75em 0 1em;
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
}

.botshield-digits-fields .botshield-field {
	margin-top: 0;
	margin-bottom: 0;
}

.botshield-test-mode-badge {
	margin: 0 0 12px;
	padding: 8px 12px;
	border: 1px dashed #d97706;
	background: #fffbeb;
	color: #92400e;
	font-size: 13px;
	border-radius: 8px;
	text-align: start;
}

body.rtl .botshield-widget-card__header,
body.rtl .botshield-test-mode-badge,
[dir="rtl"] .botshield-widget-card__header,
[dir="rtl"] .botshield-test-mode-badge {
	text-align: start;
}

body.rtl .botshield-digits-fields,
[dir="rtl"] .botshield-digits-fields {
	text-align: start;
}

@media (max-width: 480px) {
	.botshield-widget-card__body {
		padding: 10px;
	}

	body.login .botshield-recaptcha-v2--compact .g-recaptcha {
		transform: scale(0.85);
	}
}
