/* Funnel Factory — full-screen overlay quote funnel (Convincely-style takeover).
   Generic engine stylesheet: every brand decision comes from --fnl-* tokens,
   which funnel.js sets from the per-client config's theme block.
   Mobile rules encode the hard lessons from the Rama build: the overlay is a
   fixed flex column, the inner main must fill it and scroll internally, the
   brand aside collapses to a slim band, radios are custom-drawn. */

.fnl {
	--fnl-primary: #2b6cb0;
	--fnl-primary-dark: #1e4e8c;
	--fnl-panel: #1a2b3c;
	--fnl-panel-ink: #ffffff;
	--fnl-panel-ink-soft: #d7e0e8;
	--fnl-bg: #f6f4ef;
	--fnl-border: #ddd5c6;
	--fnl-ink: #383838;
	--fnl-ink-soft: #5a5a5a;
	--fnl-field-border: #c9bda7;
	--fnl-radius: 5px;
	--fnl-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	position: fixed;
	inset: 0;
	z-index: 100000;
	background: var(--fnl-bg);
	color: var(--fnl-ink);
	display: flex;
	flex-direction: column;
	opacity: 0;
	visibility: hidden;
	transform: translateY(10px);
	transition: opacity .3s ease, visibility .3s ease, transform .3s ease;
	font-family: var(--fnl-font);
	font-size: 16px;
	line-height: 1.4;
}
.fnl, .fnl * { box-sizing: border-box; }
.fnl.is-open { opacity: 1; visibility: visible; transform: none; }
html.fnl-open, body.fnl-open { overflow: hidden !important; }

/* Close */
.fnl__close {
	position: absolute;
	top: 1rem;
	right: 1.15rem;
	z-index: 5;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #fff;
	border: 1px solid var(--fnl-border);
	color: var(--fnl-panel);
	cursor: pointer;
	padding: 0;
	line-height: 1;
	transition: transform .2s, background .2s, color .2s;
}
.fnl__close svg { width: 20px; height: 20px; }
.fnl__close:hover { background: var(--fnl-panel); color: #fff; transform: scale(1.06); }

.fnl__main { display: flex; flex: 1; min-height: 0; }

/* ---- Left: brand / trust panel ---- */
.fnl__aside {
	flex: 0 0 40%;
	max-width: 460px;
	background: var(--fnl-panel);
	color: var(--fnl-panel-ink);
	padding: 3rem 2.5rem;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	gap: 1.75rem;
}
.fnl__brand { font-size: 1.3rem; font-weight: 800; letter-spacing: -.01em; }
.fnl__brand span, .fnl__brand em { color: var(--fnl-primary); font-style: normal; }
.fnl__brand img { max-height: 44px; max-width: 220px; display: block; }
/* explicit color: host-theme heading rules (e.g. h2 { color: … }) beat inheritance */
.fnl__headline { font-size: 1.7rem; line-height: 1.25; font-weight: 700; letter-spacing: -.02em; margin: 0; font-family: var(--fnl-font-heading, inherit); color: var(--fnl-panel-ink); }
.fnl__points { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .7rem; }
.fnl__brand { color: var(--fnl-panel-ink); }
.fnl__points li { position: relative; padding-left: 1.6rem; font-size: .95rem; line-height: 1.45; color: var(--fnl-panel-ink-soft); margin: 0; }
.fnl__points li::before {
	content: ""; position: absolute; left: 0; top: .35em;
	width: .7rem; height: .7rem; border-radius: 50%; background: var(--fnl-primary);
}
.fnl__facts { display: flex; flex-direction: column; gap: .9rem; }
.fnl__fact {
	background: rgba(255,255,255,.07);
	border: 1px solid rgba(255,255,255,.12);
	border-left: 3px solid var(--fnl-primary);
	border-radius: 6px;
	padding: .95rem 1.1rem;
}
.fnl__fact.is-hidden { display: none; }
.fnl__fact-badge {
	display: inline-flex; align-items: center; gap: .35rem;
	font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
	color: var(--fnl-primary); margin-bottom: .4rem;
}
.fnl__fact-badge svg { width: 14px; height: 14px; }
.fnl__fact-text { font-size: .83rem; line-height: 1.55; color: var(--fnl-panel-ink-soft); margin: 0; }
.fnl__assurance { margin-top: auto; font-size: .8rem; color: var(--fnl-panel-ink-soft); display: flex; align-items: center; gap: .5rem; }
.fnl__assurance svg { width: 16px; height: 16px; flex: none; }

/* ---- Right: form pane ---- */
.fnl__form { position: relative; flex: 1 1 60%; overflow-y: auto; padding: 3rem 2.5rem; }
.fnl__form-inner { max-width: 600px; width: 100%; margin: 0 auto; }
.fnl__form-head { margin-bottom: 1.25rem; }
.fnl__form-title { font-size: 1.6rem; font-weight: 700; color: var(--fnl-panel); letter-spacing: -.02em; margin: 0 0 .35rem; font-family: var(--fnl-font-heading, inherit); }
.fnl__form-sub { font-size: .98rem; color: var(--fnl-ink-soft); margin: 0; line-height: 1.5; }

/* ---- Progress steps ---- */
.fnl__progress { display: flex; flex-wrap: wrap; gap: .35rem 1.4rem; margin: 0 0 1.75rem; padding: 0; list-style: none; }
.fnl__progress li { display: flex; align-items: center; gap: .5rem; font-size: .82rem; font-weight: 600; color: var(--fnl-ink-soft); }
.fnl__progress .fnl__step-num {
	width: 26px; height: 26px; border-radius: 50%; flex: none;
	display: inline-flex; align-items: center; justify-content: center;
	border: 2px solid var(--fnl-field-border); background: #fff; color: var(--fnl-ink-soft);
	font-size: .78rem; font-weight: 700;
}
.fnl__progress li.is-active { color: var(--fnl-panel); }
.fnl__progress li.is-active .fnl__step-num { background: var(--fnl-primary); border-color: var(--fnl-primary); color: #fff; }
.fnl__progress li.is-done .fnl__step-num { background: var(--fnl-primary); border-color: var(--fnl-primary); color: #fff; }

/* ---- Fields ---- */
.fnl__step { display: none; }
.fnl__step.is-active { display: block; }
.fnl__field { margin-bottom: 1.1rem; }
.fnl__field.is-hidden { display: none; }
.fnl__label { display: block; font-weight: 600; color: var(--fnl-panel); font-size: .95rem; margin-bottom: .45rem; }
.fnl__label .fnl__req { color: #c0392b; }
.fnl__hint { font-size: .82rem; color: var(--fnl-ink-soft); margin: -.2rem 0 .45rem; }
.fnl__field input[type="text"],
.fnl__field input[type="email"],
.fnl__field input[type="tel"],
.fnl__field input[type="number"],
.fnl__field textarea,
.fnl__field select {
	border: 1px solid var(--fnl-field-border); border-radius: var(--fnl-radius);
	padding: 11px 12px; font-size: 15px; width: 100%; background: #fff;
	color: var(--fnl-ink); font-family: inherit; height: auto; line-height: 1.4;
}
.fnl__field textarea { min-height: 96px; resize: vertical; }
.fnl__field select:invalid, .fnl__field select option[value=""] { color: var(--fnl-ink-soft); }
.fnl__field select option { color: var(--fnl-ink); }
.fnl__field input:focus, .fnl__field textarea:focus, .fnl__field select:focus {
	border-color: var(--fnl-primary); outline: none;
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--fnl-primary) 18%, transparent);
}
.fnl__field.has-error input, .fnl__field.has-error textarea, .fnl__field.has-error select,
.fnl__field.has-error .fnl__option { border-color: #c0392b; }
.fnl__error { display: none; font-size: .8rem; color: #c0392b; margin-top: .35rem; }
.fnl__field.has-error .fnl__error { display: block; }

/* Radio options as tappable cards */
.fnl__options { display: flex; flex-direction: column; gap: .55rem; }
.fnl__option {
	display: flex; align-items: flex-start; gap: .7rem;
	border: 1px solid var(--fnl-field-border); border-radius: var(--fnl-radius);
	background: #fff; padding: 12px 14px; cursor: pointer;
	transition: border-color .15s, box-shadow .15s;
}
.fnl__option:hover { border-color: var(--fnl-primary); }
.fnl__option input[type="radio"] {
	appearance: none; -webkit-appearance: none; flex: none;
	width: 20px; height: 20px; margin: 1px 0 0; border: 2px solid var(--fnl-field-border);
	border-radius: 50%; background: #fff; cursor: pointer; position: relative;
}
.fnl__option input[type="radio"]:checked { border-color: var(--fnl-primary); }
.fnl__option input[type="radio"]:checked::after {
	content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--fnl-primary);
}
.fnl__option input[type="radio"]:focus-visible { outline: 2px solid var(--fnl-primary); outline-offset: 2px; }
.fnl__option.is-checked { border-color: var(--fnl-primary); box-shadow: 0 0 0 1px var(--fnl-primary); }
.fnl__option-label { font-size: .95rem; font-weight: 600; color: var(--fnl-ink); }
.fnl__option-desc { font-size: .82rem; color: var(--fnl-ink-soft); margin-top: .15rem; }

/* HTML / notice blocks */
.fnl__html { font-size: 15px; line-height: 1.5; }
.fnl__html strong { color: var(--fnl-panel); }
.fnl__notice {
	background: color-mix(in srgb, var(--fnl-primary) 14%, #fff);
	border-left: 4px solid var(--fnl-primary); border-radius: var(--fnl-radius);
	padding: 14px 16px; font-size: 15px; line-height: 1.5;
}
.fnl__notice a { color: var(--fnl-primary-dark); font-weight: 600; }
.fnl__notice .fnl__cta {
	display: inline-block; margin-top: 12px; padding: 11px 20px; border-radius: 6px;
	background: var(--fnl-primary); color: #fff !important; font-weight: 600; text-decoration: none;
}
.fnl__notice .fnl__cta:hover { background: var(--fnl-primary-dark); }

/* ---- Nav buttons ---- */
.fnl__nav { display: flex; align-items: center; gap: 10px; margin-top: 1.5rem; }
.fnl__btn {
	border: none; border-radius: var(--fnl-btn-radius, var(--fnl-radius)); padding: 12px 26px;
	font-size: 15px; font-weight: 600; cursor: pointer; font-family: inherit;
}
.fnl__btn--next { background: var(--fnl-primary); color: #fff; }
.fnl__btn--next:hover { background: var(--fnl-primary-dark); }
.fnl__btn--next[disabled] { opacity: .55; cursor: not-allowed; }
.fnl__btn--back { background: color-mix(in srgb, var(--fnl-panel) 12%, #fff); color: var(--fnl-panel); }

/* ---- Submitting veil + success ---- */
.fnl.fnl-loading .fnl__form-inner { opacity: .4; pointer-events: none; transition: opacity .12s ease; }
.fnl.fnl-loading .fnl__form::after {
	content: ""; position: absolute; top: 40%; left: 50%; width: 42px; height: 42px;
	margin: -21px 0 0 -21px; border-radius: 50%; z-index: 6;
	border: 3px solid color-mix(in srgb, var(--fnl-primary) 25%, transparent);
	border-top-color: var(--fnl-primary);
	animation: fnl-spin .7s linear infinite;
}
@keyframes fnl-spin { to { transform: rotate(360deg); } }
.fnl__success { font-size: 17px; line-height: 1.6; color: var(--fnl-panel); padding: 20px 0; }
.fnl__success h3 { margin: 0 0 .5rem; font-size: 1.4rem; font-family: var(--fnl-font-heading, inherit); }
.fnl__handoff {
	display: inline-block; margin-top: 1.25rem; padding: 14px 30px; border-radius: var(--fnl-btn-radius, var(--fnl-radius));
	background: var(--fnl-primary); color: #fff !important; font-weight: 700; font-size: 16px;
	text-decoration: none; transition: background .15s;
}
.fnl__handoff:hover { background: var(--fnl-primary-dark); }
.fnl__handoff-note { font-size: .85rem; color: var(--fnl-ink-soft); margin-top: .7rem; }

/* Honeypot */
.fnl__hp { position: absolute !important; left: -9999px !important; opacity: 0; height: 0; overflow: hidden; }

/* ---- Responsive: stack; aside becomes a compact top band ---- */
@media (max-width: 60em) {
	.fnl__main { flex-direction: column; flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
	.fnl__aside { flex: none; max-width: none; padding: 1.1rem 1.25rem; gap: .6rem; }
	.fnl__headline { font-size: 1.05rem; }
	.fnl__points, .fnl__assurance { display: none; }
	.fnl__form { padding: 1.5rem 1.25rem 3rem; overflow: visible; }
	.fnl__progress { gap: .35rem 0; }
	.fnl__progress li { flex: 0 0 50%; max-width: 50%; margin-bottom: .5rem; }
}
@media (max-width: 40em) {
	.fnl__facts { display: none; }
	.fnl__headline { display: none; }
	.fnl__aside { padding: .9rem 1.25rem; }
	.fnl__close { top: .55rem; right: .65rem; height: 38px; width: 38px; }
}

/* Defensive: host-theme heading styles must not inflate overlay text */
.fnl__aside h1,.fnl__aside h2,.fnl__aside h3{margin:0}
.fnl__headline{font-size:1.5rem !important;line-height:1.3 !important;font-weight:700 !important;color:var(--fnl-panel-ink) !important}
.fnl__form-title{font-size:1.4rem !important;line-height:1.2 !important;color:var(--fnl-panel) !important}
.fnl__brand,.fnl__brand *{color:var(--fnl-panel-ink) !important}
.fnl__points li{color:var(--fnl-panel-ink-soft) !important}
