/*
 * BrokerBoost Agent Portal.
 *
 * Everything sits under .bbap so nothing leaks into the theme, and the theme's
 * own typeface carries through (font-family is inherited, never set): the
 * portal should feel like part of her site, not a bolted-on admin screen.
 *
 * Mobile first. She will use this on a phone, often standing outside a house.
 * Every tap target is at least 48px tall, and inputs are never smaller than
 * 16px, below which iOS Safari zooms the page on focus and does not zoom back.
 *
 * Colours are custom properties on .bbap so a theme can brand the portal with
 * a single rule, e.g. `.bbap { --bbap-accent: var(--yst-pine); }`.
 */

.bbap {
	--bbap-ink: #1d1d1f;
	--bbap-muted: #5c5f66;
	--bbap-line: #d8d8de;
	--bbap-bg: #ffffff;
	--bbap-soft: #f5f5f7;
	--bbap-accent: #1d1d1f;
	--bbap-accent-ink: #ffffff;
	--bbap-danger: #b3261e;
	--bbap-ok-bg: #e8f4ec;
	--bbap-ok-ink: #1d5a33;
	--bbap-err-bg: #fbeaea;
	--bbap-err-ink: #8c1d18;
	--bbap-radius: 10px;

	box-sizing: border-box;
	width: 100%;
	max-width: 46rem;
	margin: 0 auto;
	padding: 2rem 1rem 4rem;
	color: var(--bbap-ink);
	font-size: 1rem;
	line-height: 1.5;
	text-align: left;
}

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

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

.bbap p { margin: 0 0 1rem; }

.bbap :focus-visible { outline: 3px solid var(--bbap-accent); outline-offset: 2px; }

/* ------------------------------------------------------------ type */

.bbap-title {
	margin: 0 0 .5rem;
	color: inherit;
	font-size: clamp(1.5rem, 5vw, 2rem);
	line-height: 1.2;
}

.bbap-subtitle {
	margin: 2rem 0 .75rem;
	color: inherit;
	font-size: 1.15rem;
	line-height: 1.3;
}

.bbap-lede { margin: 0 0 1.5rem; color: var(--bbap-muted); }

.bbap-note {
	margin: 0 0 1.25rem;
	padding: .75rem 1rem;
	border-radius: var(--bbap-radius);
	background: var(--bbap-soft);
	color: var(--bbap-muted);
	font-size: .925rem;
}

.bbap-empty {
	margin: 0 0 1.5rem;
	padding: 1.5rem 1rem;
	border-radius: var(--bbap-radius);
	background: var(--bbap-soft);
	color: var(--bbap-muted);
	text-align: center;
}

/* --------------------------------------------------------- notices */

.bbap-notice {
	margin: 0 0 1.25rem;
	padding: .875rem 1rem;
	border-left: 4px solid var(--bbap-muted);
	border-radius: var(--bbap-radius);
	background: var(--bbap-soft);
}

.bbap-notice p:last-child { margin-bottom: 0; }

.bbap-notice--ok { border-left-color: currentColor; background: var(--bbap-ok-bg); color: var(--bbap-ok-ink); }
.bbap-notice--error { border-left-color: currentColor; background: var(--bbap-err-bg); color: var(--bbap-err-ink); }

/* ------------------------------------------------- bar, tabs, head */

.bbap-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0 1rem;
	margin: 0 0 .5rem;
	color: var(--bbap-muted);
	font-size: .9rem;
}

.bbap-bar p { margin: 0; overflow-wrap: anywhere; }

.bbap-bar a {
	display: inline-flex;
	align-items: center;
	min-height: 3rem;
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.bbap-tabs {
	display: flex;
	gap: .25rem;
	margin: 0 0 1.5rem;
	padding: 0;
	border-bottom: 1px solid var(--bbap-line);
	list-style: none;
}

.bbap-tabs li { margin: 0; padding: 0; }

.bbap-tab {
	display: inline-flex;
	align-items: center;
	min-height: 3rem;
	margin-bottom: -1px;
	padding: 0 1rem;
	border-bottom: 3px solid transparent;
	color: var(--bbap-muted);
	font-weight: 600;
	text-decoration: none;
}

.bbap-tab:hover { color: var(--bbap-ink); }

.bbap-tab[aria-current="page"] { border-bottom-color: var(--bbap-accent); color: var(--bbap-ink); }

.bbap-head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: .75rem;
	margin: 0 0 1rem;
}

.bbap-head .bbap-title { margin: 0; }

/* --------------------------------------------------------- buttons */

.bbap-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: .4rem;
	min-height: 3rem;
	margin: 0;
	padding: .625rem 1.25rem;
	border: 1px solid var(--bbap-accent);
	border-radius: var(--bbap-radius);
	background: var(--bbap-accent);
	color: var(--bbap-accent-ink);
	font: inherit;
	font-weight: 600;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}

.bbap-btn:hover,
.bbap-btn:focus-visible { filter: brightness(1.2); color: var(--bbap-accent-ink); }

.bbap-btn:disabled { opacity: .6; cursor: progress; }

.bbap-btn--ghost { border-color: var(--bbap-line); background: transparent; color: var(--bbap-ink); }

.bbap-btn--ghost:hover,
.bbap-btn--ghost:focus-visible { filter: none; background: var(--bbap-soft); color: var(--bbap-ink); }

.bbap-btn--danger { border-color: var(--bbap-danger); background: var(--bbap-danger); color: #ffffff; }

.bbap-btn--danger:hover,
.bbap-btn--danger:focus-visible { color: #ffffff; }

.bbap-btn--small { min-height: 2.75rem; padding: .5rem .875rem; font-size: .925rem; }

.bbap-btn--block { width: 100%; }

.bbap-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.5rem; }

/* ---------------------------------------------------- listing rows */

.bbap-list {
	display: grid;
	gap: .75rem;
	margin: 0 0 1.5rem;
	padding: 0;
	list-style: none;
}

.bbap-item {
	display: grid;
	grid-template-columns: 5.5rem 1fr;
	gap: .875rem;
	margin: 0;
	padding: .75rem;
	border: 1px solid var(--bbap-line);
	border-radius: var(--bbap-radius);
	background: var(--bbap-bg);
}

.bbap-item__thumb {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 5.5rem;
	aspect-ratio: 1;
	overflow: hidden;
	border-radius: calc(var(--bbap-radius) - 4px);
	background: var(--bbap-soft);
	color: var(--bbap-muted);
	font-size: .75rem;
	text-align: center;
}

.bbap-item__thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }

.bbap-item__body { min-width: 0; }

.bbap-item__addr { margin: 0; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }

.bbap-item__meta { margin: .15rem 0 .4rem; color: var(--bbap-muted); font-size: .925rem; }

.bbap-item__price { color: var(--bbap-ink); font-weight: 600; }

.bbap-item__actions { display: flex; flex-wrap: wrap; grid-column: 1 / -1; gap: .5rem; }

.bbap-item__actions form { display: contents; }

@media (min-width: 34rem) {
	.bbap-item { grid-template-columns: 7rem 1fr; }
	.bbap-item__thumb { width: 7rem; }
	.bbap-item__actions { grid-column: 2; }
}

.bbap-badge {
	display: inline-block;
	padding: .1rem .55rem;
	border-radius: 999px;
	background: var(--bbap-soft);
	color: var(--bbap-ink);
	font-size: .8rem;
	font-weight: 600;
	vertical-align: middle;
}

.bbap-badge--for_sale { background: #e6f0fb; color: #174a7c; }
.bbap-badge--coming_soon { background: #f1eafb; color: #5a2d82; }
.bbap-badge--sale_pending { background: #fdf3e1; color: #7a4b00; }
.bbap-badge--closed { background: #ececef; color: #3a3a40; }

/* ----------------------------------------------------------- forms */

.bbap-form { margin: 0; }

.bbap-field { margin: 0 0 1.125rem; }

.bbap-label { display: block; margin: 0 0 .375rem; font-weight: 600; }

.bbap-optional { color: var(--bbap-muted); font-weight: 400; }

.bbap-input {
	display: block;
	width: 100%;
	min-height: 3rem;
	margin: 0;
	padding: .625rem .75rem;
	border: 1px solid var(--bbap-line);
	border-radius: calc(var(--bbap-radius) - 2px);
	background: #ffffff;
	box-shadow: none;
	color: var(--bbap-ink);
	font: inherit;
	font-size: max(16px, 1rem);
	line-height: 1.4;
}

textarea.bbap-input { min-height: 9rem; resize: vertical; }

.bbap-input[aria-invalid="true"] { border-color: var(--bbap-danger); }

.bbap-hint { margin: .375rem 0 0; color: var(--bbap-muted); font-size: .875rem; }

.bbap-error { margin: .375rem 0 0; color: var(--bbap-err-ink); font-size: .9rem; font-weight: 600; }

.bbap-grid { display: grid; grid-template-columns: 1fr; gap: 0 .75rem; }

/* Short fields sit side by side even on a phone: two or three numbers in a
   row are easier to scan than a tall column of them. */
.bbap-grid--2 { grid-template-columns: 1fr 1fr; }
.bbap-grid--3 { grid-template-columns: 1fr 1fr 1fr; }

.bbap-fieldset {
	margin: 0 0 1.25rem;
	padding: .75rem 1rem 1rem;
	border: 1px solid var(--bbap-line);
	border-radius: var(--bbap-radius);
}

.bbap-fieldset legend { padding: 0 .375rem; font-weight: 600; }

.bbap-choice {
	display: flex;
	align-items: center;
	gap: .75rem;
	min-height: 3rem;
	margin: 0;
	padding: .25rem 0;
	font-weight: 400;
	cursor: pointer;
}

.bbap-choice input { flex: none; width: 1.375rem; height: 1.375rem; margin: 0; accent-color: var(--bbap-accent); }

/* ---------------------------------------------------------- photos */

.bbap-file {
	display: block;
	width: 100%;
	min-height: 3rem;
	padding: .625rem;
	border: 1px dashed var(--bbap-line);
	border-radius: calc(var(--bbap-radius) - 2px);
	background: var(--bbap-soft);
	font: inherit;
	font-size: max(16px, 1rem);
}

.bbap-photos {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr));
	gap: .625rem;
	margin: .625rem 0 0;
}

.bbap-photos:empty { display: none; }

.bbap-photo {
	position: relative;
	aspect-ratio: 4 / 3;
	margin: 0;
	overflow: hidden;
	border-radius: calc(var(--bbap-radius) - 4px);
	background: var(--bbap-soft);
}

.bbap-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }

.bbap-photo--main { max-width: 16rem; margin-bottom: .625rem; }

.bbap-photo__remove {
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	display: flex;
	align-items: center;
	gap: .5rem;
	min-height: 2.75rem;
	margin: 0;
	padding: .25rem .5rem;
	background: rgba(0, 0, 0, .64);
	color: #ffffff;
	font-size: .875rem;
	cursor: pointer;
}

.bbap-photo__remove input { width: 1.25rem; height: 1.25rem; margin: 0; }

.bbap-photo__bad { margin: 0; padding: .5rem; color: var(--bbap-err-ink); font-size: .8rem; overflow-wrap: anywhere; }

/* --------------------------------------------------------- reviews */

.bbap-quote {
	margin: 0;
	padding: 1rem;
	border: 1px solid var(--bbap-line);
	border-radius: var(--bbap-radius);
	background: var(--bbap-bg);
}

.bbap-quote__name { margin: 0; font-weight: 700; }

.bbap-quote__via { color: var(--bbap-muted); font-size: .875rem; font-weight: 400; }

.bbap-quote__text { margin: .5rem 0 .75rem; white-space: pre-line; overflow-wrap: anywhere; }

.bbap-quote form { display: contents; }

/* ---------------------------------------------------------- footer */

.bbap-foot {
	margin-top: 3rem;
	padding-top: 1.25rem;
	border-top: 1px solid var(--bbap-line);
	color: var(--bbap-muted);
	font-size: .9rem;
}

.bbap-signin { max-width: 28rem; }
