/* Northern Sky - Contact / Enquiry Form
   Structural / layout CSS only. Colors, typography, spacing and sizes are
   controlled per-instance from the Elementor Style tab (see the widget's
   "selectors" in class-contact-form-widget.php) - same convention as every
   other widget in this plugin.

   The phone country-code dropdown block below (.nsm-lead-phone-dial*) is
   intentionally duplicated from intro-cta.css rather than shared: this
   widget reuses NSM_Lead_Gate_Ajax::render_country_dropdown() directly for
   its markup (same classes, same data-nsm-phone-dial-* attributes), and
   contact-form.js duplicates intro-cta.js's initPhoneCountryDropdown()
   the same way - every other widget pair in this plugin is already fully
   self-contained (its own CSS + JS, no cross-widget asset dependency), so
   this keeps that convention instead of introducing the first one. */

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

.nsm-cf {
	position: relative;
	width: 100%;
	text-align: left;
}

.nsm-cf-heading,
.nsm-cf-subtitle {
	margin: 0;
}

.nsm-cf-subtitle {
	margin-top: 8px;
}

/* ---------------------------------------------------------
 * Error banner (client-side validation only - see showCfError() /
 * clearCfError() in contact-form.js)
 * ------------------------------------------------------- */

.nsm-cf-error {
	display: none;
	margin: 0 0 14px;
	color: #b3261e;
	font-size: 13px;
}

.nsm-cf-error.nsm-cf-error-visible {
	display: block;
}

/* ---------------------------------------------------------
 * Form layout
 * ------------------------------------------------------- */

.nsm-cf-form {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

/* Explicit, not left to the browser's own [hidden]{display:none} default -
   that UA rule and this file's own ".nsm-cf-form { display: flex; }" rule
   above are EQUAL specificity (0,1,0 each), and this file loads after the
   UA stylesheet, so without this override contact-form.js's own
   `form.hidden = true` on submit would silently lose that tie and the
   form would stay visibly displayed - confirmed live. Same fix already
   applied to .nsm-cf-success-state below and to every analogous state
   toggle in intro-cta.css (.nsm-lead-modal-otp-state[hidden] etc.). */
.nsm-cf-form[hidden] {
	display: none;
}

.nsm-cf-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
}

@media ( max-width: 600px ) {
	.nsm-cf-row {
		grid-template-columns: 1fr;
	}
}

.nsm-cf-field {
	min-width: 0;
}

.nsm-cf-field input,
.nsm-cf-field textarea {
	display: block;
	width: 100%;
	border-style: solid;
	border-width: 1px;
	font-family: inherit;
	resize: vertical;
}

.nsm-cf-field input:focus,
.nsm-cf-field textarea:focus {
	outline: none;
}

.nsm-cf-field-phone {
	display: flex;
	gap: 8px;
}

.nsm-cf-field-phone input {
	flex: 1 1 auto;
	min-width: 0;
}

/* Off-screen rather than display:none/[hidden] - a hidden-via-display
   field is itself a common bot-detection signal bots are coded to skip,
   while this still "exists" visually to anything not actually rendering
   CSS. Real visitors never tab into it (tabindex="-1") or see it. */
.nsm-cf-hp {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect( 0, 0, 0, 0 );
	white-space: nowrap;
}

/* ---------------------------------------------------------
 * Submit button
 * ------------------------------------------------------- */

.nsm-cf-submit {
	display: block;
	align-self: center;
	border-style: solid;
	border-width: 1px;
	font-family: inherit;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.nsm-cf-submit:disabled {
	cursor: default;
	opacity: 0.7;
}

/* Same bare-<button>-vs-theme-hover problem documented throughout
   intro-cta.css/project-details.css (the active theme pinks out
   background/border/color on button:hover/:focus/:active) - identical
   fix, folding the normal state and every interactive state into one
   rule so a plain, non-!important theme rule can never win regardless of
   cascade order. The actual colors stay on the Style-tab-driven base
   rule above (via {{WRAPPER}} selectors); this only neutralizes what the
   theme tries to repaint. */
.nsm-cf-submit,
.nsm-cf-submit:hover,
.nsm-cf-submit:focus,
.nsm-cf-submit:active {
	background-image: none !important;
	box-shadow: none !important;
	text-shadow: none !important;
}

/* ---------------------------------------------------------
 * Success state - contact-form.js toggles [hidden] on submit.
 * ------------------------------------------------------- */

.nsm-cf-success-state[hidden] {
	display: none;
}

/* Shown BELOW the form (not in place of it - contact-form.js no longer
   hides the form on submit), so it needs its own top spacing rather than
   relying on .nsm-cf-form's own bottom edge/gap. */
.nsm-cf-success-state {
	margin-top: 20px;
	padding-top: 20px;
	border-top: 1px solid rgba( 0, 0, 0, 0.1 );
}

.nsm-cf-success-text {
	margin: 8px 0 0;
}

/* ===========================================================
   Phone country-code dropdown - duplicated verbatim from intro-cta.css
   (see this file's top comment). Trigger button + hidden input carrying
   the posted value + a fixed-position option list; contact-form.js's own
   duplicated initPhoneCountryDropdown() drives the open/close/choose
   behavior these classes and data attributes assume.
   =========================================================== */

.nsm-lead-phone-dial {
	position: relative;
	flex: 0 0 auto;
	width: auto;
	max-width: 130px;
}

.nsm-lead-phone-dial-trigger {
	display: flex;
	align-items: center;
	gap: 6px;
	width: 100%;
	height: 100%;
	border-style: solid;
	border-width: 1px;
	border-color: #d8d2c4;
	background: transparent;
	padding: 12px 10px;
	font-family: inherit;
	font-size: inherit;
	color: inherit;
	cursor: pointer;
}

.nsm-lead-phone-dial-trigger:focus {
	outline: none;
}

.nsm-lead-phone-dial-trigger,
.nsm-lead-phone-dial-trigger:hover,
.nsm-lead-phone-dial-trigger:focus,
.nsm-lead-phone-dial-trigger:active {
	background-color: transparent !important;
	background-image: none !important;
	border-color: #d8d2c4 !important;
	box-shadow: none !important;
	text-shadow: none !important;
	color: inherit !important;
}

.nsm-lead-phone-dial-flag {
	display: inline-flex;
	flex-shrink: 0;
	width: 20px;
	height: 15px;
	overflow: hidden;
	border-radius: 2px;
	line-height: 0;
}

.nsm-lead-phone-dial-flag svg {
	display: block;
	width: 100%;
	height: 100%;
}

.nsm-lead-phone-dial-code {
	white-space: nowrap;
}

/* position: fixed, not absolute - same reasoning as intro-cta.css (a
   plain absolutely-positioned child can get clipped by a scrolling
   ancestor); contact-form.js computes real viewport coordinates each
   time it opens via getBoundingClientRect(), which works just as well
   whether or not this widget happens to sit inside a scroll container. */
.nsm-lead-phone-dial-list {
	position: fixed;
	z-index: 1000;
	min-width: 220px;
	max-height: 260px;
	overflow-y: auto;
	border-style: solid;
	border-width: 1px;
	border-color: #4a4038;
	background-color: #faf6ec;
	padding: 0;
}

.nsm-lead-phone-dial-list[hidden] {
	display: none;
}

.nsm-lead-phone-dial-search-wrap {
	position: sticky;
	top: 0;
	background-color: inherit;
	padding: 6px;
}

.nsm-lead-phone-dial-search {
	width: 100%;
	border-style: solid;
	border-width: 1px;
	border-color: #d8d2c4;
	background-color: transparent;
	padding: 8px 10px;
	font-family: inherit;
	font-size: 13px;
}

.nsm-lead-phone-dial-search:focus {
	outline: none;
}

.nsm-lead-phone-dial-options {
	padding: 0 4px 4px;
}

.nsm-lead-phone-dial-option {
	display: flex;
	align-items: center;
	gap: 8px;
	width: 100%;
	border: none;
	background: none;
	padding: 8px 10px;
	font-family: inherit;
	font-size: inherit;
	color: inherit;
	text-align: left;
	cursor: pointer;
}

.nsm-lead-phone-dial-option[hidden] {
	display: none;
}

.nsm-lead-phone-dial-option:hover,
.nsm-lead-phone-dial-option:focus {
	background-color: rgba( 0, 0, 0, 0.06 );
	outline: none;
}

.nsm-lead-phone-dial-name {
	overflow: hidden;
	font-size: 12px;
	white-space: nowrap;
	text-overflow: ellipsis;
	opacity: 0.75;
}

.nsm-lead-phone-dial-empty {
	margin: 0;
	padding: 10px;
	font-size: 12px;
	text-align: center;
	opacity: 0.7;
}

.nsm-lead-phone-dial-empty[hidden] {
	display: none;
}
