/* FOXDOO Forms — mobile-first frontend styles */

.fxd-form {
	--fxd-accent: #f26722;
	--fxd-ink: #2b2b2b;
	--fxd-line: #d9d4cc;
	--fxd-bg: #fff;
	--fxd-err: #c0392b;
	max-width: 760px;
	margin: 0 auto;
	color: var(--fxd-ink);
	font-size: 16px; /* >=16px keeps iOS from zooming on focus */
	line-height: 1.5;
}

.fxd-fields {
	display: flex;
	flex-wrap: wrap;
	gap: 14px 18px;
}

.fxd-row { flex: 1 1 100%; min-width: 0; }

/* Two columns from tablet up; phones stay single-column */
@media (min-width: 600px) {
	.fxd-row.fxd-half { flex: 1 1 calc(50% - 9px); }
}

.fxd-label {
	display: block;
	font-weight: 600;
	margin-bottom: 6px;
}

.fxd-req { color: var(--fxd-err); }

.fxd-form input[type="text"],
.fxd-form input[type="email"],
.fxd-form input[type="tel"],
.fxd-form input[type="number"],
.fxd-form input[type="date"],
.fxd-form textarea {
	width: 100%;
	box-sizing: border-box;
	padding: 12px 14px;
	font-size: 16px;
	border: 1px solid var(--fxd-line);
	border-radius: 8px;
	background: var(--fxd-bg);
	color: var(--fxd-ink);
	-webkit-appearance: none;
	appearance: none;
	min-height: 48px; /* comfortable touch target */
}

/* iOS date inputs collapse to zero width without this */
.fxd-form input[type="date"] { display: block; min-width: 0; }

.fxd-form input:focus,
.fxd-form textarea:focus {
	outline: none;
	border-color: var(--fxd-accent);
	box-shadow: 0 0 0 3px rgba(242, 103, 34, 0.15);
}

.fxd-form input.fxd-invalid,
.fxd-form textarea.fxd-invalid,
.fxd-signature-box.fxd-invalid {
	border-color: var(--fxd-err);
}

.fxd-sublabel { display: block; font-size: 12.5px; color: #8a8a8a; margin-top: 4px; }

.fxd-name-pair { display: flex; gap: 12px; }
.fxd-name-pair > div { flex: 1; min-width: 0; }
@media (max-width: 480px) {
	.fxd-name-pair { flex-direction: column; }
}

.fxd-field-error { color: var(--fxd-err); font-size: 13.5px; margin-top: 5px; display: block; }

/* Radios / checkbox — big touch targets */
.fxd-radio-group { display: flex; flex-wrap: wrap; gap: 10px; }
.fxd-radio {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	border: 1px solid var(--fxd-line);
	border-radius: 999px;
	padding: 10px 18px;
	cursor: pointer;
	min-height: 44px;
	box-sizing: border-box;
	user-select: none;
}
.fxd-radio input { width: 18px; height: 18px; accent-color: var(--fxd-accent); margin: 0; }
.fxd-radio:has(input:checked) {
	border-color: var(--fxd-accent);
	background: rgba(242, 103, 34, 0.08);
}

.fxd-check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.fxd-check input { width: 20px; height: 20px; min-width: 20px; margin-top: 2px; accent-color: var(--fxd-accent); }

/* Terms scrollbox */
.fxd-scrollbox {
	max-height: 260px;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	border: 1px solid var(--fxd-line);
	border-radius: 8px;
	padding: 14px 16px;
	font-size: 14px;
	background: #faf8f5;
}
.fxd-scrollbox p:first-child { margin-top: 0; }

/* Kids group repeater */
.fxd-group { border: 1px solid var(--fxd-line); border-radius: 10px; padding: 14px 16px 16px; margin: 0; }
.fxd-group legend { font-weight: 700; padding: 0 6px; }
.fxd-group-item { border-bottom: 1px dashed var(--fxd-line); padding-bottom: 14px; margin-bottom: 14px; }
.fxd-group-item:last-child { border-bottom: 0; }
.fxd-group-item-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.fxd-group-n { font-weight: 700; color: var(--fxd-accent); }
.fxd-group-n::before { content: "Kid "; }
.fxd-group-add,
.fxd-group-remove {
	background: none;
	border: 1px solid var(--fxd-accent);
	color: var(--fxd-accent);
	border-radius: 8px;
	padding: 10px 16px;
	font-size: 15px;
	cursor: pointer;
	min-height: 44px;
}
.fxd-group-remove { border-color: #bbb; color: #777; min-height: 36px; padding: 6px 12px; font-size: 13.5px; }

/* Signature */
.fxd-signature-box {
	position: relative;
	border: 1px dashed var(--fxd-line);
	border-radius: 8px;
	background: #fff;
	height: 180px;
	touch-action: none; /* stop page scroll while signing on touch devices */
}
.fxd-signature-box canvas { width: 100%; height: 100%; display: block; border-radius: 8px; }
.fxd-signature-hint {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #c3bdb4;
	font-size: 15px;
	pointer-events: none;
}
.fxd-signature-hint.fxd-hidden { display: none; }
.fxd-signature-actions { margin-top: 8px; }
.fxd-signature-clear {
	background: none;
	border: 1px solid #bbb;
	color: #666;
	border-radius: 8px;
	padding: 8px 16px;
	cursor: pointer;
	min-height: 40px;
}

/* Turnstile widget + submit sit outside the .fxd-fields flex gap,
   so they need their own breathing room */
.fxd-form .cf-turnstile { margin: 22px 0 4px; }
.fxd-submit-row { margin-top: 22px; }
.fxd-error-summary { margin: 16px 0 0; }

/* Submit */
.fxd-submit {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	background: var(--fxd-accent);
	color: #fff;
	border: 0;
	border-radius: 999px;
	padding: 14px 40px;
	font-size: 17px;
	font-weight: 700;
	cursor: pointer;
	min-height: 52px;
	width: 100%;
	justify-content: center;
}
@media (min-width: 600px) {
	.fxd-submit { width: auto; }
}
.fxd-submit:disabled { opacity: 0.6; cursor: default; }
.fxd-spinner {
	width: 18px;
	height: 18px;
	border: 2.5px solid rgba(255, 255, 255, 0.4);
	border-top-color: #fff;
	border-radius: 50%;
	animation: fxd-spin 0.7s linear infinite;
}
@keyframes fxd-spin { to { transform: rotate(360deg); } }

.fxd-error-summary {
	background: #fdf0ee;
	border: 1px solid #efc4bd;
	color: var(--fxd-err);
	border-radius: 8px;
	padding: 12px 16px;
	margin-top: 4px;
}
.fxd-success {
	background: #eef7f0;
	border: 1px solid #bfe0c8;
	color: #1e6b3a;
	border-radius: 8px;
	padding: 16px 18px;
	font-weight: 600;
}

/* Honeypot — visually gone, still in DOM for bots */
.fxd-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
