/*
 * 1003 Mortgage Application 3.0 — borrower form. Scoped to .mapp.
 * Controls use doubled-class selectors (.mapp.mapp) and set every state
 * explicitly so theme and page-builder styles (button:hover, kit input
 * rules, .entry-content lists and links) cannot restyle them.
 */
.mapp {
	--mapp-accent: #3d5ea0;
	--mapp-on-accent: #ffffff;
	--mapp-accent-text: #3d5ea0;
	--mapp-ink: #202124;
	--mapp-quiet: #5f6368;
	--mapp-line: #efefef;
	--mapp-field: #80868b;
	--mapp-soft: #dadce0;
	--mapp-error: #b3261e;
	--mapp-radius: 12px;
	font-family: inherit;
	color: var(--mapp-ink);
	max-width: 640px;
	margin: 24px auto;
	letter-spacing: normal;
	box-sizing: border-box;
	text-align: left;
}
.mapp *,
.mapp *::before,
.mapp *::after { box-sizing: inherit; }
.mapp.mapp :is(button, input, select, textarea) { font: inherit; letter-spacing: normal; text-transform: none; text-shadow: none; }
.mapp.mapp :is(h2, h3, p, ul, ol, li, dl, dt, dd, fieldset, legend, label) { letter-spacing: normal; text-transform: none; }
.mapp.mapp :is(ul, ol) { list-style: none; margin: 0; padding: 0; }
.mapp.mapp img { max-width: 100%; height: auto; }
.mapp__card {
	background: #fff;
	border: 1px solid var(--mapp-line);
	border-radius: var(--mapp-radius);
	padding: 36px 40px 28px;
	font-size: 16px;
	line-height: 1.5;
}
.mapp__loading { color: var(--mapp-quiet); margin: 0; }

/* Header: progress + step label + language */
.mapp__head { margin: -12px 0 32px; }
.mapp__progress { height: 4px; background: var(--mapp-line); border-radius: 4px; overflow: hidden; }
.mapp__progress span { display: block; height: 100%; background: var(--mapp-accent); }
.mapp__head-row { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; font-size: 13px; color: var(--mapp-quiet); }

/* Type */
.mapp.mapp .mapp__title { font-size: 26px; line-height: 1.25; font-weight: 600; margin: 0 0 10px; padding: 0; color: var(--mapp-ink); outline: none; }
.mapp.mapp .mapp__title-wrap { margin: 0 0 10px; padding: 0; font-size: inherit; }
.mapp.mapp .mapp__title--label { display: block; font-size: 26px; line-height: 1.25; font-weight: 600; margin: 0; }
.mapp.mapp .mapp__subtitle { font-size: 17px; line-height: 1.4; font-weight: 600; margin: 0 0 6px; padding: 0; color: var(--mapp-ink); }
.mapp.mapp .mapp__sub { color: var(--mapp-quiet); margin: 0 0 28px; font-size: 16px; }
.mapp.mapp .mapp__help { color: var(--mapp-quiet); font-size: 15px; margin: -4px 0 20px; }
.mapp.mapp .mapp__label { display: block; font-weight: 500; font-size: 15px; line-height: 1.4; margin: 0 0 8px; color: var(--mapp-ink); }
.mapp__optional { font-weight: 400; color: var(--mapp-quiet); }
.mapp.mapp .mapp__note { font-size: 13px; color: var(--mapp-quiet); margin: 16px 0 0; }
.mapp.mapp .mapp__legal { font-size: 12px; color: var(--mapp-quiet); margin: 24px 0 0; text-align: center; }

/* Fields */
.mapp__field { margin: 0 0 24px; }
.mapp__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.mapp__grid > .mapp__field--consent,
.mapp__grid > .mapp__field--repeat,
.mapp__grid > .mapp__field--address,
.mapp__grid > .mapp__field--choice,
.mapp__grid > .mapp__field--multi,
.mapp__grid > .mapp__field--yesno { grid-column: 1 / -1; }
.mapp.mapp input.mapp__input {
	display: block;
	width: 100%;
	max-width: none;
	height: auto;
	min-height: 52px;
	padding: 12px 16px;
	font-size: 16px;
	line-height: 1.4;
	color: var(--mapp-ink);
	background: #fff;
	border: 1px solid var(--mapp-field);
	border-radius: 10px;
	box-shadow: none;
	margin: 0;
	scroll-margin-bottom: 110px;
}
.mapp.mapp select.mapp__input {
	display: block;
	width: 100%;
	max-width: none;
	height: auto;
	min-height: 52px;
	padding: 12px 44px 12px 16px;
	font-size: 16px;
	line-height: 1.4;
	color: var(--mapp-ink);
	background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%235f6368' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 16px center;
	border: 1px solid var(--mapp-field);
	border-radius: 10px;
	box-shadow: none;
	margin: 0;
	-webkit-appearance: none;
	appearance: none;
	cursor: pointer;
}
.mapp.mapp select.mapp__input:focus { outline: 2px solid var(--mapp-accent); outline-offset: 0; border-color: var(--mapp-accent); }
.mapp.mapp input.mapp__input:focus { outline: 2px solid var(--mapp-accent); outline-offset: 0; border-color: var(--mapp-accent); box-shadow: none; background: #fff; }
/* Headings take focus on each step so screen readers announce them; they are not controls. */
.mapp.mapp [tabindex="-1"]:focus { outline: none; }
.mapp.mapp input.mapp__input::placeholder { color: var(--mapp-quiet); opacity: 1; }
/* SSN typed as text but shown masked (type=password would trigger password managers). */
.mapp.mapp input.mapp__input[data-masked="true"] { -webkit-text-security: disc; }
.mapp.mapp .mapp__field--error input.mapp__input { border-color: var(--mapp-error); }
.mapp.mapp .mapp__error { color: var(--mapp-error); font-size: 14px; margin: 6px 0 0; }
.mapp.mapp .mapp__alert { color: var(--mapp-error); background: #fdf3f2; border: 1px solid #f4d2cf; border-radius: 8px; padding: 10px 14px; margin: 0 0 16px; font-size: 14px; }
.mapp.mapp .mapp__alert p { margin: 0; }
.mapp.mapp .mapp__alert ul { list-style: disc; padding-left: 20px; margin: 6px 0 0; }
.mapp__affix { position: relative; display: flex; align-items: center; gap: 8px; }
.mapp__affix .mapp__input { flex: 1; }
.mapp__affix-pre { position: absolute; left: 16px; color: var(--mapp-quiet); pointer-events: none; z-index: 1; }
.mapp.mapp .mapp__affix-pre + input.mapp__input { padding-left: 30px; }
.mapp__affix-post { color: var(--mapp-quiet); min-width: 3.5em; font-size: 15px; }
.mapp__hp { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; opacity: 0; }
.mapp__onfile { display: flex; gap: 12px; align-items: center; min-height: 48px; }

/* Choices: big tap targets. Their text identifies them, so the edge can be
   lighter than a text field's; the chosen one gets the accent and a check. */
.mapp__choices { display: grid; gap: 12px; }
.mapp.mapp .mapp__title + .mapp__choices,
.mapp.mapp .mapp__title + .mapp__input,
.mapp.mapp .mapp__title + .mapp__affix { margin-top: 24px; }
.mapp__choices--row { grid-template-columns: 1fr 1fr; }
/* Size and spacing live on the element only, never on :hover/:focus, so a
   modifier (check, row) cannot be undone by hovering. (0,3,1) already beats
   theme button:hover rules. */
.mapp.mapp button.mapp__choice {
	display: block;
	transform: none;
	width: 100%;
	min-width: 0;
	height: auto;
	min-height: 56px;
	padding: 14px 48px 14px 18px;
	position: relative;
	text-align: left;
	font-size: 16px;
	font-weight: 400;
	line-height: 1.35;
	white-space: normal;
	color: var(--mapp-ink);
	background: #fff;
	border: 1px solid var(--mapp-soft);
	border-radius: 12px;
	box-shadow: none;
	cursor: pointer;
	margin: 0;
	scroll-margin-bottom: 110px;
}
.mapp.mapp .mapp__choices--row button.mapp__choice { text-align: center; padding-left: 40px; padding-right: 40px; }
.mapp.mapp button.mapp__choice:hover { border-color: var(--mapp-field); }
.mapp.mapp button.mapp__choice:focus-visible { outline: 2px solid var(--mapp-accent); outline-offset: 2px; }
.mapp.mapp button.mapp__choice.is-on { border: 2px solid var(--mapp-accent); padding: 13px 47px 13px 17px; background: #f5f7fb; font-weight: 600; }
.mapp.mapp .mapp__choices--row button.mapp__choice.is-on { padding-left: 39px; padding-right: 39px; }
/* Single choice: a filled check on the right. */
.mapp.mapp button.mapp__choice:not(.mapp__choice--check).is-on::before { content: ""; position: absolute; right: 16px; top: 50%; width: 20px; height: 20px; margin-top: -10px; border-radius: 50%; background: var(--mapp-accent); }
.mapp.mapp button.mapp__choice:not(.mapp__choice--check).is-on::after { content: ""; position: absolute; right: 23px; top: 50%; width: 5px; height: 10px; margin-top: -7px; border: solid var(--mapp-on-accent); border-width: 0 2px 2px 0; transform: rotate(45deg); }
@supports (background: color-mix(in srgb, red 10%, white)) {
	.mapp.mapp button.mapp__choice.is-on { background: color-mix(in srgb, var(--mapp-accent) 8%, #fff); }
}
.mapp.mapp .mapp__field--error .mapp__choices button.mapp__choice:not(.is-on) { border-color: var(--mapp-error); }
.mapp.mapp button.mapp__choice--check { padding-left: 44px; position: relative; }
.mapp.mapp button.mapp__choice--check::before { content: ""; position: absolute; left: 16px; top: 50%; width: 18px; height: 18px; margin-top: -9px; border: 1px solid var(--mapp-field); border-radius: 4px; background: #fff; }
.mapp.mapp button.mapp__choice--check.is-on { padding-left: 43px; }
.mapp.mapp button.mapp__choice--check.is-on::before { background: var(--mapp-accent); border-color: var(--mapp-accent); }
/* Checkmark, so "checked" is not shown by color alone. */
.mapp.mapp button.mapp__choice--check.is-on::after { content: ""; position: absolute; left: 22px; top: 50%; width: 5px; height: 10px; margin-top: -7px; border: solid var(--mapp-on-accent); border-width: 0 2px 2px 0; transform: rotate(45deg); }

/* Consent */
.mapp.mapp .mapp__consent { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; font-weight: 400; color: var(--mapp-quiet); line-height: 1.45; cursor: pointer; margin: 0; }
/* Drawn by hand: some themes hide or flatten native checkboxes. */
.mapp.mapp .mapp__consent input[type="checkbox"] {
	-webkit-appearance: none;
	appearance: none;
	position: relative;
	display: block;
	width: 22px;
	height: 22px;
	min-width: 22px;
	margin: 0;
	padding: 0;
	flex: 0 0 auto;
	background: #fff;
	border: 1.5px solid var(--mapp-field);
	border-radius: 6px;
	box-shadow: none;
	cursor: pointer;
	opacity: 1;
	visibility: visible;
	clip: auto;
}
.mapp.mapp .mapp__consent input[type="checkbox"]:hover { border-color: var(--mapp-ink); }
.mapp.mapp .mapp__consent input[type="checkbox"]:checked { background: var(--mapp-accent); border-color: var(--mapp-accent); }
.mapp.mapp .mapp__consent input[type="checkbox"]::before { content: none; }
.mapp.mapp .mapp__consent input[type="checkbox"]:checked::before { content: ""; position: absolute; left: 6.5px; top: 2.5px; width: 6px; height: 11px; border: solid var(--mapp-on-accent); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.mapp.mapp .mapp__consent input[type="checkbox"]:focus-visible { outline: 2px solid var(--mapp-accent); outline-offset: 2px; }
.mapp.mapp .mapp__consent span { padding-top: 1px; }
.mapp.mapp .mapp__field--error .mapp__consent { color: var(--mapp-error); }
.mapp.mapp .mapp__field--error .mapp__consent input[type="checkbox"]:not(:checked) { border-color: var(--mapp-error); }
/* Terms: a quiet panel that opens in place. */
.mapp.mapp .mapp__terms { font-size: 14px; color: var(--mapp-quiet); margin: -4px 0 24px; border: 1px solid var(--mapp-line); border-radius: 12px; background: #fff; }
.mapp.mapp .mapp__terms summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; list-style: none; padding: 14px 16px; min-height: 48px; color: var(--mapp-ink); font-weight: 500; }
.mapp.mapp .mapp__terms summary::-webkit-details-marker { display: none; }
.mapp.mapp .mapp__terms summary::after { content: ""; flex: 0 0 auto; width: 8px; height: 8px; margin-right: 4px; border: solid var(--mapp-quiet); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg) translateY(-2px); }
.mapp.mapp .mapp__terms[open] summary::after { transform: rotate(-135deg) translateY(-2px); }
.mapp.mapp .mapp__terms[open] summary { border-bottom: 1px solid var(--mapp-line); }
.mapp.mapp .mapp__terms summary:focus-visible { outline: 2px solid var(--mapp-accent); outline-offset: 2px; border-radius: 12px; }
.mapp.mapp .mapp__terms > div { max-height: 240px; overflow: auto; padding: 14px 16px; font-size: 13px; line-height: 1.55; }
.mapp.mapp .mapp__terms > div p { margin: 0 0 10px; }
.mapp.mapp .mapp__terms > div :last-child { margin-bottom: 0; }

/* Buttons */
.mapp__actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 32px; }
.mapp.mapp .mapp__btn,
.mapp.mapp a.mapp__btn,
.mapp.mapp a.mapp__btn:visited {
	display: inline-flex;
	transform: none;
	align-items: center;
	justify-content: center;
	width: auto;
	height: auto;
	min-height: 52px;
	padding: 0 28px;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.2;
	white-space: normal;
	color: var(--mapp-on-accent);
	background: var(--mapp-accent);
	border: 1px solid var(--mapp-accent);
	border-radius: 12px;
	box-shadow: none;
	cursor: pointer;
	text-decoration: none;
	margin: 0;
}
.mapp.mapp .mapp__btn:hover { filter: brightness(0.95); }
.mapp.mapp .mapp__btn:focus-visible { outline: 2px solid var(--mapp-accent); outline-offset: 2px; }
.mapp.mapp .mapp__btn[disabled] { opacity: 0.6; cursor: default; }
.mapp.mapp .mapp__btn--ghost,
.mapp.mapp a.mapp__btn--ghost,
.mapp.mapp .mapp__btn--ghost:hover,
.mapp.mapp .mapp__btn--ghost:focus,
.mapp.mapp a.mapp__btn--ghost:visited { color: var(--mapp-ink); background: #fff; border-color: var(--mapp-field); filter: none; }
.mapp.mapp .mapp__btn--ghost:hover { border-color: var(--mapp-accent); }
/* Back is secondary to Continue: text only. */
.mapp.mapp .mapp__btn--back,
.mapp.mapp .mapp__btn--back:hover,
.mapp.mapp .mapp__btn--back:focus { border-color: transparent; background: transparent; color: var(--mapp-quiet); font-weight: 500; padding: 0 16px; margin-left: -16px; }
.mapp.mapp .mapp__btn--back:hover { color: var(--mapp-ink); background: #f5f5f5; }
.mapp.mapp .mapp__btn--small { min-height: 36px; padding: 0 14px; font-size: 14px; }
.mapp.mapp .mapp__btn--add { width: 100%; }
.mapp.mapp button.mapp__link {
	background: none;
	border: 0;
	box-shadow: none;
	padding: 2px 0;
	min-height: 24px;
	color: var(--mapp-accent-text);
	cursor: pointer;
	font-size: 14px;
	font-weight: 400;
	text-decoration: underline;
	text-underline-offset: 2px;
	margin: 0;
	width: auto;
	height: auto;
}
.mapp.mapp button.mapp__link:focus-visible { outline: 2px solid var(--mapp-accent); outline-offset: 2px; }
.mapp.mapp button.mapp__link--danger { color: var(--mapp-error); }
.mapp.mapp .mapp__resume-link { text-align: center; margin: 16px 0 0; }

/* Numbers */
.mapp.mapp .mapp__numbers { margin: 0; padding: 0; border: 1px solid var(--mapp-line); border-radius: 12px; }
.mapp__numbers > div { display: flex; justify-content: space-between; gap: 16px; padding: 14px 20px; border-top: 1px solid var(--mapp-line); }
.mapp__numbers > div:first-child { border-top: 0; }
/* The first number is the one that matters: large, label above. */
.mapp__numbers > div:first-child { display: block; padding: 20px 20px 18px; }
.mapp.mapp .mapp__numbers > div:first-child dt { font-size: 14px; margin: 0 0 4px; }
.mapp.mapp .mapp__numbers > div:first-child dd { font-size: 34px; line-height: 1.15; text-align: left; }
.mapp.mapp .mapp__numbers dt { color: var(--mapp-quiet); margin: 0; font-weight: 400; }
.mapp.mapp .mapp__numbers dd { margin: 0; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.mapp.mapp .mapp__hints { margin: 16px 0 0; padding: 0; color: var(--mapp-ink); font-size: 15px; }
.mapp.mapp .mapp__hints li { margin: 0 0 8px; padding-left: 16px; position: relative; }
.mapp.mapp .mapp__hints li::before { content: ""; position: absolute; left: 2px; top: 0.6em; width: 6px; height: 6px; border-radius: 50%; background: var(--mapp-accent); }

/* Panels: checklist, full app offer */
.mapp__panel { border: 1px solid var(--mapp-line); border-radius: 12px; padding: 20px; margin: 24px 0 0; }
.mapp__doc { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--mapp-line); }
.mapp__doc:first-child { border-top: 0; }
.mapp__doc-name { font-size: 15px; }
.mapp__doc-state { grid-column: 1; grid-row: 2; font-size: 13px; color: var(--mapp-quiet); }
.mapp__doc.is-done .mapp__doc-state { color: #1e7d3a; }
.mapp.mapp .mapp__doc .mapp__btn { grid-column: 2; grid-row: 1 / span 2; }
.mapp__doc:focus-within .mapp__btn { outline: 2px solid var(--mapp-accent); outline-offset: 2px; }
.mapp__send { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; align-items: center; margin: 16px 0 0; padding: 16px 0 0; border-top: 1px solid var(--mapp-line); }
.mapp.mapp .mapp__send-text { margin: 0; font-weight: 600; color: var(--mapp-ink); }
.mapp.mapp .mapp__send .mapp__btn { grid-column: 2; grid-row: 1 / span 2; }
.mapp.mapp .mapp__send-note { grid-column: 1; margin: 0; font-size: 13px; }
.mapp.mapp .mapp__send-done { margin: 16px 0 0; padding: 14px 0 0; border-top: 1px solid var(--mapp-line); color: #1e7d3a; font-weight: 500; }
@media (max-width: 600px) {
	.mapp__send { grid-template-columns: 1fr; }
	.mapp.mapp .mapp__send .mapp__btn { grid-column: 1; grid-row: auto; width: 100%; margin-top: 8px; }
}
.mapp__file { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.mapp.mapp .mapp__doc-files { grid-column: 1 / -1; font-size: 13px; color: var(--mapp-quiet); }
.mapp.mapp .mapp__doc-files li { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 2px 0; }
.mapp.mapp .mapp__doc-files span { overflow-wrap: anywhere; }

/* Repeat groups */
.mapp.mapp .mapp__repeat-item { border: 1px solid var(--mapp-line); border-radius: 12px; padding: 20px; margin: 0 0 12px; }
.mapp.mapp .mapp__repeat-item legend { font-weight: 600; padding: 0 6px; font-size: 15px; }

/* Review */
.mapp__review { margin: 0 0 20px; }
.mapp__review-sec { border-top: 1px solid var(--mapp-line); padding: 12px 0; }
.mapp__review-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.mapp.mapp .mapp__review-list { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px; font-size: 14px; }
.mapp__review-list > div { display: contents; }
.mapp.mapp .mapp__review-list dt { color: var(--mapp-quiet); margin: 0; font-weight: 400; }
.mapp.mapp .mapp__review-list dd { margin: 0; overflow-wrap: anywhere; }

/* Loan officer card */
.mapp__lo { display: flex; align-items: center; gap: 12px; margin: 32px 0 0; padding: 20px 0 0; border-top: 1px solid var(--mapp-line); }
.mapp.mapp .mapp__lo-photo { width: 44px; height: 44px; max-width: none; border-radius: 50%; object-fit: cover; flex: 0 0 auto; }
.mapp__lo-text { display: flex; flex-direction: column; font-size: 14px; line-height: 1.35; flex: 1; min-width: 0; }
.mapp__lo-text span { color: var(--mapp-quiet); font-size: 13px; }
.mapp__lo-actions { display: flex; gap: 8px; }
.mapp.mapp a.mapp__lo-action,
.mapp.mapp a.mapp__lo-action:visited,
.mapp.mapp a.mapp__lo-action:hover { display: inline-flex; align-items: center; min-height: 36px; font-size: 14px; font-weight: 500; color: var(--mapp-accent-text); border: 1px solid var(--mapp-soft); border-radius: 999px; padding: 6px 14px; text-decoration: none; box-shadow: none; background: #fff; }
.mapp.mapp a.mapp__lo-action:hover { border-color: var(--mapp-field); }
.mapp.mapp a.mapp__lo-action:focus-visible { outline: 2px solid var(--mapp-accent); outline-offset: 2px; }

/* 2.6 edit-link overlay */
.mapp-overlay { position: fixed; inset: 0; background: rgba(32, 33, 36, 0.5); z-index: 99999; overflow: auto; padding: 24px 16px; }
.mapp-overlay__inner { position: relative; max-width: 680px; margin: 0 auto; }
.mapp-overlay__close { position: absolute; right: 12px; top: 8px; font-size: 28px; color: #5f6368; text-decoration: none; z-index: 1; }
.mapp-notice { padding: 16px; border: 1px solid #efefef; border-radius: 8px; }

@media (max-width: 600px) {
	.mapp { margin: 16px auto; }
	.mapp__card { padding: 24px 20px 20px; border-radius: 12px; }
	.mapp__grid { grid-template-columns: 1fr; }
	.mapp.mapp .mapp__title, .mapp.mapp .mapp__title--label { font-size: 22px; }
	.mapp__head { margin: -4px 0 24px; }
	.mapp.mapp .mapp__numbers > div:first-child dd { font-size: 30px; }
	.mapp__actions {
		position: sticky;
		bottom: 0;
		background: #fff;
		border-top: 1px solid var(--mapp-line);
		margin: 24px -20px 0;
		padding: 12px 20px calc(12px + env(safe-area-inset-bottom, 0px));
		z-index: 2;
	}
	.mapp.mapp .mapp__actions .mapp__btn[type="submit"] { flex: 1; }
	.mapp.mapp .mapp__review-list { grid-template-columns: 1fr; gap: 0; }
	.mapp.mapp .mapp__review-list dd { margin-bottom: 8px; }
	.mapp__lo { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: no-preference) {
	.mapp__progress span { transition: width 0.2s linear; }
}
