/**
 * Lingo365 · floating survey entry (front-end).
 * Small, dismissible paper-plane pill that opens the survey in a sheet.
 * Scoped to .lgsx; no external dependencies.
 */

.lgsx {
	--lgsx-ink: #0F172A;
	--lgsx-ink-2: #1E293B;
	--lgsx-muted: #64748B;
	--lgsx-line: #E7E2D6;
	--lgsx-paper: #FFFFFF;
	--lgsx-cream: #FBF9F4;
	--lgsx-gold: #C39D52;
	--lgsx-gold-deep: #8A6A2F;
	--lgsx-gold-soft: #F7F0E2;
	position: fixed;
	right: 22px;
	bottom: calc(22px + env(safe-area-inset-bottom));
	z-index: 9998;
	font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
	line-height: 1.2;
}
.lgsx[hidden] { display: none !important; }
.lgsx * { box-sizing: border-box; }

.lgsx-pill {
	display: flex;
	align-items: center;
	gap: 2px;
	background: var(--lgsx-paper);
	border: 1px solid var(--lgsx-line);
	border-radius: 999px;
	box-shadow: 0 14px 40px rgba(15, 23, 42, .16);
	padding: 5px 6px 5px 5px;
	animation: lgsx-float 5.5s ease-in-out infinite;
	transition: transform .16s, box-shadow .16s;
}
.lgsx-pill:hover {
	transform: translateY(-2px);
	box-shadow: 0 20px 50px rgba(15, 23, 42, .22);
}
.lgsx-open {
	display: flex;
	align-items: center;
	gap: 10px;
	border: 0;
	background: transparent;
	padding: 4px;
	border-radius: 999px;
	color: var(--lgsx-ink);
	font: inherit;
	text-align: left;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}
.lgsx-mark {
	position: relative;
	flex: 0 0 34px;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	display: grid;
	place-items: center;
	color: var(--lgsx-gold-deep);
	background: linear-gradient(140deg, #FBF6EA, #EFE4CC);
	box-shadow: 0 0 0 0 rgba(195, 157, 82, .35);
	animation: lgsx-pulse 2.8s ease-out infinite;
}
.lgsx-copy { display: flex; flex-direction: column; gap: 1px; padding-right: 6px; }
.lgsx-copy b { font-size: 13px; font-weight: 800; letter-spacing: -.01em; color: var(--lgsx-ink); }
.lgsx-copy small { font-size: 10.5px; font-weight: 600; color: var(--lgsx-muted); }
.lgsx-x {
	flex: 0 0 26px;
	width: 26px;
	height: 26px;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: #94A3B8;
	font-size: 16px;
	line-height: 1;
	cursor: pointer;
	display: grid;
	place-items: center;
}
.lgsx-x:hover { background: #F5F2EA; color: var(--lgsx-ink); }

@keyframes lgsx-float {
	0%, 100% { transform: translateY(0); }
	50% { transform: translateY(-3px); }
}
@keyframes lgsx-pulse {
	0% { box-shadow: 0 0 0 0 rgba(195, 157, 82, .35); }
	70% { box-shadow: 0 0 0 10px rgba(195, 157, 82, 0); }
	100% { box-shadow: 0 0 0 0 rgba(195, 157, 82, 0); }
}

html.lgsx-lock { overflow: hidden; }

.lgsx-overlay {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: grid;
	place-items: center;
	padding: 22px;
	background: rgba(15, 23, 42, .52);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	animation: lgsx-fade .2s ease both;
}
.lgsx-overlay[hidden] { display: none !important; }
.lgsx-sheet {
	width: min(560px, calc(100vw - 32px));
	height: min(82vh, 780px);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	background: var(--lgsx-cream);
	border: 1px solid var(--lgsx-line);
	border-radius: 24px;
	box-shadow: 0 40px 110px rgba(15, 23, 42, .35);
	animation: lgsx-rise .3s cubic-bezier(.2, .8, .2, 1) both;
}
.lgsx-head {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 12px;
	padding: 16px 18px;
	background: var(--lgsx-paper);
	border-bottom: 1px solid var(--lgsx-line);
}
.lgsx-eyebrow {
	margin: 0 0 3px;
	font-size: 10px;
	font-weight: 800;
	letter-spacing: .16em;
	text-transform: uppercase;
	color: var(--lgsx-gold-deep);
}
.lgsx-head h3 {
	margin: 0;
	font-family: Georgia, "Songti SC", "Noto Serif SC", "Times New Roman", serif;
	font-size: 18px;
	line-height: 1.2;
	letter-spacing: -.01em;
	color: var(--lgsx-ink);
}
.lgsx-head span { font-size: 11px; color: var(--lgsx-muted); }
.lgsx-close {
	flex: 0 0 34px;
	width: 34px;
	height: 34px;
	border: 1px solid var(--lgsx-line);
	border-radius: 50%;
	background: var(--lgsx-paper);
	color: var(--lgsx-muted);
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	display: grid;
	place-items: center;
}
.lgsx-close:hover { border-color: var(--lgsx-gold); color: var(--lgsx-ink); }
.lgsx-body { flex: 1; min-height: 0; display: flex; background: var(--lgsx-cream); }
.lgsx-frame { flex: 1; width: 100%; height: 100%; border: 0; background: var(--lgsx-cream); }
.lgsx-foot {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	padding: 9px 16px;
	background: var(--lgsx-paper);
	border-top: 1px solid var(--lgsx-line);
}
.lgsx-foot span { font-size: 10.5px; color: #94A3B8; }
.lgsx-never {
	border: 0;
	background: transparent;
	padding: 0;
	font: inherit;
	font-size: 11.5px;
	font-weight: 700;
	color: var(--lgsx-gold-deep);
	cursor: pointer;
	text-decoration: underline;
	text-underline-offset: 2px;
}
.lgsx-toast {
	position: fixed;
	right: 22px;
	bottom: calc(92px + env(safe-area-inset-bottom));
	z-index: 10000;
	max-width: 80vw;
	padding: 9px 14px;
	border-radius: 999px;
	background: var(--lgsx-ink);
	color: #fff;
	font-size: 12.5px;
	opacity: 0;
	transform: translateY(8px);
	pointer-events: none;
	transition: .2s;
}
.lgsx-toast.is-on { opacity: 1; transform: translateY(0); }

@keyframes lgsx-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes lgsx-rise {
	from { opacity: 0; transform: translateY(18px) scale(.98); }
	to { opacity: 1; transform: none; }
}

@media (max-width: 600px) {
	.lgsx { right: 14px; bottom: calc(14px + env(safe-area-inset-bottom)); }
	.lgsx-copy small { display: none; }
	.lgsx-mark { flex-basis: 32px; width: 32px; height: 32px; }
	.lgsx-overlay { padding: 0; align-items: stretch; }
	.lgsx-sheet {
		width: 100vw;
		height: 100dvh;
		max-height: 100dvh;
		border: 0;
		border-radius: 0;
	}
	.lgsx-head { padding-top: calc(14px + env(safe-area-inset-top)); }
	.lgsx-foot { padding-bottom: calc(9px + env(safe-area-inset-bottom)); }
	.lgsx-toast { right: 14px; bottom: calc(80px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) {
	.lgsx-pill, .lgsx-mark, .lgsx-overlay, .lgsx-sheet { animation: none !important; }
	.lgsx-pill:hover { transform: none; }
}
