/**
 * MLS Genie — Public subscribe panel.
 *
 * Loaded on the public site. Deliberately self-contained and scoped tightly to
 * .mlsg-sub-pop, because this renders inside whatever theme the client runs.
 *
 * @since 2.0.45
 */

.mlsg-sub-pop {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 99999;
}

.mlsg-sub-pop.is-open {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.mlsg-sub-pop__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(17, 24, 39, 0.55);
}

.mlsg-sub-pop__panel {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 14px;
	width: 100%;
	max-width: 520px;
	padding: 26px 24px 22px;
	background: var(--mlsg-white, #fff);
	border-radius: 14px;
	box-shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
	/* The theme's own typeface, not ours. This panel opens on top of the
	   client's site, and a different font is the thing that makes it read as
	   a bolted-on plugin rather than part of the page. */
	font-family: inherit;
}

.mlsg-sub-pop__close {
	position: absolute;
	top: 10px;
	right: 12px;
	border: 0;
	background: none;
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
	color: var(--mlsg-text-subtle, #606773);
}

.mlsg-sub-pop__close:hover {
	color: var(--mlsg-text, #111827);
}

.mlsg-sub-pop__title {
	margin: 0;
	padding-right: 24px;
	font-size: 1.1875rem;
	font-weight: 700;
	line-height: 1.3;
	color: var(--mlsg-text, #111827);
}

.mlsg-sub-pop__desc {
	margin: 0;
	font-size: 0.9375rem;
	line-height: 1.55;
	color: var(--mlsg-text-medium, #374151);
}

.mlsg-sub-pop__field {
	display: flex;
	flex-direction: column;
	gap: 5px;
}

.mlsg-sub-pop__label {
	font-size: 0.8125rem;
	font-weight: 600;
	color: var(--mlsg-text-medium, #374151);
}

/* Two-up on the name row; stacks on narrow screens. */
.mlsg-sub-pop__row {
	display: flex;
	gap: 12px;
}

.mlsg-sub-pop__row .mlsg-sub-pop__field {
	flex: 1;
	min-width: 0;
}

.mlsg-sub-pop__email,
.mlsg-sub-pop__first,
.mlsg-sub-pop__last {
	width: 100%;
	padding: 11px 13px;
	border: 1px solid var(--mlsg-border, #dcdfe4);
	border-radius: 8px;
	font-size: 1rem;
	font-family: inherit;
	color: var(--mlsg-text, #111827);
	background: var(--mlsg-white, #fff);
	box-sizing: border-box;
}

.mlsg-sub-pop__email:focus,
.mlsg-sub-pop__first:focus,
.mlsg-sub-pop__last:focus {
	outline: 2px solid var(--mlsg-teal, #0d76b4);
	outline-offset: 1px;
	border-color: var(--mlsg-teal, #0d76b4);
}

.mlsg-sub-pop__submit {
	padding: 12px 16px;
	border: 0;
	border-radius: 8px;
	background: var(--mlsg-teal, #0d76b4);
	color: #fff;
	font-size: 1rem;
	font-weight: 600;
	font-family: inherit;
	cursor: pointer;
}

.mlsg-sub-pop__submit:hover:not(:disabled) {
	filter: brightness(0.94);
}

.mlsg-sub-pop__submit:disabled {
	opacity: 0.6;
	cursor: default;
}

/* Status sits on its own row below the button, never beside it. */
.mlsg-sub-pop__status {
	display: block;
	margin: 0;
	min-height: 1.2em;
	font-size: 0.875rem;
	line-height: 1.45;
	color: var(--mlsg-text-medium, #374151);
}

.mlsg-sub-pop__status.is-error {
	color: var(--mlsg-danger, #d31f1f);
}

/* ── Trigger button (shortcode default) ───────────────────────────────── */

.mlsg-sub-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 9px;
	padding: 12px 18px;
	border: 0;
	border-radius: 8px;
	background: var(--mlsg-teal, #0d76b4);
	color: #fff;
	font-size: 0.9375rem;
	font-weight: 600;
	font-family: inherit;
	line-height: 1.3;
	cursor: pointer;
	text-decoration: none;
	transition: filter .15s ease;
}

.mlsg-sub-btn i {
	font-size: 1em;
	opacity: .85;
}

.mlsg-sub-btn:hover,
.mlsg-sub-btn:focus {
	filter: brightness(0.94);
	color: #fff;
}

/* Outline variant. A sidebar often already has a solid primary button in it
   (Contact Us, Schedule a Tour), and a second solid button of equal weight
   competes with the one the agent actually wants clicked. */
.mlsg-sub-btn--outline {
	background: transparent;
	border: 1.5px solid var(--mlsg-teal, #0d76b4);
	color: var(--mlsg-teal, #0d76b4);
}

.mlsg-sub-btn--outline:hover,
.mlsg-sub-btn--outline:focus {
	background: var(--mlsg-teal, #0d76b4);
	color: #fff;
	filter: none;
}

/* Plain text variant, for placing under a description without adding
   another block of colour to the page. */
.mlsg-sub-btn--link {
	background: transparent;
	padding: 4px 0;
	color: var(--mlsg-teal, #0d76b4);
	text-decoration: underline;
	font-weight: 500;
}

.mlsg-sub-btn--link:hover,
.mlsg-sub-btn--link:focus {
	background: transparent;
	color: var(--mlsg-teal, #0d76b4);
	text-decoration: none;
	filter: none;
}

/* In a sidebar the button should fill the column — a short button floating
   in a wide card is the thing that reads as unfinished. */
.mlsg-subscribe-widget__buttons .mlsg-sub-btn {
	width: 100%;
}

@media screen and (max-width: 420px) {
	.mlsg-sub-pop__row {
		flex-direction: column;
	}
}

/* Automatic placement on property pages (v2.0.91). Flex + gap so the buttons
   sit side by side and wrap on narrow screens rather than stacking flush. */
.mlsg-sub-listing-buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 20px 0;
}

/* Widget can now render more than one button (a property offers both price
   drops and open houses), so the wrapper owns the spacing. */
.mlsg-subscribe-widget__buttons {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

/* Consent disclosure under the signup button. Small, but deliberately not
   invisible — it is the record of what the person agreed to. */
.mlsg-sub-pop__consent {
	margin: 0;
	font-size: 0.75rem;
	line-height: 1.5;
	color: var(--mlsg-text-muted, #6b7280);
}

.mlsg-sub-pop__consent:empty {
	display: none;
}

.mlsg-sub-pop__consent a {
	color: inherit;
	text-decoration: underline;
}

/* Already subscribed. Muted rather than removed — a button that vanishes
   leaves the visitor unsure whether the click worked. */
.mlsg-sub-btn--done,
.mlsg-sub-btn--done:hover {
	background: transparent;
	border: 1.5px solid var(--mlsg-border, #d1d5db);
	color: var(--mlsg-text-muted, #6b7280);
	cursor: default;
	filter: none;
}

.mlsg-sub-btn--done i {
	color: var(--mlsg-success, #15803d);
	opacity: 1;
}
