/* EcoGas Surveys v1.1.0 */

.ecgs-root {
	--ecgs-accent: #0f6b3f;
	--ecgs-ink: #1c1f1d;
	--ecgs-muted: #5d6663;
	--ecgs-line: #dfe4e1;
	--ecgs-surface: #ffffff;

	position: fixed;
	z-index: 99990;
	inset: auto 0 0 0;
	display: flex;
	justify-content: center;
	pointer-events: none;
	font-family: inherit;
}

.ecgs-sheet {
	pointer-events: auto;
	position: relative;
	width: 100%;
	max-width: 520px;
	background: var(--ecgs-surface);
	color: var(--ecgs-ink);
	border-top: 3px solid var(--ecgs-accent);
	border-radius: 14px 14px 0 0;
	box-shadow: 0 -8px 32px rgba(20, 32, 26, 0.18);
	padding: 14px 18px calc(18px + env(safe-area-inset-bottom));
	transform: translateY(102%);
	transition: transform 240ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

.ecgs-root.is-open .ecgs-sheet {
	transform: translateY(0);
}

.ecgs-grip {
	width: 38px;
	height: 4px;
	border-radius: 2px;
	background: var(--ecgs-line);
	margin: 0 auto 12px;
}

.ecgs-close {
	position: absolute;
	top: 6px;
	right: 8px;
	width: 40px;
	height: 40px;
	border: 0;
	background: transparent;
	color: var(--ecgs-muted);
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	border-radius: 8px;
}

.ecgs-close:hover {
	color: var(--ecgs-ink);
}

.ecgs-question {
	margin: 0 34px 4px 0;
	font-size: 17px;
	line-height: 1.3;
	font-weight: 600;
	color: var(--ecgs-ink);
}

.ecgs-note {
	margin: 0 0 12px;
	font-size: 13.5px;
	line-height: 1.45;
	color: var(--ecgs-muted);
	max-width: 46ch;
}

.ecgs-options {
	display: flex;
	flex-direction: column;
	gap: 8px;
	max-height: 46vh;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}

.ecgs-option {
	width: 100%;
	min-height: 48px;
	text-align: left;
	padding: 12px 14px;
	font-size: 15px;
	line-height: 1.35;
	color: var(--ecgs-ink);
	background: #f7f9f8;
	border: 1px solid var(--ecgs-line);
	border-radius: 10px;
	cursor: pointer;
	transition: border-color 120ms ease, background 120ms ease;
}

.ecgs-option:hover,
.ecgs-option:focus-visible {
	background: #fff;
	border-color: var(--ecgs-accent);
	outline: none;
}

.ecgs-option:focus-visible {
	box-shadow: 0 0 0 3px rgba(15, 107, 63, 0.22);
}

.ecgs-text {
	width: 100%;
	box-sizing: border-box;
	padding: 10px 12px;
	font-family: inherit;
	font-size: 15px;
	line-height: 1.45;
	color: var(--ecgs-ink);
	border: 1px solid var(--ecgs-line);
	border-radius: 10px;
	resize: vertical;
	margin-bottom: 12px;
}

.ecgs-text:focus {
	border-color: var(--ecgs-accent);
	outline: none;
	box-shadow: 0 0 0 3px rgba(15, 107, 63, 0.18);
}

.ecgs-actions {
	display: flex;
	gap: 10px;
	align-items: center;
	justify-content: flex-end;
}

.ecgs-ghost {
	min-height: 44px;
	padding: 0 12px;
	background: none;
	border: 0;
	color: var(--ecgs-muted);
	font-size: 14.5px;
	cursor: pointer;
	border-radius: 8px;
}

.ecgs-ghost:hover {
	color: var(--ecgs-ink);
}

.ecgs-submit {
	min-height: 46px;
	padding: 0 20px;
	background: var(--ecgs-accent);
	color: #fff;
	border: 0;
	border-radius: 10px;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
}

.ecgs-submit:focus-visible {
	outline: 3px solid rgba(15, 107, 63, 0.35);
	outline-offset: 2px;
}

.ecgs-thanks {
	margin: 6px 34px 6px 0;
	font-size: 15.5px;
	line-height: 1.45;
	color: var(--ecgs-ink);
}

/* Escritorio: tarjeta a la izquierda, para no tapar la burbuja del chat. */
@media ( min-width: 781px ) {
	.ecgs-root {
		inset: auto auto 24px 24px;
		justify-content: flex-start;
	}

	.ecgs-sheet {
		width: 380px;
		border-radius: 14px;
		border-top-width: 3px;
		box-shadow: 0 12px 34px rgba(20, 32, 26, 0.16);
		transform: translateY( calc( 100% + 32px ) );
	}

	.ecgs-grip {
		display: none;
	}

	.ecgs-options {
		max-height: none;
	}
}

@media ( prefers-reduced-motion: reduce ) {
	.ecgs-sheet {
		transition: none;
		transform: none;
	}
	.ecgs-root:not(.is-open) {
		display: none;
	}
}

@media ( prefers-color-scheme: dark ) {
	.ecgs-root {
		--ecgs-ink: #f1f4f2;
		--ecgs-muted: #a8b2ae;
		--ecgs-line: #333b37;
		--ecgs-surface: #1a1e1c;
	}
	.ecgs-option {
		background: #232825;
	}
	.ecgs-option:hover,
	.ecgs-option:focus-visible {
		background: #2a302c;
	}
	.ecgs-text {
		background: #232825;
	}
}

/* Recompensa por completar la encuesta (v1.2.0) */

.ecgs-incentive {
	margin: 12px 0 0;
	padding-top: 10px;
	border-top: 1px solid var(--ecgs-line);
	font-size: 13px;
	line-height: 1.4;
	color: var(--ecgs-muted);
}

.ecgs-loading {
	margin: 10px 0;
	color: var(--ecgs-muted);
	font-size: 14.5px;
}

.ecgs-code-box {
	display: flex;
	align-items: stretch;
	gap: 8px;
	margin: 4px 0 8px;
}

.ecgs-code {
	flex: 1 1 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 52px;
	padding: 0 14px;
	font-size: 21px;
	font-weight: 700;
	letter-spacing: 0.06em;
	color: var(--ecgs-accent);
	background: #f2f7f4;
	border: 1px dashed var(--ecgs-accent);
	border-radius: 10px;
	user-select: all;
	word-break: break-all;
}

.ecgs-copy {
	flex: 0 0 auto;
	min-height: 52px;
	padding: 0 16px;
	font-size: 14.5px;
	font-weight: 600;
	color: #fff;
	background: var(--ecgs-accent);
	border: 0;
	border-radius: 10px;
	cursor: pointer;
}

.ecgs-copy.is-copied {
	background: #4b5652;
}

.ecgs-terms {
	margin: 0 0 14px;
	font-size: 12.5px;
	color: var(--ecgs-muted);
}

@media ( prefers-color-scheme: dark ) {
	.ecgs-code {
		background: #202a24;
	}
}
