/* FunnelMaker frontend */

.fm-funnel {
	--fm-primary: #2563eb;
	--fm-primary-fg: #fff;
	--fm-bg: #f6f8fb;
	--fm-card: #fff;
	--fm-text: #334155;
	--fm-headline: #0f172a;
	--fm-muted: #64748b;
	--fm-border: #e2e8f0;
	--fm-btn-radius: 10px;
	--fm-card-radius: 16px;
	--fm-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

	font-family: var(--fm-font);
	color: var(--fm-text);
	background: var(--fm-bg);
	border-radius: var(--fm-card-radius);
	padding: 28px;
	max-width: 720px;
	margin: 0 auto;
	box-sizing: border-box;
}

.fm-funnel *,
.fm-funnel *::before,
.fm-funnel *::after {
	box-sizing: border-box;
}

.fm-standalone-body {
	margin: 0;
	background: #eef1f6;
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px 12px;
}

.fm-standalone-body main {
	width: 100%;
}

.fm-logo {
	margin-bottom: 16px;
	display: flex;
}

.fm-logo.fm-align-center {
	justify-content: center;
}

.fm-logo.fm-align-right {
	justify-content: flex-end;
}

.fm-logo img {
	height: auto;
	max-width: 100%;
}

.fm-header {
	margin-bottom: 16px;
}

.fm-header-title {
	margin: 0;
	font-size: 22px;
	color: var(--fm-headline);
}

.fm-header-sub {
	margin: 4px 0 0;
	color: var(--fm-muted);
	font-size: 14px;
}

.fm-progress {
	height: 6px;
	border-radius: 999px;
	background: var(--fm-border);
	overflow: hidden;
	margin-bottom: 20px;
}

.fm-progress-bar {
	display: block;
	height: 100%;
	background: var(--fm-primary);
	transition: width 0.35s ease;
}

.fm-step {
	background: var(--fm-card);
	border: 1px solid var(--fm-border);
	border-radius: var(--fm-card-radius);
	padding: 28px;
	animation: fm-fade 0.3s ease;
}

.fm-funnel[data-transition="slide"] .fm-step {
	animation: fm-slide 0.32s ease;
}

.fm-funnel[data-transition="scale"] .fm-step {
	animation: fm-scale 0.28s ease;
}

.fm-funnel[data-transition="none"] .fm-step {
	animation: none;
}

@keyframes fm-fade {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes fm-slide {
	from { opacity: 0; transform: translateX(24px); }
	to { opacity: 1; transform: translateX(0); }
}

@keyframes fm-scale {
	from { opacity: 0; transform: scale(0.97); }
	to { opacity: 1; transform: scale(1); }
}

.fm-funnel[data-display-mode="onepager"] .fm-step {
	margin-bottom: 16px;
}

.fm-tag {
	display: inline-block;
	background: color-mix(in srgb, var(--fm-primary) 12%, transparent);
	color: var(--fm-primary);
	font-size: 12px;
	font-weight: 700;
	padding: 4px 12px;
	border-radius: 999px;
	margin-bottom: 12px;
	letter-spacing: 0.02em;
}

.fm-headline {
	color: var(--fm-headline);
	font-size: 26px;
	line-height: 1.25;
	margin: 0 0 10px;
}

.fm-h3 {
	color: var(--fm-headline);
	font-size: 17px;
	margin: 20px 0 8px;
}

.fm-sub {
	color: var(--fm-muted);
	font-size: 15px;
	margin: 0 0 18px;
	line-height: 1.6;
}

.fm-rich {
	font-size: 15px;
	line-height: 1.7;
	margin-bottom: 18px;
}

.fm-hero {
	margin: -28px -28px 20px;
	overflow: hidden;
	border-radius: var(--fm-card-radius) var(--fm-card-radius) 0 0;
}

.fm-hero.fm-hero-boxed {
	margin: 0 0 20px;
	border-radius: calc(var(--fm-card-radius) - 4px);
}

.fm-hero img {
	width: 100%;
	display: block;
	object-fit: cover;
	max-height: 320px;
}

.fm-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	background: var(--fm-primary);
	color: var(--fm-primary-fg);
	border: none;
	border-radius: var(--fm-btn-radius);
	padding: 13px 26px;
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
	text-decoration: none;
	transition: transform 0.15s ease, filter 0.15s ease;
	font-family: inherit;
}

.fm-btn:hover {
	filter: brightness(1.07);
	transform: translateY(-1px);
	color: var(--fm-primary-fg);
}

.fm-btn[disabled] {
	opacity: 0.6;
	cursor: progress;
	transform: none;
}

.fm-back {
	background: none;
	border: none;
	color: var(--fm-muted);
	font-size: 14px;
	cursor: pointer;
	padding: 8px 0;
	font-family: inherit;
}

.fm-back:hover {
	color: var(--fm-primary);
}

.fm-actions {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-top: 22px;
	flex-wrap: wrap;
}

.fm-answers {
	display: grid;
	gap: 12px;
}

.fm-cols-1 { grid-template-columns: 1fr; }
.fm-cols-2 { grid-template-columns: repeat(2, 1fr); }
.fm-cols-3 { grid-template-columns: repeat(3, 1fr); }
.fm-cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 560px) {
	.fm-cols-2,
	.fm-cols-3,
	.fm-cols-4 {
		grid-template-columns: 1fr;
	}

	.fm-funnel { padding: 16px; }
	.fm-step { padding: 20px; }
	.fm-hero { margin: -20px -20px 16px; }
	.fm-headline { font-size: 22px; }
}

.fm-answer {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	text-align: center;
	background: var(--fm-card);
	border: 2px solid var(--fm-border);
	border-radius: var(--fm-btn-radius);
	padding: 18px 14px;
	cursor: pointer;
	font-size: 15px;
	font-weight: 600;
	color: var(--fm-text);
	transition: all 0.18s ease;
	font-family: inherit;
}

.fm-answer:hover,
.fm-answer.is-selected {
	border-color: var(--fm-primary);
	color: var(--fm-primary);
	transform: translateY(-2px);
	box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.fm-answer-icon {
	font-size: 28px;
}

.fm-answer-img {
	width: 100%;
	height: 110px;
	object-fit: cover;
	border-radius: 8px;
}

.fm-answer-sub {
	font-size: 12px;
	font-weight: 400;
	color: var(--fm-muted);
}

.fm-cards {
	display: grid;
	gap: 14px;
}

.fm-card {
	background: var(--fm-card);
	border: 1px solid var(--fm-border);
	border-radius: var(--fm-btn-radius);
	padding: 18px;
	margin: 0;
}

.fm-card strong {
	display: block;
	color: var(--fm-headline);
	margin-bottom: 4px;
}

.fm-card p {
	margin: 6px 0 0;
	font-size: 14px;
	color: var(--fm-muted);
	line-height: 1.6;
}

.fm-card-icon {
	font-size: 26px;
	display: block;
	margin-bottom: 8px;
}

.fm-person img {
	width: 68px;
	height: 68px;
	border-radius: 50%;
	object-fit: cover;
	margin-bottom: 10px;
}

.fm-muted {
	color: var(--fm-muted);
	font-size: 13px;
}

.fm-list {
	list-style: none;
	padding: 0;
	margin: 0 0 12px;
}

.fm-list li {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	padding: 8px 0;
	border-bottom: 1px solid var(--fm-border);
	font-size: 15px;
}

.fm-list li:last-child {
	border-bottom: none;
}

.fm-meta {
	list-style: none;
	padding: 0;
	margin: 0 0 16px;
	display: flex;
	gap: 16px;
	flex-wrap: wrap;
	color: var(--fm-muted);
	font-size: 14px;
}

.fm-split {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 20px;
	align-items: center;
}

@media (max-width: 560px) {
	.fm-split { grid-template-columns: 1fr; }
}

.fm-split-img {
	width: 100%;
	border-radius: var(--fm-btn-radius);
	object-fit: cover;
}

.fm-video iframe,
.fm-video video {
	width: 100%;
	aspect-ratio: 16 / 9;
	border: none;
	border-radius: var(--fm-btn-radius);
}

/* Form */
.fm-fields {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 14px;
}

.fm-field {
	grid-column: span 2;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.fm-field.fm-half {
	grid-column: span 1;
}

@media (max-width: 560px) {
	.fm-field.fm-half { grid-column: span 2; }
}

.fm-field label {
	font-size: 13px;
	font-weight: 600;
	color: var(--fm-headline);
}

.fm-field input,
.fm-field select,
.fm-field textarea {
	width: 100%;
	border: 1px solid var(--fm-border);
	border-radius: var(--fm-btn-radius);
	padding: 11px 13px;
	font-size: 15px;
	font-family: inherit;
	color: var(--fm-text);
	background: var(--fm-card);
}

.fm-field input:focus,
.fm-field select:focus,
.fm-field textarea:focus {
	outline: none;
	border-color: var(--fm-primary);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--fm-primary) 18%, transparent);
}

.fm-field.has-error input,
.fm-field.has-error select,
.fm-field.has-error textarea {
	border-color: #dc2626;
}

.fm-field-error {
	color: #dc2626;
	font-size: 12px;
}

.fm-radios {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.fm-radios label,
.fm-checkbox {
	display: flex;
	align-items: center;
	gap: 8px;
	font-weight: 400;
	font-size: 14px;
}

.fm-checkbox input,
.fm-radios input {
	width: auto;
}

.fm-req {
	color: #dc2626;
}

.fm-consent {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	font-size: 13px;
	color: var(--fm-muted);
	margin-top: 16px;
	line-height: 1.5;
}

.fm-consent input {
	margin-top: 3px;
}

.fm-error-box {
	background: #fef2f2;
	border: 1px solid #fecaca;
	color: #b91c1c;
	border-radius: var(--fm-btn-radius);
	padding: 10px 14px;
	font-size: 14px;
	margin-top: 14px;
}

.fm-result {
	text-align: center;
	padding: 20px 0;
}

.fm-result-icon {
	font-size: 52px;
	display: block;
	margin-bottom: 12px;
}

.fm-footer {
	text-align: center;
	color: var(--fm-muted);
	font-size: 12px;
	margin-top: 18px;
}

.fm-branding {
	text-align: center;
	font-size: 11px;
	color: var(--fm-muted);
	opacity: 0.7;
	margin: 14px 0 0;
}

.fm-notice {
	padding: 12px;
	background: #fffbeb;
	border: 1px solid #fde68a;
	border-radius: 8px;
}

/* ── layout modes ───────────────────────────────────── */
.fm-funnel { --fm-max-width: 720px; }
.fm-funnel.fm-layout-centered { max-width: var(--fm-max-width); margin: 0 auto; }
.fm-funnel.fm-layout-wide { max-width: 1080px; margin: 0 auto; }
.fm-funnel.fm-layout-frame {
	max-width: var(--fm-max-width);
	margin: 0 auto;
	padding: 24px;
	background: var(--fm-card);
	border-radius: var(--fm-card-radius);
}
.fm-funnel.fm-layout-fullsize { max-width: none; width: 100%; }
.fm-funnel.fm-bordered.fm-layout-frame { border: 1px solid var(--fm-border); }
.fm-funnel.fm-no-border .fm-step { border: 0; }
.fm-funnel.fm-no-shadow .fm-step,
.fm-funnel.fm-no-shadow.fm-layout-frame { box-shadow: none; }
.fm-funnel.fm-layout-frame.fm-no-shadow { box-shadow: none; }
.fm-funnel.fm-layout-frame:not(.fm-no-shadow) { box-shadow: 0 18px 40px rgba(15, 23, 42, .08); }

/* ── in-page modules ────────────────────────────────── */
.fm-module { margin: 16px 0; }
.fm-module-img { max-width: 100%; height: auto; border-radius: var(--fm-card-radius); display: block; }
.fm-module-list { margin: 0; padding-left: 20px; color: var(--fm-text); }
.fm-module-list li { margin-bottom: 6px; }
.fm-module-quote {
	margin: 0;
	padding: 14px 18px;
	border-left: 3px solid var(--fm-primary);
	background: rgba(0, 0, 0, .03);
	border-radius: 8px;
	color: var(--fm-text);
}
.fm-module-quote cite { display: block; margin-top: 8px; font-size: 13px; color: var(--fm-muted); font-style: normal; }
.fm-module-text p { margin: 0 0 10px; color: var(--fm-text); }
.fm-module-btn { display: inline-block; text-decoration: none; }
.fm-divider { border: 0; border-top: 1px solid var(--fm-border); margin: 20px 0; }
.fm-module .fm-video iframe { max-width: 100%; }
