/**
 * Skyline WhatsApp Bridge — frontend styles.
 * Fully scoped, minimal, no external assets.
 *
 * The root element always carries one swb-desktop-* and one swb-mobile-*
 * class, so each device breakpoint can position the widget without
 * specificity conflicts.
 */

.swb-root {
	position: fixed;
	bottom: var(--swb-dy, 20px);
	right: var(--swb-dx, 20px);
	left: auto;
	z-index: 99990;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 10px;
}

.swb-root.swb-desktop-left {
	right: auto;
	left: var(--swb-dx, 20px);
	align-items: flex-start;
}

/* --- Device visibility ---------------------------------------------------- */

@media (min-width: 783px) {
	.swb-root.swb-hide-desktop {
		display: none;
	}
}

@media (max-width: 782px) {
	.swb-root.swb-hide-mobile {
		display: none;
	}
}

/* --- Button ------------------------------------------------------------- */

.swb-button {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	box-sizing: border-box;
	padding: 12px;
	min-height: var(--swb-size, 56px);
	background: var(--swb-bg, #25d366);
	border-radius: var(--swb-radius, 28px);
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
	color: var(--swb-icon, #ffffff);
	text-decoration: none;
	line-height: 1;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
	-webkit-tap-highlight-color: transparent;
}

.swb-button:hover {
	transform: translateY(-1px);
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
	color: var(--swb-icon, #ffffff);
	text-decoration: none;
}

.swb-button:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.swb-svg {
	display: block;
	width: var(--swb-icon-size, 28px);
	height: var(--swb-icon-size, 28px);
	fill: currentColor;
	pointer-events: none;
}

.swb-button__label {
	color: inherit;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;
	white-space: nowrap;
}

/* Icon-only style hides the label. */
.swb-style-icon {
	padding: 0;
	width: var(--swb-size, 56px);
	height: var(--swb-size, 56px);
	justify-content: center;
}

.swb-style-icon .swb-button__label {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* Optional subtle animation (disabled by default). */
@media (prefers-reduced-motion: no-preference) {
	.swb-animated .swb-button::after {
		content: "";
		position: absolute;
		top: 0;
		right: 0;
		bottom: 0;
		left: 0;
		border-radius: inherit;
		border: 2px solid var(--swb-bg, #25d366);
		animation: swb-pulse 2.4s ease-out infinite;
	}
}

@keyframes swb-pulse {
	0% {
		transform: scale(1);
		opacity: 0.6;
	}
	70% {
		transform: scale(1.35);
		opacity: 0;
	}
	100% {
		transform: scale(1.35);
		opacity: 0;
	}
}

/* --- Welcome popup -------------------------------------------------------- */

.swb-popup {
	position: absolute;
	bottom: 100%;
	margin-bottom: 12px;
	width: 300px;
	max-width: calc(100vw - 32px);
	font-family: inherit;
}

.swb-popup[hidden] {
	display: none;
}

.swb-popup__card {
	background: #ffffff;
	border-radius: 12px;
	box-shadow: 0 8px 30px rgba(0, 0, 0, 0.22);
	overflow: hidden;
	transition: opacity 0.15s ease, transform 0.15s ease;
	opacity: 0;
	transform: translateY(6px);
}

.swb-popup.is-open .swb-popup__card {
	opacity: 1;
	transform: translateY(0);
}

.swb-popup__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 8px 12px;
	background: var(--swb-bg, #25d366);
	color: var(--swb-icon, #ffffff);
}

.swb-popup__company {
	font-size: 12px;
	font-weight: 600;
	line-height: 1.3;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.swb-popup__close {
	appearance: none;
	background: transparent;
	border: 0;
	color: inherit;
	font-size: 18px;
	line-height: 1;
	padding: 2px 6px;
	cursor: pointer;
}

.swb-popup__close:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 1px;
	border-radius: 4px;
}

.swb-popup__body {
	padding: 14px;
	color: #1f2328;
	direction: ltr;
	text-align: left;
}

.swb-rtl .swb-popup__body {
	direction: rtl;
	text-align: right;
}

.swb-rtl .swb-popup__body .swb-popup__cta {
	flex-direction: row-reverse;
}

.swb-popup__heading {
	margin: 0 0 6px;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.35;
}

.swb-popup__message {
	margin: 0 0 12px;
	font-size: 13px;
	line-height: 1.55;
	color: #4a5158;
}

.swb-popup__cta {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 10px 14px;
	background: var(--swb-bg, #25d366);
	color: var(--swb-icon, #ffffff);
	border-radius: 8px;
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	line-height: 1.2;
}

.swb-popup__cta:hover,
.swb-popup__cta:focus {
	color: var(--swb-icon, #ffffff);
	text-decoration: none;
	opacity: 0.92;
}

.swb-popup__cta:focus-visible {
	outline: 2px solid #1f2328;
	outline-offset: 2px;
}

.swb-popup__cta .swb-svg {
	width: 18px;
	height: 18px;
	flex: 0 0 auto;
}

.swb-popup__cta-label {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* --- Mobile --------------------------------------------------------------- */

@media (max-width: 782px) {
	.swb-root.swb-mobile-right {
		bottom: var(--swb-my, 16px);
		right: var(--swb-mx, 16px);
		left: auto;
	}

	.swb-root.swb-mobile-left {
		bottom: var(--swb-my, 16px);
		left: var(--swb-mx, 16px);
		right: auto;
	}
}

/* --- Lead qualification questionnaire (English-only) ---------------------- */

/* Scrollable card so three questions never overflow small screens
   (no document layout shift: the popup is absolutely positioned). */
.swb-qual .swb-popup__card {
	display: flex;
	flex-direction: column;
	max-height: calc(100vh - 140px);
}

.swb-qual .swb-popup__body {
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}

/* Questionnaire text is English-only on every page language, so it is
   forced back to LTR even inside the RTL root. Declared after the
   .swb-rtl rules so the equal-specificity cascade resolves in its favor. */
.swb-qual .swb-popup__body,
.swb-rtl .swb-qual .swb-popup__body {
	direction: ltr;
	text-align: left;
}

.swb-qual__field {
	border: 0;
	border-bottom: 1px solid #eceff1;
	margin: 0 0 10px;
	padding: 0 0 8px;
}

.swb-qual__field:last-of-type {
	border-bottom: 0;
	margin-bottom: 0;
}

.swb-qual__field legend {
	font-size: 13px;
	font-weight: 700;
	line-height: 1.35;
	padding: 0 0 6px;
}

.swb-qual__field label {
	display: block;
	font-size: 13px;
	line-height: 1.7;
	cursor: pointer;
}

.swb-qual__field input {
	margin: 0 6px 0 0;
	vertical-align: middle;
}

.swb-qual__actions {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-top: 12px;
}

.swb-qual__actions .swb-popup__cta {
	flex: 1;
	flex-direction: row-reverse; /* neutralize the RTL rule above */
}

.swb-qual__skip {
	font-size: 13px;
	color: #4a5158;
	padding: 8px 4px;
	text-decoration: underline;
	white-space: nowrap;
}

.swb-qual__skip:hover {
	color: #1f2328;
}

.swb-qual__skip:focus-visible {
	outline: 2px solid #1f2328;
	outline-offset: 2px;
}
