/* Branded security box around the ALTCHA widget, owned by the dth-media plugin
 * so EVERY form that calls dth_media_botcheck_render_altcha() gets the identical
 * design (and it travels to any site that uses this plugin). Markup is emitted
 * by that render fn. ALTCHA renders into the light DOM, so the checkbox is
 * styled directly; the host box uses the widget's --altcha-* custom properties.
 * (BY-100, moved out of dealer-portal-theme) */
.dth-reg-security {
	display: flex;
	align-items: center;
	gap: 16px;
	margin: 0 0 20px;
	padding: 16px 18px;
	background: linear-gradient(180deg, #F6FAFF 0%, #FFFFFF 100%);
	border: 1px solid #DADBDD;
	border-radius: 10px;
	box-sizing: border-box;
}

.dth-reg-security__head {
	flex: 1 1 auto;
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 0;
}

.dth-reg-security__badge {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	color: #fff;
	background: #1A7EFB;
	animation: dth-sec-pulse 2.4s ease-out infinite;
}

.dth-reg-security__badge svg {
	width: 22px;
	height: 22px;
	animation: dth-sec-bob 2.4s ease-in-out infinite;
}

.dth-reg-security__text {
	display: flex;
	flex-direction: column;
	line-height: 1.3;
}

.dth-reg-security__title {
	font-family: "Montserrat", sans-serif;
	font-size: 16px;
	font-weight: 600;
	color: #1A202C;
}

.dth-reg-security__sub {
	font-family: "Montserrat", sans-serif;
	font-size: 13px;
	font-weight: 400;
	color: #6B7280;
}

/* Theme the ALTCHA widget to match the box. The render fn sets an inline margin
 * on the element, so the bottom margin needs !important to drop it (the box
 * owns the spacing now). */
.dth-reg-security altcha-widget {
	--altcha-border-width: 0;
	--altcha-color-base: transparent;
	--altcha-color-border: transparent;
	--altcha-color-active: #1A7EFB;
	--altcha-color-text: #2D3748;
	--altcha-max-width: 100%;
	flex: 0 0 auto;
	display: block;
	margin: 0 !important;
}

/* ALTCHA renders into the LIGHT DOM (.altcha > .altcha-checkbox > input +
 * .altcha-label), so we can style it directly. Centre the control, drop the
 * "I'm not a robot" text, and turn the native checkbox into a big chunky one
 * with a satisfying checkmark pop. */
.dth-reg-security .altcha-main,
.dth-reg-security .altcha-checkbox {
	display: flex;
	align-items: center;
	justify-content: center;
}

/* Hide the label text but keep it for screen readers. */
.dth-reg-security .altcha-label {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

.dth-reg-security .altcha-checkbox input[type="checkbox"] {
	appearance: none;
	-webkit-appearance: none;
	flex: 0 0 auto;
	width: 36px;
	height: 36px;
	margin: 6px 0;
	border: 2px solid #CBD5E0;
	border-radius: 10px;
	background: #fff;
	cursor: pointer;
	position: relative;
	transition: background .18s ease, border-color .18s ease, box-shadow .18s ease, transform .08s ease;
}

/* Kill any host checkmark on the input (e.g. wp-login loads forms.css, which
 * draws its own SVG tick via ::before) so only our ::after tick shows — else
 * the checked box renders two overlapping ticks. */
.dth-reg-security .altcha-checkbox input[type="checkbox"]::before {
	content: none;
	display: none;
}

.dth-reg-security .altcha-checkbox input[type="checkbox"]:hover {
	border-color: #1A7EFB;
}

.dth-reg-security .altcha-checkbox input[type="checkbox"]:active {
	transform: scale(0.9);
}

.dth-reg-security .altcha-checkbox input[type="checkbox"]:focus-visible {
	outline: none;
	box-shadow: 0 0 0 4px rgba(26, 126, 251, 0.25);
}

.dth-reg-security .altcha-checkbox input[type="checkbox"]:checked {
	background: #1A7EFB;
	border-color: #1A7EFB;
	box-shadow: 0 2px 8px rgba(26, 126, 251, 0.35);
}

.dth-reg-security .altcha-checkbox input[type="checkbox"]:checked::after {
	content: "";
	position: absolute;
	left: 12px;
	top: 6px;
	width: 7px;
	height: 14px;
	border: solid #fff;
	border-width: 0 3.5px 3.5px 0;
	transform: rotate(45deg);
	transform-origin: center;
	animation: dth-check-pop 0.26s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

@keyframes dth-check-pop {
	0%   { transform: rotate(45deg) scale(0); }
	60%  { transform: rotate(45deg) scale(1.25); }
	100% { transform: rotate(45deg) scale(1); }
}

@keyframes dth-sec-pulse {
	0%   { box-shadow: 0 0 0 0 rgba(26, 126, 251, 0.45); }
	70%  { box-shadow: 0 0 0 12px rgba(26, 126, 251, 0); }
	100% { box-shadow: 0 0 0 0 rgba(26, 126, 251, 0); }
}

@keyframes dth-sec-bob {
	0%, 100% { transform: translateY(0); }
	50%      { transform: translateY(-1.5px); }
}

/* Inline hint shown while the security check is not yet green (BY-115). Plain
 * helper text, not an alarm, so a fresh page load reads as guidance. */
.dth-reg-security__hint {
	margin: -8px 0 16px;
	font-family: "Montserrat", sans-serif;
	font-size: 13px;
	line-height: 1.4;
	color: #6B7280;
}

@media (prefers-reduced-motion: reduce) {
	.dth-reg-security__badge,
	.dth-reg-security__badge svg,
	.dth-reg-security .altcha-checkbox input[type="checkbox"]:checked::after {
		animation: none;
	}
}
