/*
 * Smart Forms Pro — Frontend Stylesheet
 */

/* ── Auto Style layout (opt-in per form) ─────────────────────── */
/*
 * All rules here are scoped to .smfp-auto-styled which is added to the
 * <form> element only when the "Auto Style this form" checkbox is checked
 * in the form editor. Forms without the checkbox remain completely unstyled.
 */

.smfp-auto-styled p {
	margin: 0 0 16px;
}

.smfp-auto-styled label {
	display: block;
	margin-bottom: 16px;
	font-size: 14px;
	font-weight: 500;
	color: #374151;
	line-height: 1.5;
}

/* Label text on its own line, input below */
.smfp-auto-styled label > .smfp-form-control-wrap,
.smfp-auto-styled label > input,
.smfp-auto-styled label > textarea,
.smfp-auto-styled label > select {
	display: block;
	margin-top: 6px;
}

/* Full-width text-like inputs */
.smfp-auto-styled input[type="text"],
.smfp-auto-styled input[type="email"],
.smfp-auto-styled input[type="tel"],
.smfp-auto-styled input[type="url"],
.smfp-auto-styled input[type="number"],
.smfp-auto-styled input[type="password"],
.smfp-auto-styled input[type="search"],
.smfp-auto-styled input[type="date"],
.smfp-auto-styled input[type="time"],
.smfp-auto-styled textarea,
.smfp-auto-styled select {
	display: block;
	width: 100%;
	box-sizing: border-box;
	padding: 8px 12px;
	border: 1px solid #d1d5db;
	border-radius: 6px;
	font-size: 14px;
	color: #111827;
	background: #fff;
	line-height: 1.5;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.smfp-auto-styled input[type="text"]:focus,
.smfp-auto-styled input[type="email"]:focus,
.smfp-auto-styled input[type="tel"]:focus,
.smfp-auto-styled input[type="url"]:focus,
.smfp-auto-styled input[type="number"]:focus,
.smfp-auto-styled input[type="password"]:focus,
.smfp-auto-styled input[type="search"]:focus,
.smfp-auto-styled input[type="date"]:focus,
.smfp-auto-styled input[type="time"]:focus,
.smfp-auto-styled textarea:focus,
.smfp-auto-styled select:focus {
	outline: none;
	border-color: #1e40af;
	box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.15);
}

/* Radio / checkbox groups */
.smfp-auto-styled .smfp-list-item {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 0 16px 6px 0;
}

.smfp-auto-styled .smfp-list-item input[type="radio"],
.smfp-auto-styled .smfp-list-item input[type="checkbox"] {
	width: auto;
	margin: 0;
}

/* Submit button */
.smfp-auto-styled input[type="submit"],
.smfp-auto-styled .smfp-submit {
	display: inline-block;
	padding: 10px 24px;
	background: #1e40af;
	color: #fff;
	border: none;
	border-radius: 6px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s ease;
}

.smfp-auto-styled input[type="submit"]:hover,
.smfp-auto-styled .smfp-submit:hover {
	background: #1e3a8a;
}

/* ─────────────────────────────────────────────────────────────── */

.smfp .screen-reader-response {
	position: absolute;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	width: 1px;
	margin: -1px;
	padding: 0;
	border: 0;
	word-wrap: normal !important;
}

.smfp .hidden-fields-container {
	display: none;
}

.smfp form .smfp-response-output {
	margin: 2em 0.5em 1em;
	padding: 12px 16px;
	border-radius: 6px;
	font-size: 14px;
	line-height: 1.5;
	border: none;
	border-left: 4px solid #1e40af;
	background: #eff6ff;
	color: #1e3a8a;
}

.smfp form.init .smfp-response-output,
.smfp form.resetting .smfp-response-output,
.smfp form.submitting .smfp-response-output {
	display: none;
}

.smfp form.sent .smfp-response-output {
	border-left-color: #16a34a;
	background: #f0fdf4;
	color: #15803d;
}

.smfp form.failed .smfp-response-output,
.smfp form.aborted .smfp-response-output {
	border-left-color: #dc2626;
	background: #fef2f2;
	color: #b91c1c;
}

.smfp form.spam .smfp-response-output {
	border-left-color: #d97706;
	background: #fffbeb;
	color: #b45309;
}

.smfp form.invalid .smfp-response-output,
.smfp form.unaccepted .smfp-response-output,
.smfp form.payment-required .smfp-response-output {
	border-left-color: #d97706;
	background: #fffbeb;
	color: #b45309;
}

.smfp-form-control-wrap {
	position: relative;
}

.smfp-not-valid-tip {
	color: #dc2626;
	font-size: 0.875em;
	font-weight: 500;
	display: block;
	margin-top: 4px;
}

.use-floating-validation-tip .smfp-not-valid-tip {
	position: relative;
	top: -2ex;
	left: 1em;
	z-index: 100;
	border: 1px solid #dc2626;
	background: #fef2f2;
	padding: 4px 12px;
	width: 24em;
	border-radius: 6px;
}

.smfp-list-item {
	display: inline-block;
	margin: 0 0 0 1em;
}

.smfp-list-item-label::before,
.smfp-list-item-label::after {
	content: " ";
}

.smfp-spinner {
	visibility: hidden;
	display: inline-block;
	background-color: #1e40af;
	opacity: 0.75;
	width: 24px;
	height: 24px;
	border: none;
	border-radius: 100%;
	padding: 0;
	margin: 0 24px;
	position: relative;
}

form.submitting .smfp-spinner {
	visibility: visible;
}

.smfp-spinner::before {
	content: '';
	position: absolute;
	background-color: #ffffff;
	top: 4px;
	left: 4px;
	width: 6px;
	height: 6px;
	border: none;
	border-radius: 100%;
	transform-origin: 8px 8px;
	animation-name: smfp-spin;
	animation-duration: 1000ms;
	animation-timing-function: linear;
	animation-iteration-count: infinite;
}

@media (prefers-reduced-motion: reduce) {
	.smfp-spinner::before {
		animation-name: smfp-blink;
		animation-duration: 2000ms;
	}
}

@keyframes smfp-spin {
	from {
		transform: rotate(0deg);
	}

	to {
		transform: rotate(360deg);
	}
}

@keyframes smfp-blink {
	from {
		opacity: 0;
	}

	50% {
		opacity: 1;
	}

	to {
		opacity: 0;
	}
}

.smfp [inert] {
	opacity: 0.5;
}

.smfp input[type="file"] {
	cursor: pointer;
}

.smfp input[type="file"]:disabled {
	cursor: default;
}

.smfp .smfp-submit:disabled {
	cursor: not-allowed;
}

.smfp input[type="url"],
.smfp input[type="email"],
.smfp input[type="tel"] {
	direction: ltr;
}

.smfp-reflection > output {
	display: list-item;
	list-style: none;
}

.smfp-reflection > output[hidden] {
	display: none;
}
