/* Seriteq Coverage Platform v2 — front-end widget
   Brand: bg #0B0D0F · primary blue #1A4B6E · secondary blue #0094D1 · accent yellow #FCC400
   Map engine: MapTiler (MapLibre GL JS) */

.stq-coverage {
	--stq-bg: #0B0D0F;
	--stq-surface: #16181c;
	--stq-surface-2: #262626;
	--stq-brand-primary: #1A4B6E;
	--stq-brand-secondary: #0094D1;
	--stq-brand-accent: #FCC400;
	--stq-primary: var(--stq-brand-secondary);
	--stq-primary-600: var(--stq-brand-primary);
	--stq-text: #ffffff;
	--stq-muted: #9aa0a6;
	--stq-radius: 14px;
	--stq-border: rgba(255, 255, 255, .08);

	display: grid;
	grid-template-columns: minmax(300px, 380px) 1fr;
	gap: 20px;
	background: var(--stq-bg);
	color: var(--stq-text);
	border-radius: var(--stq-radius);
	padding: 20px;
	font-family: inherit;
	box-sizing: border-box;
}

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

@media (max-width: 860px) {
	.stq-coverage { grid-template-columns: 1fr; }
}

/* Panel ------------------------------------------------------------------ */
.stq-coverage__panel { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

.stq-search__label {
	display: block;
	font-size: 18px;
	font-weight: 700;
	margin-bottom: 10px;
	letter-spacing: .2px;
}

.stq-search__row { display: flex; gap: 8px; }

.stq-search__input,
.stq-lead input,
.stq-lead textarea {
	width: 100%;
	background: var(--stq-surface);
	border: 1px solid var(--stq-border);
	border-radius: 10px;
	color: var(--stq-text);
	padding: 12px 14px;
	font-size: 15px;
	outline: none;
	transition: border-color .15s ease, box-shadow .15s ease;
}

.stq-search__input:focus,
.stq-lead input:focus,
.stq-lead textarea:focus {
	border-color: var(--stq-primary);
	box-shadow: 0 0 0 3px rgba(0, 148, 209, .22);
}

.stq-search__input::placeholder,
.stq-lead input::placeholder,
.stq-lead textarea::placeholder { color: var(--stq-muted); }

.stq-search__hint { margin: 8px 0 0; font-size: 12.5px; color: var(--stq-muted); }

/* Buttons ---------------------------------------------------------------- */
.stq-btn {
	appearance: none;
	border: none;
	cursor: pointer;
	border-radius: 10px;
	font-weight: 700;
	font-size: 15px;
	padding: 12px 18px;
	transition: transform .05s ease, background .15s ease, opacity .15s ease;
	white-space: nowrap;
}
.stq-btn:active { transform: translateY(1px); }
.stq-btn--primary { background: var(--stq-primary); color: #fff; }
.stq-btn--primary:hover { background: var(--stq-primary-600); }
.stq-btn[disabled] { opacity: .6; cursor: default; }
.stq-btn--ghost {
	background: rgba(11, 13, 15, .85);
	color: var(--stq-text);
	border: 1px solid var(--stq-border);
	backdrop-filter: blur(4px);
	position: absolute;
	top: 12px;
	left: 12px;
	z-index: 1;
	padding: 9px 14px;
	font-size: 13px;
}
.stq-btn--ghost:hover { background: rgba(38, 38, 38, .9); }

/* Result card ------------------------------------------------------------ */
.stq-result {
	background: var(--stq-surface);
	border: 1px solid var(--stq-border);
	border-left: 4px solid var(--stq-primary);
	border-radius: 12px;
	padding: 16px 18px;
	animation: stq-fade .2s ease;
}
.stq-result--none { border-left-color: var(--stq-muted); }
.stq-result__status { font-size: 13px; text-transform: uppercase; letter-spacing: 1px; color: var(--stq-primary); font-weight: 800; margin: 0 0 6px; }
.stq-result--none .stq-result__status { color: var(--stq-muted); }
.stq-result__site { font-size: 20px; font-weight: 800; margin: 0 0 2px; }
.stq-result__meta { font-size: 13.5px; color: var(--stq-muted); margin: 0 0 12px; }
.stq-result__services { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.stq-result__services li {
	background: var(--stq-surface-2);
	border-radius: 999px;
	padding: 4px 12px;
	font-size: 12.5px;
	font-weight: 600;
}
.stq-result__services li::before { content: "✓ "; color: var(--stq-brand-secondary); }

/* Lead form -------------------------------------------------------------- */
.stq-lead {
	background: var(--stq-surface);
	border: 1px solid var(--stq-border);
	border-radius: 12px;
	padding: 16px 18px;
	animation: stq-fade .2s ease;
}
.stq-lead__title { margin: 0 0 12px; font-size: 16px; font-weight: 800; }
.stq-lead__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.stq-lead__full { grid-column: 1 / -1; resize: vertical; }
.stq-lead__submit { width: 100%; }
.stq-lead__status { margin: 10px 0 0; font-size: 13.5px; }
.stq-lead__status--ok { color: #7CFCB0; }
.stq-lead__status--err { color: #FF8A8A; }
.stq-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Legend ----------------------------------------------------------------- */
/* ---- Site visibility filter ---- */
.stq-sites { font-size: 13px; }
.stq-sites__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.stq-sites__title { margin: 0; font-weight: 700; color: var(--stq-muted); }
.stq-sites__all {
	background: none; border: none; padding: 0; cursor: pointer;
	color: var(--stq-primary); font: inherit; font-weight: 600;
}
.stq-sites__all:hover { text-decoration: underline; }
.stq-sites__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.stq-sites__item { display: flex; align-items: center; gap: 8px; }
.stq-sites__label { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; cursor: pointer; }
.stq-sites__check { flex: none; accent-color: var(--stq-primary); }
.stq-sites__name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stq-sites__meta { color: var(--stq-muted); font-size: 12px; flex: none; }
.stq-sites__only {
	background: none; border: 1px solid var(--stq-border); border-radius: 999px;
	color: var(--stq-muted); font: inherit; font-size: 11.5px; font-weight: 600;
	padding: 1px 9px; cursor: pointer; flex: none;
}
.stq-sites__only:hover { color: #fff; border-color: var(--stq-primary); }

.stq-legend { margin: 0; font-size: 13px; color: var(--stq-muted); }
.stq-legend__title { margin: 0 0 6px; font-weight: 700; color: inherit; }
.stq-legend__scale {
	height: 10px;
	border-radius: 999px;
	/* Matches the JS ramp: red at the site, tinting to Seriteq blue at range. */
	background: linear-gradient(90deg, #E4002B 0%, #F26D1B 25%, #F2C200 50%, #7FB539 75%, #0094D1 100%);
}
.stq-legend__ends { display: flex; justify-content: space-between; margin-top: 5px; font-size: 12px; }
.stq-legend__hint { margin: 6px 0 0; font-size: 12px; opacity: 0.8; }

/* BoFiNet toggle ----------------------------------------------------------- */
.stq-toggle { display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.stq-toggle__input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.stq-toggle__track {
	width: 38px; height: 22px; border-radius: 999px;
	background: var(--stq-surface-2);
	border: 1px solid var(--stq-border);
	position: relative;
	flex: 0 0 auto;
	transition: background .15s ease;
}
.stq-toggle__thumb {
	position: absolute; top: 2px; left: 2px;
	width: 16px; height: 16px; border-radius: 50%;
	background: var(--stq-muted);
	transition: transform .15s ease, background .15s ease;
}
.stq-toggle__input:checked + .stq-toggle__track { background: rgba(140, 180, 200, .25); border-color: #8CB4C8; }
.stq-toggle__input:checked + .stq-toggle__track .stq-toggle__thumb { transform: translateX(16px); background: #8CB4C8; }
.stq-toggle__input:focus-visible + .stq-toggle__track { box-shadow: 0 0 0 3px rgba(140, 180, 200, .25); }
.stq-toggle__label { font-size: 13.5px; font-weight: 600; }
.stq-bofinet-note { margin: -6px 0 0; font-size: 12px; color: var(--stq-muted); line-height: 1.5; }

/* Map -------------------------------------------------------------------- */
.stq-coverage__map { position: relative; border-radius: 12px; overflow: hidden; min-height: 360px; }
.stq-map { position: absolute; inset: 0; }
.stq-map__notice {
	position: absolute; inset: 0;
	display: flex; align-items: center; justify-content: center;
	text-align: center; padding: 24px;
	background: var(--stq-surface); color: var(--stq-muted); font-size: 14px;
}

/*
 * `[hidden]` must beat any display declared on these elements.
 * .stq-map__notice sets `display:flex`, which silently overrode the browser's
 * `[hidden] { display: none }` — leaving an empty, fully opaque panel stretched
 * across the whole map (position:absolute; inset:0) that hid the rendered map
 * completely. The map was drawing correctly the entire time; nothing could be
 * seen through the overlay. Scoped to the widget and applied to every element
 * so the same trap cannot reappear on the result, lead, sites or note blocks.
 */
.stq-coverage [hidden] { display: none !important; }

/* MapLibre / MapTiler popup theming */
.stq-coverage .maplibregl-popup-content {
	background: var(--stq-surface);
	color: var(--stq-text);
	border-radius: 10px;
	border: 1px solid var(--stq-border);
	font-family: inherit;
	padding: 12px 14px;
}
.stq-coverage .maplibregl-popup-tip { border-top-color: var(--stq-surface) !important; border-bottom-color: var(--stq-surface) !important; }
.stq-coverage .maplibregl-popup-close-button { color: var(--stq-muted); font-size: 18px; }
.stq-popup__name { font-weight: 800; margin: 0 0 2px; }
.stq-popup__meta { color: var(--stq-muted); font-size: 12.5px; margin: 0; }
.stq-popup__sectors { margin: 6px 0 0; padding-left: 16px; font-size: 12px; color: var(--stq-muted); }
.stq-popup__sectors li { margin: 1px 0; }

/* Result signal line — swatch is coloured inline from the same JS ramp. */
.stq-result__signal { display: flex; align-items: center; gap: 8px; margin: 6px 0 0; font-weight: 600; }
.stq-result__swatch {
	width: 12px; height: 12px; border-radius: 50%;
	background: var(--stq-signal, #0094D1);
	box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.18);
	flex: none;
}

@keyframes stq-fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
