/**
 * 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.

   Gestion McGill brand: premium real-estate look - deep green,
   sage tints, subtle warm-gold details, Outfit headings + Inter body.
   Every design token lives on .cfb-styled as a CSS variable, so any
   of them can be overridden from the theme / Elementor CSS:
     .cfb-styled { --cfb-green: #34443F; }
   ============================================================ */

.cfb-styled {
	--cfb-green: #34443F;        /* primary dark green - buttons, focus  */
	--cfb-green-dark: #2A3834;   /* deep green - hover / darker areas    */
	--cfb-green-light: #DCE7DB;  /* sage - highlights, focus ring        */
	--cfb-tint: #EAF1E9;         /* light sage - soft backgrounds        */
	--cfb-cream: #F7F6EF;        /* warm ivory                           */
	--cfb-cream-dark: #E4E8E3;   /* hairline borders                     */
	--cfb-gold: #B99A5A;         /* warm gold - decorative accents       */
	--cfb-gold-light: #D8C18A;
	--cfb-black: #0E0E0E;        /* primary text                         */
	--cfb-ink: #0E0E0E;
	--cfb-muted: #5F6663;        /* paragraphs, secondary text           */
	--cfb-placeholder: #8E9692;
	--cfb-danger: #B3261E;
	--cfb-radius-field: 10px;
	--cfb-radius-area: 10px;
	--cfb-radius-card: 16px;
	--cfb-font-heading: "Outfit", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
	--cfb-font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

	position: relative;
	width: 100%;
	max-width: 720px;
	box-sizing: border-box;
	padding: clamp(22px, 4.5vw, 44px);
	background: #FFFFFF;
	border: 1px solid var(--cfb-cream-dark);
	border-radius: var(--cfb-radius-card);
	box-shadow: 0 24px 48px -32px rgba(42, 56, 52, 0.28);
	overflow: hidden;
	font-family: var(--cfb-font-body);
	font-size: 16px;
	color: var(--cfb-ink);
	-webkit-font-smoothing: antialiased;
}

/* Thin gold hairline along the top edge of the card */
.cfb-styled::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 3px;
	background: linear-gradient(90deg, var(--cfb-gold) 0%, var(--cfb-gold-light) 55%, rgba(216, 193, 138, 0) 100%);
	pointer-events: none;
}

.cfb-styled *,
.cfb-styled *::before,
.cfb-styled *::after {
	box-sizing: border-box;
}

/* Two-column grid. Any template can reuse .cfb-grid / .cfb-field / .cfb-col-full. */
.cfb-styled .cfb-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 22px 18px;
}

.cfb-styled .cfb-col-full {
	grid-column: 1 / -1;
}

.cfb-styled .cfb-field {
	min-width: 0;
	animation: cfb-rise 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.cfb-styled .cfb-field:nth-child(2) { animation-delay: 0.04s; }
.cfb-styled .cfb-field:nth-child(3) { animation-delay: 0.08s; }
.cfb-styled .cfb-field:nth-child(4) { animation-delay: 0.12s; }
.cfb-styled .cfb-field:nth-child(5) { animation-delay: 0.16s; }
.cfb-styled .cfb-field:nth-child(6) { animation-delay: 0.20s; }

@keyframes cfb-rise {
	from { opacity: 0; transform: translateY(10px); }
	to   { opacity: 1; transform: translateY(0); }
}

.cfb-styled label {
	display: block;
	margin: 0 0 9px;
	font-family: var(--cfb-font-heading);
	font-size: 14.5px;
	font-weight: 500;
	line-height: 1.3;
	letter-spacing: 0.005em;
	color: var(--cfb-black);
}

.cfb-styled .cfb-req {
	color: var(--cfb-danger);
	font-weight: 500;
}

.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 {
	display: block;
	width: 100%;
	margin: 0;
	padding: 0 20px;
	height: 54px;
	font-family: var(--cfb-font-body);
	font-size: 16px;
	font-weight: 400;
	line-height: 1.4;
	color: var(--cfb-black);
	background-color: #FFFFFF;
	border: 1px solid var(--cfb-cream-dark);
	border-radius: var(--cfb-radius-field);
	box-shadow: none;
	transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
	-webkit-appearance: none;
	appearance: none;
}

.cfb-styled input::placeholder,
.cfb-styled textarea::placeholder {
	color: var(--cfb-placeholder);
	opacity: 1;
}

.cfb-styled select {
	padding-right: 48px;
	cursor: pointer;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2334443F' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 20px center;
	background-size: 12px 12px;
}

.cfb-styled textarea {
	height: auto;
	min-height: 170px;
	padding: 16px 20px;
	border-radius: var(--cfb-radius-area);
	resize: vertical;
}

.cfb-styled input:hover,
.cfb-styled select:hover,
.cfb-styled textarea:hover {
	border-color: #C9D3CC;
}

.cfb-styled input:focus,
.cfb-styled select:focus,
.cfb-styled textarea:focus {
	outline: none;
	background-color: #FFFFFF;
	border-color: var(--cfb-green);
	box-shadow: 0 0 0 4px rgba(220, 231, 219, 0.9);
}

.cfb-styled input[type="file"] {
	display: block;
	width: 100%;
	padding: 14px 18px;
	font-family: var(--cfb-font-body);
	font-size: 14px;
	color: var(--cfb-ink);
	background: var(--cfb-cream);
	border: 1px dashed #C9D3CC;
	border-radius: var(--cfb-radius-field);
}

.cfb-styled input[type="file"]::file-selector-button {
	margin-right: 12px;
	padding: 8px 16px;
	font-family: var(--cfb-font-heading);
	font-size: 13px;
	font-weight: 500;
	color: #fff;
	background: var(--cfb-green);
	border: 0;
	border-radius: 8px;
	cursor: pointer;
}

.cfb-styled .cfb-radio-option,
.cfb-styled .cfb-checkbox-option {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	font-family: var(--cfb-font-body);
	font-size: 15px;
	font-weight: 400;
	cursor: pointer;
}

.cfb-styled input[type="radio"],
.cfb-styled input[type="checkbox"] {
	width: 20px;
	height: 20px;
	margin: 0;
	accent-color: var(--cfb-green);
}

.cfb-styled .cfb-field-hint {
	margin: 6px 0 0;
	font-size: 12.5px;
	color: var(--cfb-muted);
}

.cfb-styled .cfb-math-captcha {
	margin-top: 20px;
	padding: 14px 18px;
	background: var(--cfb-cream);
	border-radius: var(--cfb-radius-field);
}

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

.cfb-styled .cfb-math-captcha input {
	background: #fff;
	height: 46px;
}

/* Primary button - deep green gradient with a soft shadow */
.cfb-styled .cfb-submit-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	margin-top: 26px;
	padding: 0 28px;
	height: 54px;
	font-family: var(--cfb-font-heading);
	font-size: 16px;
	font-weight: 600;
	letter-spacing: 0.005em;
	color: #fff;
	background: linear-gradient(120deg, var(--cfb-green-dark) 0%, var(--cfb-green) 55%, #455A53 100%);
	border: 1px solid var(--cfb-green-dark);
	border-radius: var(--cfb-radius-field);
	box-shadow: 0 16px 30px -16px rgba(42, 56, 52, 0.75);
	cursor: pointer;
	transition: background-position 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.cfb-styled .cfb-submit-btn:hover {
	background: linear-gradient(120deg, #1F2A27 0%, var(--cfb-green-dark) 100%);
	box-shadow: 0 20px 34px -16px rgba(42, 56, 52, 0.85);
	transform: translateY(-1px);
}

.cfb-styled .cfb-submit-btn:focus-visible {
	outline: 3px solid var(--cfb-gold-light);
	outline-offset: 3px;
}

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

.cfb-styled .cfb-submit-arrow {
	flex: 0 0 auto;
	transition: transform 0.2s ease;
}

.cfb-styled .cfb-submit-btn:hover .cfb-submit-arrow {
	transform: translateX(4px);
}

.cfb-styled .cfb-submit-btn.cfb-loading {
	opacity: 0.7;
}

/* Privacy note under the button (optional - add <p class="cfb-privacy"> to a template) */
.cfb-styled .cfb-privacy {
	margin: 16px 2px 0;
	font-family: var(--cfb-font-body);
	font-size: 12.5px;
	line-height: 1.55;
	color: var(--cfb-muted);
}

/* Success / error message */
.cfb-styled .cfb-message {
	margin-top: 18px;
	padding: 14px 18px;
	border-radius: var(--cfb-radius-field);
	font-size: 15px;
	line-height: 1.5;
}

.cfb-styled .cfb-message-success {
	background: var(--cfb-tint);
	color: var(--cfb-green-dark);
	border: 1px solid var(--cfb-green-light);
	border-left: 3px solid var(--cfb-gold);
}

.cfb-styled .cfb-message-error {
	background: #FBEAE8;
	color: var(--cfb-danger);
	border: 1px solid #F1C9C5;
}

/* Multi-step buttons */
.cfb-styled .cfb-step-back,
.cfb-styled .cfb-step-next {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 50px;
	padding: 0 28px;
	font-family: var(--cfb-font-heading);
	font-size: 15px;
	font-weight: 500;
	border-radius: var(--cfb-radius-field);
	border: 0;
	cursor: pointer;
	transition: background-color 0.2s ease;
}

.cfb-styled .cfb-step-next {
	color: #fff;
	background: var(--cfb-green);
}

.cfb-styled .cfb-step-next:hover {
	background: var(--cfb-green-dark);
}

.cfb-styled .cfb-step-back {
	color: var(--cfb-black);
	background: var(--cfb-tint);
}

.cfb-styled .cfb-step-back:hover {
	background: var(--cfb-green-light);
}

.cfb-styled .cfb-progress-bar-track {
	background: var(--cfb-tint);
}

.cfb-styled .cfb-progress-bar-fill,
.cfb-styled .cfb-progress-dots .cfb-progress-dot.cfb-progress-current,
.cfb-styled .cfb-progress-numbers .cfb-progress-num.cfb-progress-current {
	background: var(--cfb-green);
}

.cfb-styled .cfb-progress-dots .cfb-progress-dot.cfb-progress-done,
.cfb-styled .cfb-progress-numbers .cfb-progress-num.cfb-progress-done {
	background: var(--cfb-gold-light);
	color: var(--cfb-green-dark);
}

.cfb-styled .cfb-progress-dots .cfb-progress-dot,
.cfb-styled .cfb-progress-numbers .cfb-progress-num {
	background: var(--cfb-cream-dark);
}

.cfb-styled .cfb-field-invalid {
	border-color: var(--cfb-danger) !important;
	box-shadow: 0 0 0 4px rgba(179, 38, 30, 0.12) !important;
}

@media (max-width: 560px) {
	.cfb-styled .cfb-grid {
		grid-template-columns: minmax(0, 1fr);
		gap: 18px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.cfb-styled *,
	.cfb-styled *::before,
	.cfb-styled *::after {
		transition: none !important;
		animation: none !important;
	}
}

/* ============================================================
   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;
}

.cfb-ext-toggle {
	background: none;
	border: none;
	padding: 0;
	margin: 0;
	font: inherit;
	font-size: 12px;
	color: inherit;
	text-decoration: underline;
	cursor: pointer;
}

.cfb-ext-toggle:hover,
.cfb-ext-toggle:focus {
	color: #000;
}

/* ============================================================
   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;
}
