/* ld.css — loanDepot HELOC flow (ld-v1) */

/* ── Design tokens ─────────────────────────────────────────────────── */
:root {
	--ld-accent:       #7A3FF6;
	--ld-accent-dark:  #5f2fd0;
	--ld-accent-track: rgba(122,63,246,.25);
	--ld-ground:       #FBFBFC;
	--ld-surface:      #FFFFFF;
	--ld-body:         #2B2A35;
	--ld-muted:        #575560;
	--ld-border:       #C0BFCB;
	--ld-error:        #dc2626;
	--ld-success:      #16a34a;
	--ld-header-h:     64px;
	--ld-font-body:    'DM Sans', sans-serif;
	--ld-font-head:    'Poppins', sans-serif;
	--ld-radius:       12px;
}

/* ── Reset ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }

body {
	font-family: var(--ld-font-body);
	background: var(--ld-ground);
	color: var(--ld-body);
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

/* ── Header ────────────────────────────────────────────────────────── */
.ld-header {
	background: rgba(255,255,255,0.25);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	box-shadow: rgba(0,0,0,0.2) 0px 4px 8px 4px;
	height: var(--ld-header-h);
	position: sticky;
	top: 0;
	z-index: 100;
}
.ld-header-inner {
	height: 100%;
	display: flex;
	align-items: center;
	padding: 0 32px;
}
.ld-header-inner a { display: flex; align-items: center; }
.ld-header-inner img { display: block; max-height: 40px; width: auto; }
@media (max-width: 480px) {
	.ld-header-inner { padding: 0 16px; }
}

/* ── Main / layout ─────────────────────────────────────────────────── */
/* Bottom padding reserves room for the fixed action bar so it never
   covers the tail of a step's content. */
.ld-main {
	flex: 1;
	display: flex;
	justify-content: center;
	align-items: flex-start;
	padding: 48px 24px 96px;
}
@media (max-width: 480px) {
	.ld-main { padding: 32px 16px 88px; }
}

/* ── Step container ────────────────────────────────────────────────── */
.ld-step { display: none; width: 100%; max-width: 640px; }
.ld-step.active { display: block; }

/* ── Card (flattened — the reference design has no panel, it's a flat page) ── */
.ld-card {
	background: transparent;
	border-radius: 0;
	box-shadow: none;
	padding: 0;
}

/* ── Path header (breadcrumb label) ────────────────────────────────── */
.ld-path-header {
	font-family: var(--ld-font-head);
	font-size: 24px;
	font-weight: 500;
	line-height: 32px;
	color: var(--ld-accent);
	text-align: center;
	margin-bottom: 24px;
}

/* ── Progress bar ──────────────────────────────────────────────────── */
.ld-progress-wrap {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 20px;
}
.ld-progress-bar {
	flex: 1;
	height: 8px;
	background: var(--ld-accent-track);
	border-radius: 22px;
	overflow: hidden;
}
.ld-progress-fill {
	height: 100%;
	background: var(--ld-accent);
	border-radius: 22px;
	transition: width .4s cubic-bezier(0,0,.2,1);
}
.ld-step-label {
	font-size: 14px;
	color: var(--ld-muted);
	white-space: nowrap;
}

/* ── Typography ────────────────────────────────────────────────────── */
.ld-headline {
	font-family: var(--ld-font-head);
	font-size: 32px;
	font-weight: 500;
	line-height: 48px;
	color: var(--ld-body);
	text-align: center;
	margin-bottom: 8px;
}
.ld-sub {
	font-family: var(--ld-font-body);
	font-size: 18px;
	line-height: 24px;
	font-weight: 400;
	color: var(--ld-muted);
	text-align: center;
	margin-bottom: 48px;
}
@media (max-width: 480px) {
	.ld-headline { font-size: 24px; line-height: 36px; }
}

/* ── Detected-location readout (post-ZIP-lookup confirmation) ───────── */
.ld-location-ro {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	font-size: .8rem;
	color: var(--ld-muted);
	margin: -32px 0 24px;
}
.ld-location-ro svg { color: var(--ld-accent); flex-shrink: 0; }

/* ── Step 1 — goal illustration ─────────────────────────────────────── */
.ld-goal-illustration {
	display: block;
	width: 160px;
	height: auto;
	margin: 0 auto 24px;
}

/* ── Option buttons (icon + label, full-width) ──────────────────────── */
.ld-options {
	display: flex;
	flex-direction: column;
	gap: 12px;
}
.ld-option-btn {
	display: flex;
	align-items: center;
	gap: 16px;
	width: 100%;
	padding: 16px;
	background: #fff;
	border: 1px solid var(--ld-border);
	border-radius: 16px;
	box-shadow: none;
	cursor: pointer;
	text-align: left;
	font-family: var(--ld-font-body);
	font-size: 16px;
	font-weight: 400;
	color: var(--ld-body);
	transition: border-color .15s, box-shadow .15s;
}
.ld-option-btn .material-symbols-outlined {
	font-size: 1.5rem;
	color: var(--ld-accent);
	flex-shrink: 0;
}
.ld-option-btn:hover,
.ld-option-btn.selected {
	border-color: var(--ld-accent);
	box-shadow: rgba(122,63,246,.2) 0px 4px 8px 0px;
}

/* ── Card-grid buttons (2-col, no icon or icon-optional) ────────────── */
.ld-cards-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}
.ld-card-btn {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 20px;
	background: #fff;
	border: 1px solid var(--ld-border);
	border-radius: 16px;
	box-shadow: none;
	cursor: pointer;
	text-align: center;
	font-family: var(--ld-font-body);
	color: var(--ld-body);
	transition: border-color .15s, box-shadow .15s;
}
.ld-card-btn .material-symbols-outlined {
	font-size: 1.8rem;
	color: var(--ld-accent);
}
.ld-card-label {
	font-size: .95rem;
	font-weight: 600;
}
.ld-card-label u { text-decoration: none; }
.ld-card-sub {
	font-size: .8rem;
	color: var(--ld-muted);
}
.ld-card-btn:hover,
.ld-card-btn.selected {
	border-color: var(--ld-accent);
	box-shadow: rgba(122,63,246,.2) 0px 4px 8px 0px;
}

/* ── ZIP input ─────────────────────────────────────────────────────── */
.ld-zip-wrap { margin-bottom: 8px; }
.ld-zip-input {
	width: 100%;
	padding: 14px 18px;
	font-size: 1.25rem;
	font-family: var(--ld-font-body);
	border: 1.5px solid var(--ld-border);
	border-radius: var(--ld-radius);
	outline: none;
	color: var(--ld-body);
	letter-spacing: .1em;
	transition: border-color .15s;
}
.ld-zip-input:focus { border-color: var(--ld-accent); }

/* ── Slider field ──────────────────────────────────────────────────── */
.ld-slider-field { margin-bottom: 8px; }
.ld-currency-input {
	width: 100%;
	padding: 14px 18px;
	font-size: 1.35rem;
	font-family: var(--ld-font-head);
	font-weight: 600;
	color: var(--ld-accent);
	border: 1.5px solid var(--ld-border);
	border-radius: var(--ld-radius);
	outline: none;
	margin-bottom: 16px;
	text-align: center;
	transition: border-color .15s;
}
.ld-currency-input:focus { border-color: var(--ld-accent); }

.ld-range {
	-webkit-appearance: none;
	width: 100%;
	height: 6px;
	background: linear-gradient(
		to right,
		var(--ld-accent) 0%,
		var(--ld-accent) var(--ld-range-pct, 20%),
		var(--ld-border) var(--ld-range-pct, 20%),
		var(--ld-border) 100%
	);
	border-radius: 99px;
	outline: none;
	cursor: pointer;
	margin-bottom: 6px;
}
.ld-range::-webkit-slider-thumb {
	-webkit-appearance: none;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: var(--ld-accent);
	border: 3px solid #fff;
	box-shadow: 0 0 0 1.5px var(--ld-accent), 0 2px 4px rgba(43,42,53,.15);
	cursor: pointer;
	transition: transform .1s;
}
.ld-range::-webkit-slider-thumb:active { transform: scale(1.15); }
.ld-range::-moz-range-thumb {
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: var(--ld-accent);
	border: 3px solid #fff;
	box-shadow: 0 0 0 1.5px var(--ld-accent);
	cursor: pointer;
}

.ld-slider-labels {
	display: flex;
	justify-content: space-between;
	font-size: .75rem;
	color: var(--ld-muted);
	margin-top: 2px;
}

/* ── Contact fields ────────────────────────────────────────────────── */
.ld-contact-fields { display: flex; flex-direction: column; gap: 12px; }
.ld-name-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}
.ld-field-wrap { display: flex; flex-direction: column; }
.ld-input {
	width: 100%;
	padding: 13px 16px;
	font-size: .95rem;
	font-family: var(--ld-font-body);
	border: 1.5px solid var(--ld-border);
	border-radius: var(--ld-radius);
	outline: none;
	color: var(--ld-body);
	transition: border-color .15s;
}
.ld-input:focus { border-color: var(--ld-accent); }
.ld-input.error { border-color: var(--ld-error); }
.ld-input--readonly { background: #f9f9fb; color: var(--ld-muted); cursor: default; }

/* ── Consent block ─────────────────────────────────────────────────── */
.ld-consent {
	font-size: .72rem;
	line-height: 1.55;
	color: var(--ld-muted);
	display: block;
}
.ld-consent a { color: var(--ld-accent); text-decoration: underline; }

/* ── Action bar — fixed full-width bar, visible immediately on every
   step with actions (no scrolling needed), faint top hairline only ── */
.ld-action-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin: 0;
	padding: 16px 32px;
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	width: 100%;
	background: #fff;
	border-top: 1px solid rgba(0,0,0,.08);
	box-shadow: none;
	z-index: 100;
}
@media (max-width: 480px) {
	.ld-action-bar { padding: 16px; }
}
/* Buttons stay side-by-side at every viewport — never stack on mobile */
.ld-action-bar--submit { flex-direction: row; }

.ld-btn-back,
.ld-btn-next,
.ld-btn-submit {
	flex: 0 0 auto;
	width: auto;
	border-radius: 24px;
	padding: 12px 24px;
	font-family: var(--ld-font-head);
	font-size: 1.25rem;
	font-weight: 700;
	cursor: pointer;
}

.ld-btn-back {
	background: #fff;
	border: 1px solid var(--ld-border);
	color: var(--ld-body);
	transition: border-color .15s, color .15s;
}
.ld-btn-back:hover { border-color: var(--ld-body); }

.ld-btn-next,
.ld-btn-submit {
	background: var(--ld-accent);
	border: none;
	color: #fff;
	transition: background .15s, opacity .15s;
}
.ld-btn-next:hover,
.ld-btn-submit:hover { background: var(--ld-accent-dark); }
.ld-btn-next:disabled,
.ld-btn-submit:disabled { opacity: .5; cursor: not-allowed; }

/* ── Error / warn text ─────────────────────────────────────────────── */
.ld-field-error {
	color: var(--ld-error);
	font-size: .8rem;
	margin-top: 6px;
}
.ld-field-warn {
	color: #d97706;
	font-size: .8rem;
	margin-top: 6px;
}
.ld-field-success {
	color: var(--ld-success);
	font-size: .8rem;
	margin-top: 6px;
	font-weight: 600;
}
.ld-submit-error {
	color: var(--ld-error);
	font-size: .85rem;
	text-align: center;
	margin-top: 4px;
}

/* ── DQ card ───────────────────────────────────────────────────────── */
.ld-card--dq .ld-headline { font-size: 1.2rem; }

/* ── Thank-you card ────────────────────────────────────────────────── */
.ld-card--ty { text-align: center; padding-top: 40px; padding-bottom: 40px; }
.ld-ty-check {
	width: 60px;
	height: 60px;
	border-radius: 50%;
	background: #f0fdf4;
	color: var(--ld-success);
	font-size: 1.8rem;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0 auto 20px;
}
.ld-ty-logo { display: block; margin: 24px auto 0; }

/* ── Footer ────────────────────────────────────────────────────────── */
.ld-footer {
	background: #fff;
	border-top: 1px solid var(--ld-border);
	padding: 12px 32px;
}
.ld-footer-inner {
	max-width: 860px;
	margin: 0 auto;
	display: flex;
	flex-wrap: wrap;
	gap: 10px 24px;
	align-items: center;
	font-size: .75rem;
	color: var(--ld-muted);
}
.ld-footer-legal { flex: 1; min-width: 200px; line-height: 1.5; font-size: 13px; }
.ld-footer-legal a { color: var(--ld-accent); text-decoration: none; }
.ld-footer-links {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 16px;
	align-items: center;
}
.ld-footer-links a,
.ld-cookie-btn {
	color: var(--ld-muted);
	text-decoration: none;
	font-size: 12px;
	font-family: var(--ld-font-body);
	background: none;
	border: none;
	cursor: pointer;
	padding: 0;
}
.ld-footer-links a:hover,
.ld-cookie-btn:hover { color: var(--ld-accent); text-decoration: underline; }
.ld-footer-seals {
	display: flex;
	align-items: center;
	gap: 12px;
}
.ld-seal { display: inline-block; width: 40px; height: 40px; }

@media (max-width: 480px) {
	.ld-footer { padding: 16px; }
	.ld-footer-inner { flex-direction: column; text-align: center; }
	.ld-footer-legal { text-align: center; }
}

/* ── reCAPTCHA badge clearance ─────────────────────────────────────── */
.grecaptcha-badge {
	bottom: 70px !important;
}
@media (max-width: 480px) {
	.grecaptcha-badge { bottom: 80px !important; }
}

/* ── Honeypot ──────────────────────────────────────────────────────── */
.bhm-pref-fields {
	display: none !important;
	visibility: hidden !important;
	position: absolute;
	left: -9999px;
}

/* ── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 480px) {
	.ld-name-row { grid-template-columns: 1fr; }
}
