/**
 * FormCraft Advanced CAPTCHA CSS
 * Prefixed with fcac- for conflict prevention and compliance.
 */

.fcac-captcha-wrapper {
	margin: 15px 0;
	padding: 16px;
	border-radius: 12px;
	background: #ffffff;
	border: 1px solid #e2e8f0;
	box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
	display: inline-flex;
	flex-direction: column;
	max-width: 100%;
	box-sizing: border-box;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	position: relative;
	overflow: hidden;
}
.fcac-captcha-wrapper:hover {
	box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
	border-color: #cbd5e1;
	transform: translateY(-2px);
}

/* Accessible hidden screen reader text */
.fcac-screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal !important;
}

.fcac-image-wrapper {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 12px;
	flex-wrap: nowrap;
}

.fcac-captcha-image {
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	background: #fff;
	display: block;
	max-width: 100%;
	height: 48px;
	object-fit: contain;
	box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.02);
	transition: filter 0.2s ease;
}
.fcac-captcha-wrapper:hover .fcac-captcha-image {
	filter: contrast(1.05);
}

.fcac-captcha-refresh {
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	color: #64748b;
	border-radius: 50%;
	cursor: pointer;
	padding: 0;
	font-size: 20px;
	height: 40px;
	width: 40px;
	min-width: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	outline: none;
	box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.fcac-captcha-refresh:hover,
.fcac-captcha-refresh:focus {
	background: #eff6ff;
	border-color: #bfdbfe;
	color: #3b82f6;
	transform: rotate(90deg);
	box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.2);
}

.fcac-captcha-refresh:active {
	transform: scale(0.9) rotate(90deg);
}

.fcac-input-wrapper {
	display: flex;
	width: 100%;
}

.fcac-captcha-input {
	padding: 10px 14px;
	border: 1px solid #cbd5e1;
	border-radius: 8px;
	width: 100%;
	min-width: 180px;
	font-size: 15px;
	color: #334155;
	background: #f8fafc;
	box-sizing: border-box;
	transition: all 0.2s ease;
	letter-spacing: 1px;
}

.fcac-captcha-input::placeholder {
	color: #94a3b8;
	letter-spacing: normal;
}

.fcac-captcha-input:focus {
	border-color: #3b82f6;
	background: #fff;
	outline: none;
	box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* Strict Honeypot Hidden Fields */
.fcac-honeypot {
	display: none !important;
	visibility: hidden !important;
	opacity: 0 !important;
	width: 0 !important;
	height: 0 !important;
	position: absolute !important;
	z-index: -9999 !important;
}

@media (max-width: 480px) {
	.fcac-captcha-wrapper {
		width: 100%;
		display: flex;
	}
	.fcac-image-wrapper {
		flex-direction: column;
		align-items: flex-start;
	}
	.fcac-captcha-refresh {
		position: absolute;
		right: 16px;
		top: 20px;
	}
	.fcac-captcha-input {
		width: 100%;
	}
}

/* Spinner Keyframes & Class */
@keyframes fcac-spin {
	from { transform: rotate(0deg); }
	to { transform: rotate(360deg); }
}
.fcac-spinning {
	animation: fcac-spin 0.6s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

/* --- CAPTCHA Themes --- */

/* 1. Sleek Dark Theme */
.fcac-theme-dark {
	background: #1e1e1e !important;
	border: 1px solid #333 !important;
	color: #fff !important;
}
.fcac-theme-dark .fcac-captcha-image {
	border-color: #444 !important;
	background: #111 !important;
	box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5) !important;
}
.fcac-theme-dark .fcac-captcha-refresh {
	background: #2a2a2a !important;
	border-color: #444 !important;
	color: #ccc !important;
}
.fcac-theme-dark .fcac-captcha-refresh:hover {
	background: #3a3a3a !important;
	color: #fff !important;
}
.fcac-theme-dark .fcac-captcha-input {
	background: #111 !important;
	border-color: #444 !important;
	color: #fff !important;
}

/* 2. Neon Security Theme */
.fcac-theme-neon {
	background: #0d0d0d !important;
	border: 1px solid #39ff14 !important;
	box-shadow: 0 0 10px rgba(57, 255, 20, 0.2) !important;
	color: #39ff14 !important;
}
.fcac-theme-neon .fcac-captcha-image {
	border-color: #39ff14 !important;
	background: #000 !important;
}
.fcac-theme-neon .fcac-captcha-refresh {
	background: #1a1a1a !important;
	border-color: #39ff14 !important;
	color: #39ff14 !important;
}
.fcac-theme-neon .fcac-captcha-refresh:hover {
	background: #39ff14 !important;
	color: #000 !important;
	box-shadow: 0 0 10px rgba(57, 255, 20, 0.4) !important;
}
.fcac-theme-neon .fcac-captcha-input {
	background: #000 !important;
	border-color: #39ff14 !important;
	color: #39ff14 !important;
}
.fcac-theme-neon .fcac-captcha-input:focus {
	box-shadow: 0 0 10px rgba(57, 255, 20, 0.4) !important;
}

/* 3. Glassmorphism Theme */
.fcac-theme-glass {
	background: rgba(255, 255, 255, 0.15) !important;
	backdrop-filter: blur(10px) !important;
	-webkit-backdrop-filter: blur(10px) !important;
	border: 1px solid rgba(255, 255, 255, 0.25) !important;
	box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07) !important;
}
.fcac-theme-glass .fcac-captcha-image {
	border: 1px solid rgba(255, 255, 255, 0.2) !important;
	background: rgba(255, 255, 255, 0.8) !important;
}

/* 4. Sunset Glow Theme */
.fcac-theme-sunset {
	background: #fff5f5 !important;
	border: 2px solid transparent !important;
	background-image: linear-gradient(#fff5f5, #fff5f5), linear-gradient(135deg, #ff7e5f, #feb47b) !important;
	background-origin: border-box !important;
	background-clip: padding-box, border-box !important;
	box-shadow: 0 4px 15px rgba(255, 126, 95, 0.1) !important;
}
.fcac-theme-sunset .fcac-captcha-refresh {
	background: linear-gradient(135deg, #ff7e5f, #feb47b) !important;
	color: #fff !important;
	border: none !important;
}
.fcac-theme-sunset .fcac-captcha-refresh:hover {
	opacity: 0.9 !important;
}

/* ==========================================================================
   WPForms Specific Overrides (No !important)
   ========================================================================== */

.wpforms-container .fcac-captcha-wrapper {
	margin: 15px 0;
	padding: 10px;
	border-radius: 8px;
	background: rgba(255, 255, 255, 0.05);
	border: 1px solid rgba(0, 0, 0, 0.08);
	display: inline-block;
	max-width: 100%;
	box-sizing: border-box;
}

.wpforms-container .fcac-screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal;
}

.wpforms-container .fcac-image-wrapper {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 10px;
	flex-wrap: wrap;
}

.wpforms-container .fcac-captcha-image {
	border: 1px solid #ddd;
	border-radius: 4px;
	background: #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
	display: block;
	max-width: 100%;
	height: auto;
}

.wpforms-container button.fcac-captcha-refresh,
.wpforms-container .wpforms-field button.fcac-captcha-refresh {
	background: #f7f7f7;
	border: 1px solid #ccc;
	color: #555;
	border-radius: 4px;
	cursor: pointer;
	padding: 6px 12px;
	font-size: 18px;
	line-height: 1;
	height: 40px;
	width: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.2s ease;
	outline: none;
}

.wpforms-container .fcac-input-wrapper {
	display: block;
	margin-top: 10px;
}

div.wpforms-container .wpforms-form .wpforms-field input[type=text].fcac-captcha-input {
	padding: 8px 12px;
	border: 1px solid #ccc;
	border-radius: 4px;
	width: 150px;
	max-width: 100%;
	font-size: 14px;
	box-sizing: border-box;
	display: inline-block;
}
