/* FT Form frontend */
.ftf-form, .ftf-closed {
	--ftf-primary: #3FA34D;
	--ftf-dark: #34883F;
	--ftf-tint: #ECF6EE;
	--ftf-ink: #16242B;
	--ftf-muted: #8A99A0;
	--ftf-border: #d6dee1;
	--ftf-radius: 8px;
	--ftf-gutter: 16px;
	max-width: 100%;
}

.ftf-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

.ftf-closed {
	background: var(--ftf-tint); border: 1px solid var(--ftf-primary);
	color: var(--ftf-dark); padding: 16px 20px; border-radius: var(--ftf-radius);
}
.ftf-form-desc { color: var(--ftf-muted); margin-bottom: 20px; }

/* Row layout: padding gutters so 50%+50% and 33%x3 fit exactly */
.ftf-fields { display: flex; flex-wrap: wrap; align-items: flex-start; margin: 0 calc(var(--ftf-gutter) / -2); }
.ftf-field {
	display: flex; flex-direction: column; box-sizing: border-box;
	padding: 0 calc(var(--ftf-gutter) / 2); margin-bottom: 18px;
}
.ftf-w-full  { width: 100%; }
.ftf-w-half  { width: 50%; }
.ftf-w-third { width: 33.3333%; }

.ftf-is-hidden { display: none !important; }

/* Field size caps the control, not the column — never the choice inputs */
.ftf-size-small input:not([type="checkbox"]):not([type="radio"]),
.ftf-size-small select, .ftf-size-small textarea { max-width: 40%; }
.ftf-size-medium input:not([type="checkbox"]):not([type="radio"]),
.ftf-size-medium select, .ftf-size-medium textarea { max-width: 70%; }

.ftf-label { font-weight: 600; color: var(--ftf-ink); margin-bottom: 6px; font-size: .95em; }
.ftf-req { color: #c0392b; }
.ftf-desc { color: var(--ftf-muted); font-size: .85em; margin-top: 6px; line-height: 1.5; }

.ftf-field input[type="text"], .ftf-field input[type="email"], .ftf-field input[type="tel"],
.ftf-field input[type="number"], .ftf-field input[type="url"], .ftf-field input[type="date"],
.ftf-field textarea, .ftf-field select {
	width: 100%; border: 1px solid var(--ftf-border); border-radius: var(--ftf-radius);
	padding: 11px 14px; font: inherit; line-height: 1.4; color: var(--ftf-ink); background-color: #fff;
	box-sizing: border-box; transition: border-color .15s, box-shadow .15s; margin: 0;
}
/* Native selects vary wildly between themes — draw our own arrow. */
.ftf-field select {
	appearance: none; -webkit-appearance: none; -moz-appearance: none;
	padding-right: 40px; cursor: pointer;
	background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%238A99A0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 14px center;
	background-size: 12px 8px;
}
.ftf-field select::-ms-expand { display: none; }
.ftf-field input:focus, .ftf-field textarea:focus, .ftf-field select:focus {
	outline: none; border-color: var(--ftf-primary); box-shadow: 0 0 0 3px rgba(63,163,77,.18);
}
.ftf-field input[readonly] { background-color: #f4f7f7; color: var(--ftf-muted); }
.ftf-field textarea { resize: vertical; min-height: 120px; }

.ftf-choices { display: block; }
.ftf-choices.ftf-cols-2 { columns: 2; column-gap: var(--ftf-gutter); }
.ftf-choices.ftf-cols-3 { columns: 3; column-gap: var(--ftf-gutter); }
.ftf-choice {
	display: flex; align-items: flex-start; gap: 10px; color: var(--ftf-ink);
	cursor: pointer; margin: 0 0 9px; break-inside: avoid; line-height: 1.5; font-weight: 400;
}
.ftf-choice:last-child { margin-bottom: 0; }
/* Reset theme overrides so the box renders at a sane size. */
.ftf-choice input[type="checkbox"], .ftf-choice input[type="radio"] {
	accent-color: var(--ftf-primary);
	width: 18px; height: 18px; min-width: 18px; max-width: 18px;
	margin: 2px 0 0; padding: 0; flex: none;
	appearance: auto; -webkit-appearance: auto; -moz-appearance: auto;
	position: static; opacity: 1; cursor: pointer;
}
.ftf-choice span { flex: 1; min-width: 0; }
/* Consent sits on its own, so give it a touch more breathing room. */
.ftf-type-consent .ftf-choice { align-items: flex-start; }

.ftf-heading { margin: 6px 0 2px; color: var(--ftf-ink); }
.ftf-divider { border: 0; border-top: 1px solid var(--ftf-border); margin: 6px 0; width: 100%; }
.ftf-captcha-q { font-weight: 600; color: var(--ftf-ink); margin: 0 0 8px; }
.ftf-captcha-wrap { margin-bottom: 6px; }

.ftf-actions { margin-top: 6px; }
.ftf-align-center { text-align: center; }
.ftf-align-right { text-align: right; }
.ftf-align-full .ftf-submit { width: 100%; justify-content: center; }

.ftf-submit {
	display: inline-flex; align-items: center; gap: 10px;
	background: var(--ftf-primary); color: #fff; border: 0; border-radius: var(--ftf-radius);
	padding: 13px 30px; font: inherit; font-weight: 600; cursor: pointer; transition: background .15s;
}
.ftf-submit:hover { background: var(--ftf-dark); }
.ftf-submit:disabled { opacity: .6; cursor: default; }

.ftf-spinner {
	display: none; width: 15px; height: 15px;
	border: 2px solid rgba(255,255,255,.4); border-top-color: #fff;
	border-radius: 50%; animation: ftf-spin .7s linear infinite;
}
.ftf-form.is-sending .ftf-spinner { display: inline-block; }
@keyframes ftf-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ftf-spinner { animation: none; } }

.ftf-message { display: none; margin-top: 16px; padding: 13px 16px; border-radius: var(--ftf-radius); }
.ftf-message.is-success { display: block; background: var(--ftf-tint); color: var(--ftf-dark); border: 1px solid var(--ftf-primary); }
.ftf-message.is-error { display: block; background: #fdf0ef; color: #b03a2e; border: 1px solid #e6b0aa; }
.ftf-message p:last-child { margin-bottom: 0; }

@media (max-width: 782px) { .ftf-w-third { width: 50%; } }
@media (max-width: 600px) {
	.ftf-w-half, .ftf-w-third { width: 100%; }
	.ftf-choices.ftf-cols-2, .ftf-choices.ftf-cols-3 { columns: 1; }
	.ftf-size-small input:not([type="checkbox"]):not([type="radio"]),
	.ftf-size-small select,
	.ftf-size-medium input:not([type="checkbox"]):not([type="radio"]),
	.ftf-size-medium select { max-width: 100%; }
}
