/*
 * CaptchaKit — Public Widget Styles
 * Package: CaptchaKit
 */

/* ── Wrapper ─────────────────────────────────────────────────────────────── */

.captchakit-wrapper {
	margin: 16px 0;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 8px;
}

/* ── Widget container ────────────────────────────────────────────────────── */

.captchakit-wrapper .gc-widget {
	display: block;
	width: 100%;
	max-width: 360px;
	min-height: 80px;
	overflow: hidden;
	transition: box-shadow 0.2s ease;
	background: transparent !important;
	border: none !important;
	border-radius: 0 !important;
}

.captchakit-wrapper .gc-widget iframe {
	background: transparent !important;
	border: none !important;
}

/* Focused / active state */
.captchakit-wrapper .gc-widget:focus-within {
	box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
	outline: none;
}

/* ── Completed state ─────────────────────────────────────────────────────── */

.captchakit-wrapper.captchakit-complete .gc-widget {
	box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}

.captchakit-wrapper.captchakit-complete .captchakit-hint {
	color: #16a34a;
	font-weight: 500;
}

.captchakit-wrapper.captchakit-complete .captchakit-hint::before {
	content: '✓ ';
}

/* ── Failed state ────────────────────────────────────────────────────────── */

.captchakit-wrapper.captchakit-failed .gc-widget {
	box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.captchakit-wrapper.captchakit-failed .captchakit-hint {
	color: #dc2626;
}

.captchakit-wrapper.captchakit-failed .captchakit-hint::before {
	content: '✗ ';
}

/* ── Unavailable (embed failed to load) ──────────────────────────────────── */

.captchakit-wrapper.captchakit-unavailable .gc-widget {
	display: none;
}

.captchakit-wrapper.captchakit-unavailable .captchakit-hint {
	display: none;
}

/* ── Noscript fallback ───────────────────────────────────────────────────── */

.captchakit-noscript {
	font-size: 13px;
	color: #dc2626;
	margin: 8px 0;
	padding: 8px 12px;
	background: #fef2f2;
	border: 1px solid #fecaca;
	border-radius: 4px;
}

/* ── Hint text ───────────────────────────────────────────────────────────── */

.captchakit-hint {
	font-size: 13px;
	color: #666;
	margin: 0;
	line-height: 1.4;
	transition: color 0.2s ease;
}

/* ── Login page overrides ────────────────────────────────────────────────── */

#loginform .captchakit-wrapper,
#registerform .captchakit-wrapper {
	margin: 16px 0 4px;
}

#loginform .captchakit-wrapper .gc-widget,
#registerform .captchakit-wrapper .gc-widget {
	max-width: 100%;
}

/* ── Comment form overrides ──────────────────────────────────────────────── */

#commentform .captchakit-wrapper {
	margin: 20px 0;
}

/* ── WooCommerce overrides ───────────────────────────────────────────────── */

.woocommerce-checkout .captchakit-wrapper {
	margin: 16px 0;
}

/* ── Dark mode support ───────────────────────────────────────────────────── */

@media (prefers-color-scheme: dark) {
	.captchakit-hint {
		color: #9ca3af;
	}

	.captchakit-wrapper.captchakit-complete .gc-widget {
		border-color: #22c55e;
	}

	.captchakit-wrapper.captchakit-failed .gc-widget {
		border-color: #ef4444;
	}
}

/* ── Reduced motion ──────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
	.captchakit-wrapper .gc-widget,
	.captchakit-hint {
		transition: none;
	}
}
