/*
 * Breezy Offer Form
 * Uses the active theme's presets when available, with Breezy fallbacks,
 * so the form still looks right if the theme changes.
 */

.bof {
	--bof-navy: var(--wp--preset--color--navy, #022e5e);
	--bof-blue: var(--wp--preset--color--blue, #05538f);
	--bof-gold: var(--wp--preset--color--gold, #fcbd4d);
	--bof-ivory: var(--wp--preset--color--ivory, #f7f5f0);
	--bof-mist: var(--wp--preset--color--mist, #e7eaed);
	--bof-slate: var(--wp--preset--color--slate, #4a5763);
	--bof-text: var(--wp--preset--color--charcoal, #303942);
	--bof-error: #b32d2e;
	--bof-radius: var(--wp--custom--radius, 0.5rem);
	--bof-serif: var(--wp--preset--font-family--serif, Georgia, serif);

	max-width: 46rem;
	margin-inline: auto;
	padding: clamp(1rem, 3.5vw, 2rem);
	background: #fff;
	border: 1px solid var(--bof-mist);
	border-radius: var(--bof-radius);
	color: var(--bof-text);
	font-size: max(1.125rem, 1em);
	line-height: 1.6;
}

.bof [hidden] {
	display: none !important;
}

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

.bof-sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

.bof-hp {
	position: absolute !important;
	left: -10000px;
	top: auto;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.bof :where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: 3px solid var(--bof-navy);
	outline-offset: 3px;
}

.bof-intro {
	margin: 0 0 1.25rem;
}

.bof-intro p {
	margin: 0;
}

.bof-intro__small {
	margin-top: 0.25rem !important;
	font-size: 1rem;
	color: var(--bof-slate);
}

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

.bof-stepper {
	list-style: none;
	margin: 0 0 1.25rem;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 0.5rem;
	counter-reset: none;
}

.bof-stepper li {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.35rem;
	text-align: center;
	font-size: 0.95rem;
	line-height: 1.3;
	color: var(--bof-slate);
	position: relative;
}

.bof-stepper li::after {
	content: "";
	position: absolute;
	top: 1.1rem;
	left: calc(50% + 1.4rem);
	right: calc(-50% + 1.4rem);
	height: 2px;
	background: var(--bof-mist);
}

.bof-stepper li:last-child::after {
	display: none;
}

.bof-stepper__num {
	width: 2.25rem;
	height: 2.25rem;
	border-radius: 50%;
	display: grid;
	place-items: center;
	border: 2px solid var(--bof-mist);
	background: #fff;
	font-weight: 700;
}

.bof-stepper li.is-current {
	color: var(--bof-navy);
	font-weight: 600;
}

.bof-stepper li.is-current .bof-stepper__num {
	background: var(--bof-navy);
	border-color: var(--bof-navy);
	color: #fff;
}

.bof-stepper li.is-done .bof-stepper__num {
	border-color: var(--bof-blue);
	color: var(--bof-blue);
}

.bof-stepper li.is-done::after {
	background: var(--bof-blue);
}

@media (max-width: 599px) {
	.bof-stepper__label {
		position: absolute !important;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0 0 0 0);
	}
}

/* ---------- Steps ---------- */

.bof-step {
	border: 0;
	margin: 0 0 1.25rem;
	padding: 0;
	min-width: 0;
}

.bof-step__legend {
	padding: 0;
	margin-bottom: 1rem;
}

.bof-step__title {
	margin: 0;
	font-family: var(--bof-serif);
	font-size: clamp(1.5rem, 4vw, 1.875rem);
	line-height: 1.25;
	color: var(--bof-navy);
}

.bof-step__title:focus,
.bof-update__title:focus,
.bof-update__property:focus {
	outline: none;
}

.bof-step__title:focus-visible,
.bof-update__title:focus-visible {
	outline: 3px solid var(--bof-navy);
}

.bof-step__hint {
	margin: 0 0 1.25rem;
	color: var(--bof-slate);
}

/* ---------- Fields ---------- */

.bof-field {
	margin: 0 0 1.15rem;
	padding: 0;
	border: 0;
	min-width: 0;
}

.bof-label {
	display: block;
	margin-bottom: 0.35rem;
	padding: 0;
	font-weight: 600;
	color: var(--bof-navy);
	line-height: 1.4;
}

.bof-optional {
	font-weight: 400;
	color: var(--bof-slate);
}

.bof-hint {
	margin: -0.15rem 0 0.5rem;
	color: var(--bof-slate);
	font-size: 1rem;
}

.bof-error {
	margin: 0 0 0.5rem;
	color: var(--bof-error);
	font-weight: 600;
	display: flex;
	gap: 0.4rem;
}

.bof-error::before {
	content: "!";
	flex: 0 0 1.4rem;
	height: 1.4rem;
	margin-top: 0.15rem;
	border-radius: 50%;
	background: var(--bof-error);
	color: #fff;
	display: grid;
	place-items: center;
	font-size: 0.9rem;
}

.bof input[type="text"],
.bof input[type="email"],
.bof input[type="tel"],
.bof select,
.bof textarea {
	display: block;
	width: 100%;
	min-height: 3rem;
	padding: 0.6rem 0.85rem;
	font: inherit;
	font-size: 1.125rem;
	color: var(--bof-text);
	background: #fff;
	border: 2px solid var(--bof-slate);
	border-radius: var(--bof-radius);
}

.bof textarea {
	min-height: 7rem;
	resize: vertical;
}

.bof .has-error input,
.bof .has-error select,
.bof .has-error textarea {
	border-color: var(--bof-error);
}

.bof-affix {
	display: flex;
	align-items: stretch;
	max-width: 20rem;
}

.bof-affix__text {
	display: grid;
	place-items: center;
	min-width: 2.75rem;
	padding: 0 0.6rem;
	background: var(--bof-ivory);
	border: 2px solid var(--bof-slate);
	border-right: 0;
	border-radius: var(--bof-radius) 0 0 var(--bof-radius);
	font-weight: 600;
}

.bof-affix input[type="text"] {
	border-radius: 0 var(--bof-radius) var(--bof-radius) 0;
}

.bof-affix--suffix {
	max-width: 12rem;
}

.bof-affix--suffix .bof-affix__text {
	border-right: 2px solid var(--bof-slate);
	border-left: 0;
	border-radius: 0 var(--bof-radius) var(--bof-radius) 0;
}

.bof-affix--suffix input[type="text"] {
	border-radius: var(--bof-radius) 0 0 var(--bof-radius);
}

.bof .has-error .bof-affix__text {
	border-color: var(--bof-error);
}

.bof-field--zip input,
.bof-field--state select {
	max-width: 20rem;
}

.bof-term {
	display: flex;
	gap: 0.75rem;
	max-width: 20rem;
}

.bof-term input[type="text"] {
	flex: 0 0 6rem;
}

.bof-term select {
	flex: 1 1 auto;
}

/* Radio choices: large, full-width tap targets. */
.bof-choices {
	display: grid;
	gap: 0.6rem;
}

.bof-choice {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	min-height: 3rem;
	padding: 0.6rem 0.9rem;
	border: 2px solid var(--bof-mist);
	border-radius: var(--bof-radius);
	background: #fff;
	cursor: pointer;
	line-height: 1.35;
}

.bof-choice:hover {
	border-color: var(--bof-blue);
}

.bof-choice:has(input:checked) {
	border-color: var(--bof-blue);
	background: #f0f6fb;
}

.bof-choice input {
	flex: 0 0 auto;
	width: 1.4rem;
	height: 1.4rem;
	margin: 0;
	accent-color: var(--bof-blue);
}

.bof-choice:has(input:focus-visible) {
	outline: 3px solid var(--bof-navy);
	outline-offset: 2px;
}

.bof-choice input:focus-visible {
	outline: none;
}

.bof-field--radio.has-error .bof-choice {
	border-color: #e3a7a8;
}

.bof-field--radio[data-bof-radio="ever_30_days_late"] .bof-choices {
	grid-template-columns: repeat(2, minmax(0, 10rem));
}

/* Letter reference: secondary panel at the start of step 1. */
.bof-letter-panel {
	margin: 0 0 1.5rem;
	padding: 0.85rem 1rem 0.25rem;
	background: var(--bof-ivory);
	border-left: 4px solid var(--bof-mist);
	border-radius: 0 var(--bof-radius) var(--bof-radius) 0;
}

.bof-letter-panel__title {
	margin: 0;
	font-weight: 600;
	color: var(--bof-navy);
}

.bof-letter-panel__text {
	margin: 0.15rem 0 0.75rem;
	color: var(--bof-slate);
}

.bof-letter-panel .bof-field {
	margin-bottom: 0.75rem;
}

.bof-letter-panel .bof-label {
	font-weight: 600;
}

.bof-letter-panel input[type="text"] {
	max-width: 16rem;
}

.bof-letter-note {
	margin: 0.4rem 0 0;
}

/* Properties connected to the letter (Phase 2B). */
.bof-letter-results {
	margin: 1rem 0 0.25rem;
}

.bof-letter-results .bof-label {
	display: block;
	margin: 0 0 0.15rem;
}

.bof-letter-results .bof-hint {
	margin: 0 0 0.6rem;
}

/* The short update form for notes Breezy already quoted (BOF_Update). */
.bof-update__title {
	margin: 0 0 0.35rem;
}

.bof-update__intro {
	margin: 0 0 1.25rem;
	color: var(--bof-slate);
}

.bof-update__property {
	margin: 0 0 1.5rem;
	padding: 0.85rem 1rem;
	background: var(--bof-ivory);
	border-left: 4px solid var(--bof-mist);
	border-radius: 0 var(--bof-radius) var(--bof-radius) 0;
}

.bof-update__property .bof-label {
	margin: 0 0 0.15rem;
	font-weight: 600;
}

.bof-update__address {
	margin: 0 0 0.5rem;
	font-weight: 600;
	color: var(--bof-navy);
	overflow-wrap: anywhere;
}

.bof-update__switch {
	padding: 0;
	border: 0;
	background: none;
	color: var(--bof-blue);
	font: inherit;
	text-decoration: underline;
	cursor: pointer;
}

.bof-update__subhead {
	margin: 1.75rem 0 0.25rem;
}

.bof-update__reach-hint {
	margin: 0 0 0.5rem;
}

.bof-letter-results select {
	width: 100%;
	max-width: 32rem;
}

/* Promissory note upload (Phase 2C): a secondary panel at the end of step 3, like the letter panel. */
.bof-upload-panel {
	margin: 0.5rem 0 1.5rem;
	padding: 0.85rem 1rem 0.5rem;
	background: var(--bof-ivory);
	border-left: 4px solid var(--bof-mist);
	border-radius: 0 var(--bof-radius) var(--bof-radius) 0;
}

.bof-upload-panel__title {
	margin: 0;
	font-weight: 600;
	color: var(--bof-navy);
}

.bof-upload-panel__text {
	margin: 0.15rem 0 0.75rem;
	color: var(--bof-slate);
}

.bof-upload-panel .bof-field {
	margin-bottom: 0.5rem;
}

.bof-upload-panel .bof-label {
	font-weight: 600;
}

.bof-field--files input[type="file"] {
	display: block;
	width: 100%;
	max-width: 100%;
	padding: 0.5rem 0;
	font: inherit;
}

.bof-files-note {
	margin: 0.25rem 0 0;
	color: var(--bof-slate);
}

.bof-files {
	margin: 0.5rem 0 0;
	padding: 0;
	list-style: none;
	display: grid;
	gap: 0.4rem;
}

.bof-files__item {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.25rem 0.75rem;
	padding: 0.5rem 0.75rem;
	background: #fff;
	border: 1px solid var(--bof-mist);
	border-radius: var(--bof-radius);
}

.bof-files__name {
	flex: 1 1 12rem;
	min-width: 0;
	overflow-wrap: anywhere;
}

.bof-files__size {
	color: var(--bof-slate);
	white-space: nowrap;
}

.bof-files__remove {
	min-height: 2.25rem;
	padding: 0.25rem 0.75rem;
	border: 1px solid var(--bof-mist);
	border-radius: var(--bof-radius);
	background: #fff;
	color: var(--bof-navy);
	font: inherit;
	cursor: pointer;
}

.bof-files__remove:hover,
.bof-files__remove:focus-visible {
	border-color: var(--bof-blue);
}


/* Side-by-side rows on wider screens; stacked on phones. */
.bof-row {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	column-gap: 1rem;
}

@media (min-width: 640px) {
	.bof-row--name,
	.bof-row--reach,
	.bof-row--sale {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.bof-row--location {
		grid-template-columns: minmax(0, 2fr) minmax(0, 1.4fr) minmax(0, 1fr);
	}

	/* Short dropdowns (property type) at half width, lined up with the two-column rows. */
	.bof-field--select {
		max-width: calc(50% - 0.5rem);
	}

	.bof-row .bof-affix,
	.bof-row .bof-field--zip input,
	.bof-row .bof-field--state select {
		max-width: none;
	}
}

/* Google address suggestions (optional). */
.bof-field--address {
	position: relative;
}

.bof-suggest {
	position: absolute;
	z-index: 20;
	left: 0;
	right: 0;
	margin-top: 0.25rem;
	background: #fff;
	border: 2px solid var(--bof-blue);
	border-radius: var(--bof-radius);
	box-shadow: 0 8px 24px rgba(2, 46, 94, 0.15);
	overflow: hidden;
}

.bof-suggest ul {
	list-style: none;
	margin: 0;
	padding: 0.25rem 0;
	max-height: 18rem;
	overflow-y: auto;
}

.bof-suggest__opt {
	min-height: 2.75rem;
	padding: 0.6rem 0.9rem;
	cursor: pointer;
	line-height: 1.35;
}

.bof-suggest__opt:hover,
.bof-suggest__opt.is-active {
	background: #f0f6fb;
	color: var(--bof-navy);
	box-shadow: inset 4px 0 0 var(--bof-blue);
}

/* Required attribution: "Google Maps", Roboto 400, #5E5E5E, 12-16px, no wrap. */
.bof-suggest__attr {
	margin: 0;
	padding: 0.35rem 0.9rem 0.45rem;
	border-top: 1px solid var(--bof-mist);
	text-align: right;
	font-family: Roboto, Arial, sans-serif;
	font-weight: 400;
	font-size: 14px;
	color: #5e5e5e;
	white-space: nowrap;
}

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

.bof-nav {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	justify-content: space-between;
	margin-top: 1.5rem;
}

.bof-nav [data-bof-next],
.bof-nav [data-bof-submit] {
	margin-left: auto;
}

.bof-btn {
	min-height: 3rem;
	padding: 0.75rem 1.5rem;
	font: inherit;
	font-size: 1.125rem;
	font-weight: 600;
	line-height: 1.2;
	border-radius: var(--bof-radius);
	border: 2px solid var(--bof-blue);
	cursor: pointer;
}

.bof-btn--primary {
	background: var(--bof-blue);
	color: #fff;
}

.bof-btn--primary:hover {
	background: var(--bof-navy);
	border-color: var(--bof-navy);
	text-decoration: underline;
}

.bof-btn--secondary {
	background: #fff;
	color: var(--bof-blue);
}

.bof-btn--secondary:hover {
	text-decoration: underline;
}

.bof-btn[disabled] {
	opacity: 0.7;
	cursor: progress;
}

@media (max-width: 479px) {
	.bof-nav {
		flex-direction: column-reverse;
	}

	.bof-btn {
		width: 100%;
	}
}

/* ---------- Alerts ---------- */

.bof-alert {
	margin: 0 0 1.5rem;
	padding: 1rem 1.25rem;
	border: 2px solid var(--bof-error);
	border-left-width: 6px;
	border-radius: var(--bof-radius);
	background: #fdf3f3;
}

.bof-alert:focus {
	outline: 3px solid var(--bof-navy);
	outline-offset: 2px;
}

.bof-alert p {
	margin: 0;
}

.bof-summary__title {
	margin: 0 0 0.5rem;
	font-family: inherit;
	font-size: 1.125rem;
	color: var(--bof-error);
}

.bof-summary ul {
	margin: 0;
	padding-left: 1.25rem;
}

.bof-summary a {
	color: var(--bof-error);
	font-weight: 600;
}

/* ---------- Review ---------- */

.bof-review__group {
	margin: 0 0 1.25rem;
	padding: 1rem 1.25rem;
	background: var(--bof-ivory);
	border-radius: var(--bof-radius);
}

.bof-review__head {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 1rem;
	margin-bottom: 0.5rem;
}

.bof-review__head h3 {
	margin: 0;
	font-family: var(--bof-serif);
	font-size: 1.25rem;
	color: var(--bof-navy);
}

.bof-review__edit {
	min-height: 2.75rem;
	padding: 0.4rem 1rem;
	font: inherit;
	font-size: 1rem;
	font-weight: 600;
	color: var(--bof-blue);
	background: #fff;
	border: 2px solid var(--bof-blue);
	border-radius: var(--bof-radius);
	cursor: pointer;
}

.bof-review dl {
	margin: 0;
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 0.15rem 1rem;
}

.bof-review dt {
	font-weight: 600;
	color: var(--bof-slate);
	font-size: 1rem;
	margin-top: 0.5rem;
}

.bof-review dd {
	margin: 0;
	overflow-wrap: anywhere;
	white-space: pre-line;
}

.bof-review dd.is-empty {
	color: var(--bof-slate);
	font-style: italic;
}

@media (min-width: 640px) {
	.bof-review dl {
		grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
	}

	.bof-review dt {
		margin-top: 0;
	}
}

.bof-privacy {
	margin: 1.5rem 0 0;
	padding: 1rem 1.25rem;
	border-left: 4px solid var(--bof-blue);
	background: var(--bof-ivory);
	font-size: 1rem;
	line-height: 1.55;
}

.bof-privacy p {
	margin: 0;
}

.bof-privacy__title {
	font-weight: 700;
	color: var(--bof-navy);
	margin-bottom: 0.25rem !important;
}

/* ---------- Confirmation ---------- */

.bof-confirm {
	border-top: 6px solid var(--bof-blue);
}

.bof-confirm:focus {
	outline: none;
}

.bof-confirm__title {
	margin-top: 0;
	font-family: var(--bof-serif);
	color: var(--bof-navy);
}

.bof-confirm__ref strong {
	display: inline-block;
	padding: 0.1rem 0.5rem;
	background: var(--bof-ivory);
	border: 1px solid var(--bof-mist);
	border-radius: 0.35rem;
	font-size: 1.25rem;
	letter-spacing: 0.04em;
	color: var(--bof-navy);
}

/* Hints placed under their input (e.g. "Enter $0 if there was no down payment."). */
.bof-affix + .bof-hint,
.bof-field > input + .bof-hint {
	margin: 0.4rem 0 0;
}

/* Example text inside a box (e.g. comments): readable grey, gone once typing starts. */
.bof textarea::placeholder,
.bof input::placeholder {
	color: var(--bof-slate);
	opacity: 1;
}

/* Never split a phone number across lines. */
.bof a[href^="tel:"] {
	white-space: nowrap;
}

@media (max-width: 599px) {
	.bof-confirm__number {
		display: table; /* Own line, sized to the reference. */
		margin: 0.4rem 0;
		font-size: 1.375rem;
	}

	.bof-confirm__dot {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.bof * {
		transition: none !important;
		animation: none !important;
		scroll-behavior: auto !important;
	}
}
