/* NLS Property Hub — enquiry form, WhatsApp buttons, mobile contact bar.
   Colours come from the plugin tokens (a theme's brand overrides flow through);
   the footer group inherits its surroundings via currentColor. */

.nlsph-contact {
	margin-block-start: 1.5rem;
	padding: 1.25rem;
	border: 1px solid var(--nlsph-line, #d9e0e7);
	border-radius: var(--nlsph-radius-lg, 6px);
	background: var(--nlsph-surface, #fff);
	color: var(--nlsph-text, #1b304b);
}
.nlsph-contact__title { margin: 0 0 .375rem; }
.nlsph-contact__intro { margin: 0 0 .875rem; font-size: .9375rem; color: var(--nlsph-text-muted, #56657a); }

/* WhatsApp buttons: restrained outline, brand-coloured glyph. */
.nlsph-wa { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1.125rem; }
.nlsph-wa-btn {
	display: inline-flex; align-items: center; gap: .5rem;
	min-height: 44px; padding: .5rem .875rem;
	border: 1px solid currentColor; border-radius: var(--nlsph-radius, 4px);
	color: var(--nlsph-brand, #1b304b); background: transparent;
	font-weight: 600; font-size: .9375rem; line-height: 1.2; text-decoration: none;
	transition: background-color .15s ease, color .15s ease;
}
.nlsph-wa-icon { inline-size: 1.125rem; block-size: 1.125rem; flex: 0 0 auto; fill: var(--nlsph-badge-bg, #bfa264); }
.nlsph-wa-btn:hover { background: var(--nlsph-brand, #1b304b); color: var(--nlsph-brand-ink, #fff); text-decoration: none; }
.nlsph-wa-btn:focus-visible,
.nlsph-contact-bar a:focus-visible { outline: 2px solid var(--nlsph-focus, #8a6d3b); outline-offset: 2px; }

/* Form. */
.nlsph-contact__form { margin: 0; }
.nlsph-contact__field { margin: 0 0 .75rem; }
.nlsph-contact__field label { display: block; margin-block-end: .25rem; font-size: .875rem; font-weight: 600; }
/* Control boundaries need 3:1 (WCAG 2.2 SC 1.4.11) — the field background is the
   same white as the page, so this border is the only thing that makes the input
   visible. --nlsph-line is deliberately NOT used: it is the decorative rule colour
   (#d9e0e7 = 1.33:1 here) and is correct for panel edges, which 1.4.11 exempts.
   The default below measures 3.82:1 on white and 3.39:1 on the tinted surface. */
.nlsph-contact__field input,
.nlsph-contact__field textarea {
	box-sizing: border-box; inline-size: 100%; min-height: 44px; padding: .5rem .75rem;
	border: 1px solid var(--nlsph-control-border, #73849a); border-radius: var(--nlsph-radius-sm, 3px);
	background: #fff; color: var(--nlsph-text, #1b304b); font: inherit; font-size: 1rem;
}
.nlsph-contact__field textarea { resize: vertical; line-height: 1.45; }
.nlsph-contact__field input:focus,
.nlsph-contact__field textarea:focus { outline: 2px solid var(--nlsph-focus, #8a6d3b); outline-offset: 1px; border-color: var(--nlsph-focus, #8a6d3b); }
.nlsph-contact [aria-invalid="true"] { border-color: #a33a2b; outline-color: #a33a2b; }
.nlsph-contact__consent { display: flex; align-items: flex-start; gap: .5rem; margin: .25rem 0 1rem; font-size: .875rem; line-height: 1.45; }
.nlsph-contact__consent input { flex: 0 0 auto; inline-size: 1.125rem; block-size: 1.125rem; margin: .125rem 0 0; accent-color: var(--nlsph-brand, #1b304b); }
.nlsph-contact__consent a { color: var(--nlsph-accent, #8a6d3b); text-decoration: underline; text-underline-offset: .2em; }
.nlsph-contact__submit {
	inline-size: 100%; min-height: 48px; padding: .625rem 1rem; border: 0; border-radius: var(--nlsph-radius, 4px);
	background: var(--nlsph-brand, #1b304b); color: var(--nlsph-brand-ink, #fff);
	font: inherit; font-weight: 600; font-size: 1rem; cursor: pointer; transition: background-color .15s ease;
}
.nlsph-contact__submit:hover { background: var(--nlsph-brand-hover, #0f1f33); }
.nlsph-contact__submit:focus-visible { outline: 2px solid var(--nlsph-focus, #8a6d3b); outline-offset: 2px; }
.nlsph-contact__submit:disabled { opacity: .6; cursor: default; }
.nlsph-contact__hp { position: absolute !important; inset-inline-start: -10000px; inline-size: 1px; block-size: 1px; overflow: hidden; }
.nlsph-contact__status { margin: .75rem 0 0; font-size: .9375rem; }
.nlsph-contact__status:empty { display: none; }
.nlsph-contact__status:focus { outline: none; }
.nlsph-contact__status[data-state="error"] { color: #a33a2b; }
.nlsph-contact__status[data-state="success"] { margin-top: 0; padding: .875rem 1rem; border-inline-start: 3px solid var(--nlsph-badge-bg, #bfa264); background: var(--nlsph-surface-2, #eef2f5); color: var(--nlsph-text, #1b304b); font-weight: 600; }

/* Footer / shortcode group. */
.nlsph-wa-group__label { margin: 0 0 .5rem; font-size: .875rem; opacity: .85; }
.nlsph-wa-group .nlsph-wa { margin: 0; }
.nlsph-wa-group .nlsph-wa-btn { color: inherit; border-color: color-mix(in srgb, currentColor 45%, transparent); }
.nlsph-wa-group .nlsph-wa-btn:hover { background: color-mix(in srgb, currentColor 12%, transparent); color: inherit; }

/* Mobile sticky contact bar. */
.nlsph-contact-bar { display: none; }
@media (max-width: 781px) {
	.nlsph-contact-bar {
		position: fixed; inset-inline: 0; inset-block-end: 0; z-index: 9990;
		display: flex; align-items: center; gap: .5rem;
		padding: .625rem .75rem calc(.625rem + env(safe-area-inset-bottom, 0px));
		background: var(--nlsph-brand, #1b304b); box-shadow: 0 -6px 20px rgba(15, 31, 51, .18);
		transition: transform .2s ease, visibility .2s ease;
	}
	.nlsph-contact-bar.is-hidden { transform: translateY(110%); visibility: hidden; }
	.nlsph-contact-bar a { display: inline-flex; align-items: center; justify-content: center; gap: .375rem; min-height: 44px; border-radius: var(--nlsph-radius, 4px); font-weight: 600; font-size: .9375rem; text-decoration: none; }
	/* The label must stay on ONE line in every language.
	 *
	 * English "Send enquiry" fits at any width, so the bar looked finished; the
	 * Russian "Отправить запрос" and Estonian "Saada päring" are longer and
	 * wrapped to two lines inside a 166px box at 400px wide, because the two
	 * WhatsApp buttons were `flex: 0 0 auto` and took their space first.
	 *
	 * The WhatsApp buttons may now shrink (they carry an icon plus a short
	 * name), the enquire button may not, and its text never wraps. A layout
	 * tested only in the default language is not tested. */
	.nlsph-contact-bar__enquire {
		flex: 1 1 auto;
		padding: 0 .875rem;
		background: var(--nlsph-badge-bg, #bfa264);
		color: var(--nlsph-badge-ink, #0f1f33);
		white-space: nowrap;
	}
	.nlsph-contact-bar__wa {
		flex: 0 1 auto;
		min-inline-size: 0;
		padding: 0 .75rem;
		border: 1px solid rgba(255, 255, 255, .45);
		color: #fff;
	}
	/* A long name truncates rather than pushing the enquire label into a wrap. */
	.nlsph-contact-bar__wa > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-inline-size: 0; }
	.nlsph-contact-bar__wa .nlsph-wa-icon { flex: 0 0 auto; }
	.nlsph-contact-bar__wa .nlsph-wa-icon { fill: var(--nlsph-badge-bg, #bfa264); }
	body.nlsph-has-contact-bar { padding-block-end: calc(68px + env(safe-area-inset-bottom, 0px)); }
}
@media (prefers-reduced-motion: reduce) {
	.nlsph-contact-bar, .nlsph-wa-btn, .nlsph-contact__submit { transition: none; }
}
