/**
 * Site-wide contact popup ("What brings you to Fovus today?")
 * Persistent launcher bubble (bottom-right) + slide-up panel.
 *
 * @package fovus
 */

.fovus-cp {
	--cp-rust: #d8613c;
	--cp-rust-dark: #b94e2d;
	--cp-ink: #111111;
	--cp-muted: #636363;
	--cp-line: #ececec;
	position: fixed;
	right: calc(24px + env(safe-area-inset-right, 0px));
	bottom: calc(24px + env(safe-area-inset-bottom, 0px));
	z-index: 2147483000;
	font-family: inherit;
	-webkit-font-smoothing: antialiased;
}

/* Launcher bubble */
.fovus-cp__bubble {
	width: 56px;
	height: 56px;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: var(--cp-rust);
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 6px 20px rgba(17, 17, 17, 0.18);
	transition: transform 0.2s ease, background 0.2s ease;
}

.fovus-cp__bubble:hover {
	background: var(--cp-rust-dark);
	transform: translateY(-1px);
}

.fovus-cp__bubble svg {
	width: 26px;
	height: 26px;
}

.fovus-cp__bubble-icon {
	display: flex;
}

.fovus-cp__bubble-icon--close {
	display: none;
}

.fovus-cp.is-open .fovus-cp__bubble-icon--open {
	display: none;
}

.fovus-cp.is-open .fovus-cp__bubble-icon--close {
	display: flex;
}

/* Panel */
.fovus-cp__panel {
	position: absolute;
	right: 0;
	bottom: 72px;
	width: min(360px, calc(100vw - 32px));
	background: #fff;
	border: 1px solid var(--cp-line);
	border-radius: 16px;
	box-shadow: 0 12px 40px rgba(17, 17, 17, 0.16);
	max-height: calc(100vh - 112px);
	max-height: calc(100dvh - 112px);
	overflow: hidden auto;
	visibility: hidden;
	opacity: 0;
	transform: translateY(10px);
	pointer-events: none;
	transition: opacity 0.22s ease, transform 0.22s ease, visibility 0s linear 0.22s;
}

.fovus-cp.is-open .fovus-cp__panel {
	visibility: visible;
	opacity: 1;
	transform: none;
	pointer-events: auto;
	transition: opacity 0.22s ease, transform 0.22s ease;
}

/* Panel header */
.fovus-cp__header {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 14px 16px;
	border-bottom: 1px solid #f0f0f0;
}

.fovus-cp__avatar {
	flex: none;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	background: var(--cp-ink);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 13px;
	font-weight: 600;
}

.fovus-cp__id {
	flex: 1;
	min-width: 0;
}

.fovus-cp__name {
	font-size: 14px;
	font-weight: 600;
	color: var(--cp-ink);
	line-height: 1.2;
}

.fovus-cp__role {
	font-size: 12px;
	color: var(--cp-muted);
	line-height: 1.3;
}

.fovus-cp__close {
	flex: none;
	appearance: none;
	border: none;
	background: transparent;
	color: #9a9a9a;
	cursor: pointer;
	padding: 4px;
	border-radius: 8px;
	display: flex;
}

.fovus-cp__close:hover {
	background: #f3f3f3;
	color: var(--cp-ink);
}

.fovus-cp__close svg {
	width: 18px;
	height: 18px;
}

/* Panel body */
.fovus-cp__body {
	padding: 16px;
}

.fovus-cp__title {
	margin: 0 0 14px;
	padding: 0;
	font-size: 16px;
	font-weight: 600;
	color: var(--cp-ink);
	line-height: 1.4;
	outline: none;
}

.fovus-cp__options {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.fovus-cp__option {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 11px 12px;
	border: 1px solid var(--cp-line);
	border-radius: 10px;
	text-decoration: none;
	color: var(--cp-ink);
	transition: border-color 0.15s ease, background 0.15s ease;
}

.fovus-cp__option:hover {
	background: #faf7f3;
	border-color: #e2d9cf;
}

.fovus-cp__option-icon {
	flex: none;
	width: 30px;
	height: 30px;
	border-radius: 8px;
	background: #f5f3ef;
	color: var(--cp-rust);
	display: flex;
	align-items: center;
	justify-content: center;
}

.fovus-cp__option-icon svg {
	width: 18px;
	height: 18px;
}

.fovus-cp__option-label {
	flex: 1;
	font-size: 14px;
	font-weight: 500;
}

.fovus-cp__option-chev {
	flex: none;
	color: #c4c4c4;
	display: flex;
}

.fovus-cp__option-chev svg {
	width: 16px;
	height: 16px;
}

/* CTA */
.fovus-cp__cta-wrap {
	margin-top: 16px;
	padding-top: 14px;
	border-top: 1px solid #f0f0f0;
}

.fovus-cp__scope {
	margin: 0 0 12px;
	font-size: 13px;
	color: var(--cp-muted);
	line-height: 1.5;
}

.fovus-cp__cta {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	background: var(--cp-rust);
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	padding: 11px 14px;
	border-radius: 10px;
	text-decoration: none;
	transition: background 0.2s ease;
}

.fovus-cp__cta:hover {
	background: var(--cp-rust-dark);
}

.fovus-cp__cta svg {
	width: 18px;
	height: 18px;
}

/* Focus visibility */
.fovus-cp__bubble:focus-visible,
.fovus-cp__option:focus-visible,
.fovus-cp__cta:focus-visible,
.fovus-cp__close:focus-visible {
	outline: 2px solid var(--cp-rust);
	outline-offset: 2px;
}

/* Mobile */
@media (max-width: 480px) {
	.fovus-cp {
		right: calc(16px + env(safe-area-inset-right, 0px));
		bottom: calc(16px + env(safe-area-inset-bottom, 0px));
	}

	.fovus-cp__bubble {
		width: 52px;
		height: 52px;
	}

	.fovus-cp__panel {
		bottom: 66px;
		width: min(360px, calc(100vw - 24px));
	}
}

@media (prefers-reduced-motion: reduce) {
	.fovus-cp__bubble,
	.fovus-cp__panel,
	.fovus-cp__option,
	.fovus-cp__cta {
		transition: none;
	}
}
