/* Modern Contact Form Style - Boxbillion */

/* Honeypot — ต้องซ่อนจากสายตาแต่ยังอยู่ใน DOM ให้บอทเห็น */
.bbl-hp {
	position: absolute !important;
	left: -9999px !important;
	top: auto;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.bbl-error-message {
	color: #b91c1c;
	background: #fee2e2;
	border: 1px solid #fca5a5;
	padding: 12px 16px;
	border-radius: 8px;
	margin-bottom: 20px;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.7;
	font-family: 'Prompt', sans-serif;
}

.bbl-form-wrapper {
	max-width: 800px;
	margin: 0 auto;
	box-sizing: border-box;
	font-family: 'Prompt', sans-serif;
}

.bbl-form-wrapper * {
	box-sizing: border-box;
}

/* --- 1. Form Styling --- */
.bbl-modern-form {
	max-width: 100% !important;
	margin: 0 auto !important;
	font-family: 'Prompt', sans-serif !important;
	display: flex;
	flex-direction: column;
	gap: 0;
}

.bbl-row {
	display: flex !important;
	gap: 20px !important;
	margin-bottom: 20px !important;
}

.bbl-group {
	flex: 1 !important;
	margin-bottom: 15px !important;
	display: flex;
	flex-direction: column;
}

.bbl-group.full {
	width: 100% !important;
}

.bbl-group label {
	display: block !important;
	font-size: 14px !important;
	font-weight: 600 !important;
	color: var(--bbcf-brand-color, #254783) !important; /* สีหัวข้อตามตั้งค่า */
	margin-bottom: 8px !important;
}

.req {
	color: red !important;
} /* ดอกจันสีแดง */

/* Input Fields */
.bbl-modern-form input,
.bbl-modern-form textarea {
	width: 100% !important;
	padding: 12px 16px !important;
	border: 1px solid #cbd5e0 !important;
	border-radius: 8px !important;
	font-size: 15px !important;
	background-color: #ffffff !important;
	transition: all 0.3s ease !important;
	color: #333 !important;
	font-family: 'Prompt', sans-serif !important;
}

.bbl-modern-form input:focus,
.bbl-modern-form textarea:focus {
	border-color: var(--bbcf-brand-color, #254783) !important; /* สีโฟกัสตามตั้งค่า */
	box-shadow: 0 0 0 4px rgba(var(--bbcf-brand-rgb, 37, 71, 131), 0.1) !important;
	outline: none !important;
}

.bbl-modern-form input::placeholder,
.bbl-modern-form textarea::placeholder {
	color: #a0aec0 !important;
}

/* Button */
.bbl-submit-btn {
	background: var(--bbcf-brand-color, #1C5D83) !important; /* สีปุ่มตามตั้งค่า */
	color: #ffffff !important;
	padding: 14px 30px !important;
	border: 2px solid var(--bbcf-brand-color, #1C5D83) !important;
	border-radius: 8px !important;
	cursor: pointer !important;
	font-weight: 600 !important;
	font-size: 16px !important;
	width: 100% !important;
	transition: 0.3s !important;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	gap: 8px !important;
	font-family: 'Prompt', sans-serif !important;
}

.bbl-submit-btn:hover {
	background: #ffffff !important;
	color: var(--bbcf-brand-color, #1C5D83) !important;
	border: 2px solid var(--bbcf-brand-color, #1C5D83) !important;
}

button.bbl-submit-btn:hover {
	color: var(--bbcf-brand-color, #1C5D83) !important;
}

.bbl-submit-btn span {
	line-height: 1 !important;
}

/* สถานะปกติ: เอียงชี้ขึ้นบนขวา */
.bbl-submit-btn svg.bbl-btn-icon {
	display: block !important;
	flex-shrink: 0 !important;
	transform: rotate(-35deg) translate(2px, -2px);
	transition: transform 0.3s ease;
}

/* สถานะเมื่อ Hover: หมุนกลับมาแนวระนาบตรงปกติ พร้อมพุ่งไปข้างหน้า */
.bbl-submit-btn:hover svg.bbl-btn-icon {
	transform: rotate(0deg) translate(4px, 0);
}

.bbl-submit-btn:disabled {
	opacity: 0.7 !important;
	cursor: not-allowed !important;
	transform: none !important;
}

/* AJAX Spinner */
.bbl-spinner {
	display: inline-block;
	width: 16px;
	height: 16px;
	border: 2px solid rgba(255, 255, 255, 0.35);
	border-radius: 50%;
	border-top-color: #ffffff;
	animation: bblSpin 0.8s linear infinite;
	margin-left: 4px;
}

@keyframes bblSpin {
	to {
		transform: rotate(360deg);
	}
}

/* Mobile Responsive */
@media (max-width: 768px) {
	.bbl-row {
		flex-direction: column !important;
		gap: 0 !important;
	}
}

/* --- 2. Modal Popup Styling --- */
.bbl-modal-overlay {
	position: fixed !important;
	top: 0 !important;
	left: 0 !important;
	width: 100% !important;
	height: 100% !important;
	background: rgba(0, 0, 0, 0.6) !important; /* ฉากหลังดำจางๆ */
	z-index: 99999 !important;
	display: none;
	justify-content: center !important;
	align-items: center !important;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.3s ease-out;
	font-family: 'Prompt', sans-serif !important;
}

.bbl-modal-overlay.is-open {
	display: flex !important;
	opacity: 1 !important;
	visibility: visible !important;
	pointer-events: auto !important;
	animation: fadeIn 0.3s ease-out forwards;
}

/* ป้องกันไม่ให้ Modal แสดงในหน้าแก้ไข Elementor โดยเด็ดขาด */
.elementor-editor-active .bbl-modal-overlay,
.elementor-editor-preview .bbl-modal-overlay,
body.elementor-editor-active #successModal,
body.elementor-editor-preview #successModal {
	display: none !important;
	opacity: 0 !important;
	visibility: hidden !important;
	pointer-events: none !important;
}

.bbl-modal-box {
	background: #ffffff !important;
	width: 90% !important;
	max-width: 400px !important;
	padding: 40px 30px !important;
	border-radius: 20px !important;
	text-align: center !important;
	box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3) !important;
	font-family: 'Prompt', sans-serif !important;
}

.bbl-modal-overlay.is-open .bbl-modal-box {
	animation: slideUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.bbl-modal-icon {
	width: 80px !important;
	height: 80px !important;
	background: var(--bbcf-brand-color, #254783) !important; /* วงกลมสีแบรนด์ตามตั้งค่า */
	border-radius: 50% !important;
	margin: 0 auto 20px !important;
	display: flex !important;
	justify-content: center !important;
	align-items: center !important;
	color: #ffffff !important;
	box-shadow: 0 10px 20px rgba(var(--bbcf-brand-rgb, 37, 71, 131), 0.3) !important;
}

.bbl-modal-icon svg {
	width: 40px !important;
	height: 40px !important;
}

.bbl-modal-box h3 {
	margin: 0 0 10px !important;
	color: var(--bbcf-brand-color, #254783) !important;
	font-size: 24px !important;
	font-weight: 700 !important;
}

.bbl-modal-box p {
	margin: 0 0 25px !important;
	color: #666666 !important;
	line-height: 1.6 !important;
	font-size: 15px !important;
}

.bbl-modal-btn {
	background: var(--bbcf-brand-color, #254783) !important;
	color: #ffffff !important;
	border: none !important;
	padding: 12px 40px !important;
	border-radius: 30px !important;
	font-size: 16px !important;
	font-weight: 600 !important;
	cursor: pointer !important;
	transition: 0.2s !important;
	font-family: 'Prompt', sans-serif !important;
}

.bbl-modal-btn:hover {
	opacity: 0.9;
}

/* Animation Keyframes */
@keyframes fadeIn {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

@keyframes slideUp {
	from {
		transform: translateY(50px);
		opacity: 0;
	}
	to {
		transform: translateY(0);
		opacity: 1;
	}
}
