/**
 * Custom Form Builder Pro - minimal base styles.
 * Intentionally does NOT style inputs, buttons, or layout — that's yours
 * to design. This file only hides the honeypot trap and styles the
 * AJAX message box states.
 */

.cfb-hp-wrap {
	position: absolute !important;
	left: -9999px !important;
	top: -9999px !important;
	height: 0 !important;
	width: 0 !important;
	overflow: hidden !important;
}

.cfb-message {
	margin-top: 12px;
}

.cfb-message:empty {
	display: none;
}

.cfb-message-success {
	color: #1a7f37;
}

.cfb-message-error {
	color: #c1121f;
}

.cfb-submit-btn.cfb-loading {
	opacity: 0.6;
	cursor: wait;
	pointer-events: none;
}

.cfb-radio-group {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.cfb-radio-option,
.cfb-checkbox-option {
	display: flex;
	align-items: center;
	gap: 6px;
	font-weight: normal;
}

/* ============================================================
   OPTIONAL "Base Styling" - only applies to forms with the
   .cfb-styled class (toggled per-form in General Settings).
   Forms without this class are completely untouched, so
   existing custom-designed forms never change appearance.
   ============================================================ */

.cfb-styled {
	max-width: 560px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.cfb-styled label {
	display: block;
	font-size: 14px;
	font-weight: 600;
	color: #222;
	margin: 16px 0 6px;
}

.cfb-styled label:first-of-type {
	margin-top: 0;
}

.cfb-styled input[type="text"],
.cfb-styled input[type="email"],
.cfb-styled input[type="tel"],
.cfb-styled input[type="number"],
.cfb-styled input[type="url"],
.cfb-styled input[type="date"],
.cfb-styled select,
.cfb-styled textarea {
	width: 100%;
	box-sizing: border-box;
	padding: 11px 14px;
	font-size: 15px;
	font-family: inherit;
	color: #222;
	background: #fff;
	border: 1px solid #d5d8dc;
	border-radius: 8px;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.cfb-styled textarea {
	min-height: 120px;
	resize: vertical;
}

.cfb-styled input:focus,
.cfb-styled select:focus,
.cfb-styled textarea:focus {
	outline: none;
	border-color: #2271b1;
	box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.15);
}

.cfb-styled .cfb-math-captcha {
	margin-top: 16px;
	padding: 12px 14px;
	background: #f7f8fa;
	border: 1px solid #e2e4e7;
	border-radius: 8px;
}

.cfb-styled .cfb-math-captcha label {
	margin: 0 0 8px;
}

.cfb-styled .cfb-submit-btn {
	display: inline-block;
	margin-top: 20px;
	padding: 12px 28px;
	font-size: 15px;
	font-weight: 600;
	color: #fff;
	background: #2271b1;
	border: none;
	border-radius: 8px;
	cursor: pointer;
	transition: background 0.15s ease, transform 0.05s ease;
}

.cfb-styled .cfb-submit-btn:hover {
	background: #195a8d;
}

.cfb-styled .cfb-submit-btn:active {
	transform: translateY(1px);
}

.cfb-styled .cfb-submit-btn.cfb-loading {
	background: #6b93b5;
}

.cfb-styled .cfb-message {
	margin-top: 16px;
	padding: 12px 14px;
	border-radius: 8px;
	font-size: 14px;
}

.cfb-styled .cfb-message-success {
	background: #eaf6ec;
	color: #1a7f37;
}

.cfb-styled .cfb-message-error {
	background: #fbeaea;
	color: #c1121f;
}

.cfb-styled .cfb-step-back,
.cfb-styled .cfb-step-next {
	display: inline-block;
	padding: 12px 28px;
	font-size: 15px;
	font-weight: 600;
	border-radius: 8px;
	border: none;
	cursor: pointer;
	font-family: inherit;
}

.cfb-styled .cfb-step-next {
	color: #fff;
	background: #2271b1;
}

.cfb-styled .cfb-step-next:hover {
	background: #195a8d;
}

.cfb-styled .cfb-step-back {
	color: #2271b1;
	background: #eef4f9;
}

.cfb-styled .cfb-step-back:hover {
	background: #e0ecf5;
}

@media (max-width: 480px) {
	.cfb-styled .cfb-submit-btn {
		width: 100%;
	}
}

/* ============================================================
   MULTI-STEP ("wizard") MODE
   Applies to any [data-steps="1"] form, whether or not Base
   Styling is also on, since these are structural/functional
   rules rather than a visual theme.
   ============================================================ */

.cfb-step-marker {
	display: none;
}

.cfb-step {
	display: none;
}

.cfb-step.cfb-step-active {
	display: block;
	animation: cfb-step-fade-in 0.2s ease;
}

@keyframes cfb-step-fade-in {
	from { opacity: 0; transform: translateY(4px); }
	to   { opacity: 1; transform: translateY(0); }
}

.cfb-step-nav {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	margin-top: 20px;
}

.cfb-step-back,
.cfb-step-next {
	cursor: pointer;
}

.cfb-step-back[hidden] {
	visibility: hidden;
}

/* Progress bar */
.cfb-progress-bar-track {
	height: 6px;
	background: #e2e4e7;
	border-radius: 999px;
	overflow: hidden;
	margin-bottom: 20px;
}

.cfb-progress-bar-fill {
	height: 100%;
	background: #2271b1;
	border-radius: 999px;
	transition: width 0.25s ease;
}

/* Dots */
.cfb-progress-dots {
	display: flex;
	gap: 8px;
	margin-bottom: 20px;
}

.cfb-progress-dots .cfb-progress-dot {
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: #d5d8dc;
	transition: background 0.2s ease, transform 0.2s ease;
}

.cfb-progress-dots .cfb-progress-dot.cfb-progress-current {
	background: #2271b1;
	transform: scale(1.25);
}

.cfb-progress-dots .cfb-progress-dot.cfb-progress-done {
	background: #7fb2da;
}

/* Numbered steps */
.cfb-progress-numbers {
	display: flex;
	gap: 6px;
	margin-bottom: 20px;
	flex-wrap: wrap;
}

.cfb-progress-numbers .cfb-progress-num {
	width: 26px;
	height: 26px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 12px;
	font-weight: 600;
	background: #e2e4e7;
	color: #50575e;
}

.cfb-progress-numbers .cfb-progress-num.cfb-progress-current {
	background: #2271b1;
	color: #fff;
}

.cfb-progress-numbers .cfb-progress-num.cfb-progress-done {
	background: #7fb2da;
	color: #fff;
}

.cfb-field-invalid {
	border-color: #c1121f !important;
	box-shadow: 0 0 0 3px rgba(193, 18, 31, 0.12) !important;
}

.cfb-field-hint {
	font-size: 12px;
	color: #666;
	margin: 2px 0 0;
}

/* ============================================================
   Conditional Logic - hidden by default (matches the common
   real-world case where the triggering field starts empty), then
   shown/hidden accurately once cfb-frontend.js evaluates on load.
   If JavaScript is unavailable, hidden fields stay hidden rather
   than flashing incorrectly, which is an acceptable trade-off since
   this plugin already relies on JS for its AJAX submission and spam
   protection.
   ============================================================ */

.cfb-cond-field[data-cfb-cond-field] {
	display: none;
}

/* ============================================================
   Rating field (pure CSS star rating - no JS required)
   ============================================================ */

.cfb-rating-group {
	display: flex;
	flex-direction: row-reverse;
	justify-content: flex-end;
	gap: 2px;
	margin: 4px 0 14px;
}

.cfb-rating-group input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
}

.cfb-rating-group label {
	font-size: 28px;
	line-height: 1;
	color: #d5d8dc;
	cursor: pointer;
	transition: color 0.15s ease;
}

.cfb-rating-group input:checked ~ label,
.cfb-rating-group label:hover,
.cfb-rating-group label:hover ~ label {
	color: #f5a623;
}

.cfb-rating-group input:focus-visible + label {
	outline: 2px solid #2271b1;
	outline-offset: 2px;
	border-radius: 2px;
}
