/* ==========================================================================
   Rapid Legal Funding - Intake Form
   Palette and radius come from config/form-config.php via CSS variables.
   ========================================================================== */

.rlfi-wrap {
	--rlfi-ink: #0E1B2A;
	--rlfi-ink-soft: #43536A;
	--rlfi-accent: #B8862B;
	--rlfi-accent-dk: #96691B;
	--rlfi-success: #1F7A4D;
	--rlfi-surface: #FFFFFF;
	--rlfi-panel: #F5F6F8;
	--rlfi-line: #DCE0E7;
	--rlfi-error: #B3261E;
	--rlfi-radius: 10px;
	--rlfi-max: 680px;

	box-sizing: border-box;
	max-width: var(--rlfi-max);
	margin: 0 auto;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	color: var(--rlfi-ink);
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
}

.rlfi-wrap *,
.rlfi-wrap *::before,
.rlfi-wrap *::after { box-sizing: inherit; }

/* --------------------------------------------------------------------------
   Isolation. These rules use :where() so they carry ZERO specificity: they
   neutralize inherited theme styling inside the form without ever overriding
   the form's own rules further down this file, and without touching a single
   element outside .rlfi-wrap.
   -------------------------------------------------------------------------- */

.rlfi-wrap :where(fieldset) {
	border: 0;
	margin: 0;
	padding: 0;
	background: none;
	min-inline-size: auto;
}

.rlfi-wrap :where(legend) {
	float: none;
	width: 100%;
	max-width: 100%;
	border: 0;
	padding: 0;
	margin: 0;
	background: none;
	text-transform: none;
	letter-spacing: normal;
}

.rlfi-wrap :where(form) { margin: 0; padding: 0; background: none; border: 0; }

.rlfi-wrap :where(input, select, textarea, button) {
	float: none;
	margin: 0;
	max-width: 100%;
	min-height: 0;
	height: auto;
	letter-spacing: normal;
	text-transform: none;
	text-shadow: none;
	box-shadow: none;
	background-image: none;
	line-height: normal;
}

.rlfi-wrap :where(label) {
	display: block;
	float: none;
	margin: 0;
	text-transform: none;
	letter-spacing: normal;
	font-weight: 400;
}

.rlfi-wrap :where(p, h2, h3, ol, ul, li) {
	margin: 0;
	padding: 0;
	text-indent: 0;
	list-style: none;
}

.rlfi-wrap :where(li)::before,
.rlfi-wrap :where(li)::after { content: none; }

.rlfi-wrap :where(a) { box-shadow: none; border-bottom: 0; }

.rlfi-wrap :where(svg) { display: inline-block; max-width: 100%; vertical-align: middle; }

.rlfi-card {
	background: var(--rlfi-surface);
	border: 1px solid var(--rlfi-line);
	border-radius: var(--rlfi-radius);
	box-shadow: 0 1px 2px rgba(14, 27, 42, .05), 0 12px 32px -18px rgba(14, 27, 42, .35);
	overflow: hidden;
}

/* ---------- Header ---------- */

.rlfi-head {
	background: var(--rlfi-ink);
	color: #fff;
	padding: 26px 24px 22px;
	text-align: center;
}

.rlfi-brand {
	margin: 0 0 10px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .16em;
	text-transform: uppercase;
	color: var(--rlfi-accent);
}

.rlfi-headline {
	margin: 0;
	font-family: Georgia, "Iowan Old Style", "Times New Roman", serif;
	font-size: 25px;
	line-height: 1.22;
	font-weight: 600;
	color: #fff;
	letter-spacing: -0.01em;
}

.rlfi-subhead {
	margin: 12px 0 0;
	font-size: 13px;
	color: #A8B8CC;
	letter-spacing: .02em;
}

/* ---------- Progress ---------- */

.rlfi-progress { padding: 18px 24px 4px; }

.rlfi-progress-meta {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .04em;
	text-transform: uppercase;
	color: var(--rlfi-ink-soft);
	margin-bottom: 8px;
}

.rlfi-progress-pct { color: var(--rlfi-accent-dk); }

.rlfi-progress-track {
	height: 6px;
	border-radius: 99px;
	background: var(--rlfi-panel);
	overflow: hidden;
}

.rlfi-progress-fill {
	height: 100%;
	width: 0;
	border-radius: 99px;
	background: linear-gradient(90deg, var(--rlfi-accent-dk), var(--rlfi-accent));
	transition: width .45s cubic-bezier(.22, .61, .36, 1);
}

.rlfi-progress-steps {
	display: flex;
	justify-content: space-between;
	gap: 4px;
	list-style: none;
	margin: 14px 0 0;
	padding: 0;
}

.rlfi-progress-pill {
	flex: 1 1 0;
	text-align: center;
	font-size: 11px;
	color: var(--rlfi-ink-soft);
	opacity: .55;
	transition: opacity .25s ease;
}

.rlfi-progress-pill.is-active,
.rlfi-progress-pill.is-done { opacity: 1; }

.rlfi-pill-dot {
	display: block;
	width: 22px;
	height: 22px;
	margin: 0 auto 5px;
	border-radius: 50%;
	border: 1.5px solid var(--rlfi-line);
	line-height: 19px;
	font-size: 11px;
	font-weight: 700;
	color: var(--rlfi-ink-soft);
	background: #fff;
	transition: background .25s ease, color .25s ease, border-color .25s ease;
}

.rlfi-progress-pill.is-active .rlfi-pill-dot {
	background: var(--rlfi-ink);
	border-color: var(--rlfi-ink);
	color: #fff;
}

.rlfi-progress-pill.is-done .rlfi-pill-dot {
	background: var(--rlfi-accent);
	border-color: var(--rlfi-accent);
	color: #fff;
}

.rlfi-pill-label { display: block; letter-spacing: .02em; }

/* ---------- Form body ---------- */

.rlfi-form { padding: 8px 24px 24px; }

.rlfi-step {
	border: 0;
	margin: 0;
	padding: 14px 0 0;
	min-width: 0;
}

.rlfi-step[hidden] { display: none; }

.rlfi-step.is-entering { animation: rlfi-slide .32s cubic-bezier(.22, .61, .36, 1) both; }

@keyframes rlfi-slide {
	from { opacity: 0; transform: translateY(8px); }
	to   { opacity: 1; transform: none; }
}

.rlfi-step-title {
	display: block;
	width: 100%;
	padding: 0;
	margin: 0 0 4px;
}

.rlfi-step-num {
	display: block;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--rlfi-accent-dk);
	margin-bottom: 3px;
}

.rlfi-step-heading {
	display: block;
	font-family: Georgia, "Iowan Old Style", "Times New Roman", serif;
	font-size: 21px;
	font-weight: 600;
	color: var(--rlfi-ink);
}

.rlfi-step-sub {
	margin: 4px 0 0;
	font-size: 14px;
	color: var(--rlfi-ink-soft);
}

.rlfi-grid {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	margin-top: 18px;
}

.rlfi-field { flex: 1 1 100%; min-width: 0; }

.rlfi-field[hidden] { display: none; }

.rlfi-label {
	display: block;
	font-size: 14px;
	font-weight: 600;
	color: var(--rlfi-ink);
	margin-bottom: 7px;
}

.rlfi-req { color: var(--rlfi-accent-dk); margin-left: 2px; }

.rlfi-input {
	display: block;
	width: 100%;
	padding: 13px 14px;
	font-size: 16px; /* 16px keeps iOS from zooming on focus */
	font-family: inherit;
	color: var(--rlfi-ink);
	background: #fff;
	border: 1.5px solid var(--rlfi-line);
	border-radius: 8px;
	transition: border-color .15s ease, box-shadow .15s ease;
	-webkit-appearance: none;
	appearance: none;
}

.rlfi-input::placeholder { color: #9AA6B6; }

.rlfi-input:focus {
	outline: none;
	border-color: var(--rlfi-accent);
	box-shadow: 0 0 0 3px rgba(184, 134, 43, .18);
}

.rlfi-input:focus-visible { outline: 2px solid transparent; }

.rlfi-textarea { resize: vertical; min-height: 118px; line-height: 1.5; }

.rlfi-select-wrap { position: relative; }

.rlfi-select-wrap::after {
	content: "";
	position: absolute;
	right: 16px;
	top: 50%;
	width: 8px;
	height: 8px;
	margin-top: -6px;
	border-right: 2px solid var(--rlfi-ink-soft);
	border-bottom: 2px solid var(--rlfi-ink-soft);
	transform: rotate(45deg);
	pointer-events: none;
}

.rlfi-select { padding-right: 40px; background-image: none; }

.rlfi-help {
	margin: 6px 0 0;
	font-size: 12.5px;
	color: var(--rlfi-ink-soft);
}

.rlfi-note {
	margin: 0;
	padding: 12px 14px;
	background: var(--rlfi-panel);
	border-left: 3px solid var(--rlfi-accent);
	border-radius: 6px;
	font-size: 13.5px;
	color: var(--rlfi-ink-soft);
}

.rlfi-counter {
	margin: 6px 0 0;
	text-align: right;
	font-size: 12px;
	color: var(--rlfi-ink-soft);
	font-variant-numeric: tabular-nums;
}

.rlfi-counter.is-near { color: var(--rlfi-accent-dk); font-weight: 600; }

/* ---------- Choices ---------- */

.rlfi-options { display: grid; gap: 10px; }

.rlfi-options.is-inline { grid-template-columns: 1fr 1fr; }

.rlfi-option { position: relative; display: block; cursor: pointer; }

.rlfi-option input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
}

.rlfi-option-box {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 15px 16px;
	border: 1.5px solid var(--rlfi-line);
	border-radius: 8px;
	font-size: 15px;
	font-weight: 600;
	background: #fff;
	transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}

.rlfi-option-box::before {
	content: "";
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
	border: 1.5px solid #B9C2CE;
	border-radius: 50%;
	transition: border-color .15s ease, box-shadow .15s ease;
}

.rlfi-option input[type="checkbox"] + .rlfi-option-box::before { border-radius: 5px; }

.rlfi-option input:checked + .rlfi-option-box {
	border-color: var(--rlfi-accent);
	background: rgba(184, 134, 43, .07);
}

.rlfi-option input:checked + .rlfi-option-box::before {
	border-color: var(--rlfi-accent);
	box-shadow: inset 0 0 0 4px var(--rlfi-accent);
}

.rlfi-option input:focus-visible + .rlfi-option-box {
	box-shadow: 0 0 0 3px rgba(184, 134, 43, .28);
}

/* ---------- Consent ---------- */

.rlfi-consent {
	display: flex;
	gap: 12px;
	align-items: flex-start;
	padding: 16px;
	background: var(--rlfi-panel);
	border: 1px solid var(--rlfi-line);
	border-radius: 8px;
	cursor: pointer;
}

.rlfi-consent input {
	flex: 0 0 auto;
	width: 20px;
	height: 20px;
	margin: 1px 0 0;
	accent-color: var(--rlfi-accent);
}

.rlfi-consent-text { font-size: 13.5px; color: var(--rlfi-ink-soft); line-height: 1.55; }

.rlfi-consent-links { display: block; margin-top: 6px; font-size: 12.5px; }

.rlfi-consent-links a { color: var(--rlfi-ink); text-decoration: underline; }

/* ---------- Buttons ---------- */

.rlfi-nav {
	display: flex;
	gap: 10px;
	align-items: center;
	margin-top: 22px;
}

.rlfi-btn {
	font-family: inherit;
	font-size: 16px;
	font-weight: 700;
	border-radius: 8px;
	border: 1.5px solid transparent;
	padding: 15px 24px;
	cursor: pointer;
	transition: transform .12s ease, background .15s ease, box-shadow .15s ease;
	text-decoration: none;
	display: inline-block;
	text-align: center;
}

.rlfi-btn:active { transform: translateY(1px); }

.rlfi-btn:focus-visible {
	outline: 3px solid rgba(184, 134, 43, .45);
	outline-offset: 2px;
}

.rlfi-btn-primary,
.rlfi-btn-submit {
	flex: 1 1 auto;
	background: var(--rlfi-accent);
	color: #fff;
	box-shadow: 0 2px 0 var(--rlfi-accent-dk);
}

.rlfi-btn-primary:hover,
.rlfi-btn-submit:hover { background: var(--rlfi-accent-dk); }

.rlfi-btn-submit {
	letter-spacing: .04em;
	text-transform: uppercase;
	font-size: 16px;
	padding: 17px 24px;
}

.rlfi-btn-ghost {
	flex: 0 0 auto;
	background: #fff;
	color: var(--rlfi-ink-soft);
	border-color: var(--rlfi-line);
}

.rlfi-btn-ghost:hover { color: var(--rlfi-ink); border-color: var(--rlfi-ink-soft); }

.rlfi-btn[disabled] { opacity: .65; cursor: not-allowed; }

/* ---------- Errors ---------- */

.rlfi-error {
	margin: 7px 0 0;
	font-size: 13px;
	font-weight: 600;
	color: var(--rlfi-error);
}

.rlfi-error[hidden] { display: none; }

.rlfi-field.has-error .rlfi-input,
.rlfi-field.has-error .rlfi-option-box,
.rlfi-field.has-error .rlfi-consent {
	border-color: var(--rlfi-error);
}

.rlfi-alert {
	margin: 14px 0 0;
	padding: 13px 15px;
	border-radius: 8px;
	background: #FDECEA;
	border: 1px solid #F3C7C2;
	color: #8C1D18;
	font-size: 14px;
	font-weight: 600;
}

.rlfi-alert[hidden] { display: none; }

/* ---------- Trust bar ---------- */

.rlfi-trust {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 6px 18px;
	list-style: none;
	margin: 20px 0 0;
	padding: 16px 0 0;
	border-top: 1px solid var(--rlfi-line);
	font-size: 12.5px;
	color: var(--rlfi-ink-soft);
}

.rlfi-trust li { display: flex; align-items: center; gap: 6px; }

.rlfi-trust li::before {
	content: "";
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--rlfi-success);
}

/* ---------- Honeypot ---------- */

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

/* ---------- Thank you ---------- */

.rlfi-thankyou { padding: 30px 24px 32px; text-align: center; }

.rlfi-thankyou:focus { outline: none; }

.rlfi-check { margin-bottom: 14px; }

.rlfi-check-ring { stroke: var(--rlfi-success); opacity: .35; }

.rlfi-check-mark {
	stroke: var(--rlfi-success);
	stroke-dasharray: 44;
	stroke-dashoffset: 44;
	animation: rlfi-draw .5s .12s cubic-bezier(.65, 0, .45, 1) forwards;
}

@keyframes rlfi-draw { to { stroke-dashoffset: 0; } }

.rlfi-ty-heading {
	margin: 0 0 12px;
	font-family: Georgia, "Iowan Old Style", "Times New Roman", serif;
	font-size: 26px;
	font-weight: 600;
	color: var(--rlfi-ink);
}

.rlfi-ty-text {
	margin: 0 auto 12px;
	max-width: 46ch;
	font-size: 15px;
	color: var(--rlfi-ink-soft);
}

.rlfi-ty-call { margin-top: 6px; }

.rlfi-autoresponse {
	margin-top: 26px;
	padding-top: 22px;
	border-top: 1px solid var(--rlfi-line);
	text-align: left;
}

.rlfi-auto-intro {
	margin: 0 0 10px;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: normal;
	text-transform: none;
	color: var(--rlfi-ink-soft);
}

.rlfi-auto-card {
	background: var(--rlfi-panel);
	border: 1px solid var(--rlfi-line);
	border-radius: 8px;
	padding: 18px 20px;
}

.rlfi-auto-subject {
	margin: 0 0 14px;
	padding-bottom: 12px;
	border-bottom: 1px solid var(--rlfi-line);
	font-size: 15px;
	font-weight: 700;
	color: var(--rlfi-ink);
}

.rlfi-auto-tag {
	display: inline-block;
	margin-right: 8px;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: var(--rlfi-ink-soft);
	vertical-align: middle;
}

.rlfi-auto-body p {
	margin: 0 0 12px;
	font-size: 14.5px;
	color: var(--rlfi-ink);
	line-height: 1.6;
}

.rlfi-auto-body p:last-child { margin-bottom: 0; }


/* --------------------------------------------------------------------------
   Override guard. A theme rule like `.entry-content h2 { color: navy }` beats
   a single class, which is how the header text ended up dark-on-dark. These
   repeat the colors that matter at a specificity the theme will not outrank.
   -------------------------------------------------------------------------- */

.rlfi-wrap .rlfi-card .rlfi-head .rlfi-headline { color: #ffffff; }
.rlfi-wrap .rlfi-card .rlfi-head .rlfi-brand { color: var(--rlfi-accent); }
.rlfi-wrap .rlfi-card .rlfi-head .rlfi-subhead { color: #A8B8CC; }
.rlfi-wrap .rlfi-card .rlfi-step .rlfi-step-heading { color: var(--rlfi-ink); }
.rlfi-wrap .rlfi-card .rlfi-step .rlfi-step-num { color: var(--rlfi-accent-dk); }
.rlfi-wrap .rlfi-card .rlfi-label { color: var(--rlfi-ink); }
.rlfi-wrap .rlfi-card button.rlfi-btn-primary,
.rlfi-wrap .rlfi-card button.rlfi-btn-submit {
	background: var(--rlfi-accent);
	color: #ffffff;
	border-color: transparent;
}
.rlfi-wrap .rlfi-card button.rlfi-btn-primary:hover,
.rlfi-wrap .rlfi-card button.rlfi-btn-submit:hover { background: var(--rlfi-accent-dk); color: #ffffff; }
.rlfi-wrap .rlfi-card button.rlfi-btn-ghost { background: #ffffff; color: var(--rlfi-ink-soft); }
.rlfi-wrap .rlfi-card .rlfi-input { background: #ffffff; color: var(--rlfi-ink); }
.rlfi-wrap .rlfi-card .rlfi-thankyou .rlfi-ty-heading { color: var(--rlfi-ink); }

/* The thank-you call button is an <a>, so a theme link rule beats the button
   class. State every link state explicitly. */
.rlfi-wrap .rlfi-card a.rlfi-btn,
.rlfi-wrap .rlfi-card a.rlfi-btn:link,
.rlfi-wrap .rlfi-card a.rlfi-btn:visited,
.rlfi-wrap .rlfi-card a.rlfi-btn:active {
	color: #ffffff;
	background: var(--rlfi-accent);
	text-decoration: none;
	border-color: transparent;
	text-shadow: none;
}

.rlfi-wrap .rlfi-card a.rlfi-btn:hover,
.rlfi-wrap .rlfi-card a.rlfi-btn:focus {
	color: #ffffff;
	background: var(--rlfi-accent-dk);
	text-decoration: none;
}

.rlfi-wrap .rlfi-card a.rlfi-btn * { color: inherit; }

/* ---------- Responsive ---------- */


@media (min-width: 560px) {
	.rlfi-w-half { flex: 1 1 calc(50% - 8px); }
	.rlfi-headline { font-size: 29px; }
	.rlfi-head { padding: 32px 32px 26px; }
	.rlfi-form { padding: 8px 32px 30px; }
	.rlfi-progress { padding: 20px 32px 4px; }
	.rlfi-thankyou { padding: 40px 32px; }
}

@media (max-width: 559px) {
	.rlfi-pill-label { display: none; }
	.rlfi-progress-steps { justify-content: center; gap: 8px; }
	.rlfi-progress-pill { flex: 0 0 auto; }
	.rlfi-nav { flex-wrap: wrap; }
	.rlfi-btn-ghost { flex: 1 1 100%; order: 2; }
	.rlfi-btn-primary, .rlfi-btn-submit { order: 1; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
	.rlfi-wrap *,
	.rlfi-wrap *::before,
	.rlfi-wrap *::after {
		animation-duration: .001ms !important;
		transition-duration: .001ms !important;
	}
}
