/**
 * Center Cloudflare Turnstile + Google reCAPTCHA v2 across admin, storefront, green theme, DHRU.
 * Widgets default to left align inside narrow columns — these rules keep them visually centered.
 */

.captcha-widget-wrap {
	display: flex;
	justify-content: center;
	align-items: flex-start;
	flex-wrap: wrap;
	width: 100%;
	margin: 10px 0 14px;
	text-align: center;
}

.captcha-widget-wrap .cf-turnstile,
.captcha-widget-wrap .g-recaptcha,
.captcha-widget-wrap .g-recaptcha-contact {
	display: inline-block;
	vertical-align: top;
	max-width: 100%;
}

.captcha-widget-wrap [id$="_turnstile"],
.captcha-widget-wrap [id*="turnstile"] {
	display: inline-block;
	max-width: 100%;
}

/* Green theme modals / footer — explicit render containers */
#tpl_login_turnstile,
#tpl_register_turnstile,
#tpl_newsletter_turnstile,
.green_login .g-recaptcha-contact,
.green_login .g-recaptcha {
	display: flex;
	justify-content: center;
	width: 100%;
}

.green_login .g-recaptcha > div,
.green_login .g-recaptcha-contact > div {
	margin-left: auto !important;
	margin-right: auto !important;
}

/* DHRU: page + modals (class already used in views) */
.dhru-auth-recaptcha-wrap {
	display: flex;
	justify-content: center;
	width: 100%;
	margin-top: 6px;
	margin-bottom: 12px;
}

.dhru-auth-recaptcha-wrap > div {
	max-width: 100%;
}

/* Customer / admin horizontal forms: captcha alone in col-sm-12 */
.form-horizontal .form-group > .col-sm-12 > .cf-turnstile:only-child,
.form-horizontal .form-group > .col-sm-12 > .g-recaptcha:only-child {
	display: table;
	margin-left: auto;
	margin-right: auto;
}

/* Turnstile iframe (managed mode) — extra centering */
.captcha-widget-wrap iframe,
.dhru-auth-recaptcha-wrap iframe,
#tpl_login_turnstile iframe,
#tpl_register_turnstile iframe,
#tpl_newsletter_turnstile iframe {
	margin-left: auto !important;
	margin-right: auto !important;
}

/* Green template contact / testimonials (no wrapper in markup) */
.col-12 > .g-recaptcha,
.col-md-6 > .g-recaptcha {
	display: flex;
	justify-content: center;
	width: 100%;
}
