/* Fruto Language Gate — horizontal flag picker */

.fruto-lang-gate {
	--flg-green: #006837;
	--flg-green-deep: #00532c;
	--flg-gold: #f5af02;
	--flg-ink: #1c1c1c;
	--flg-muted: #6b6b6b;
	--flg-line: #e8ebe7;
	--flg-soft: #f4f5f2;
	--flg-white: #ffffff;
	--flg-serif: Georgia, "Times New Roman", Times, serif;
	--flg-sans: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

	position: fixed;
	inset: 0;
	z-index: 1000000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	font-family: var(--flg-sans);
	color: var(--flg-ink);
	box-sizing: border-box;
	animation: flg-fade-in 0.35s ease;
}

.fruto-lang-gate[hidden] {
	display: none !important;
	animation: none;
}

.fruto-lang-gate *,
.fruto-lang-gate *::before,
.fruto-lang-gate *::after {
	box-sizing: border-box;
}

.fruto-lang-gate__backdrop {
	position: absolute;
	inset: 0;
	background:
		radial-gradient(ellipse 80% 60% at 50% 40%, rgba(0, 104, 55, 0.35), transparent 70%),
		rgba(12, 22, 16, 0.72);
	backdrop-filter: blur(4px);
}

.fruto-lang-gate__dialog {
	position: relative;
	width: min(720px, 100%);
	padding: 40px 40px 28px;
	border-radius: 24px;
	border: 3px solid var(--flg-green);
	background:
		linear-gradient(180deg, #ffffff 0%, #f7f9f6 100%);
	box-shadow:
		0 0 0 1px rgba(0, 104, 55, 0.12),
		0 28px 80px rgba(0, 0, 0, 0.35);
	text-align: center;
	animation: flg-rise 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.fruto-lang-gate__close {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 1px solid var(--flg-line);
	border-radius: 999px;
	background: var(--flg-white);
	color: var(--flg-ink);
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	transition:
		background 0.15s ease,
		border-color 0.15s ease,
		color 0.15s ease;
}

.fruto-lang-gate__close:hover,
.fruto-lang-gate__close:focus-visible {
	border-color: var(--flg-green);
	color: var(--flg-green);
	outline: none;
	background: var(--flg-soft);
}

.fruto-lang-gate__header {
	margin-bottom: 28px;
	padding-right: 28px;
}

.fruto-lang-gate__eyebrow {
	margin: 0 0 10px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--flg-green);
}

.fruto-lang-gate__title {
	margin: 0 0 8px;
	font-family: var(--flg-serif);
	font-size: clamp(1.65rem, 3.5vw, 2.1rem);
	font-weight: 700;
	line-height: 1.15;
	color: var(--flg-ink);
}

.fruto-lang-gate__subtitle {
	margin: 0;
	font-size: 15px;
	line-height: 1.45;
	color: var(--flg-muted);
}

.fruto-lang-gate__options {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 16px;
	margin: 0 0 22px;
}

.fruto-lang-gate__option {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	width: 100%;
	padding: 20px 14px 18px;
	border: 1px solid var(--flg-line);
	border-radius: 18px;
	background: var(--flg-white);
	cursor: pointer;
	text-align: center;
	transition:
		transform 0.2s ease,
		border-color 0.2s ease,
		box-shadow 0.2s ease,
		background 0.2s ease;
}

.fruto-lang-gate__option:hover,
.fruto-lang-gate__option:focus-visible {
	transform: translateY(-4px);
	border-color: var(--flg-green);
	background: var(--flg-white);
	outline: none;
	box-shadow:
		0 12px 28px rgba(0, 104, 55, 0.14),
		inset 0 0 0 1px var(--flg-green);
}

.fruto-lang-gate__option:active {
	transform: translateY(-1px);
}

/* Bandera rectangular tipo PNG, ligeramente ondulada */
.fruto-lang-gate__flag {
	position: relative;
	display: block;
	width: 96px;
	height: 64px;
	flex-shrink: 0;
	border-radius: 4px;
	overflow: hidden;
	box-shadow:
		0 2px 3px rgba(0, 0, 0, 0.12),
		0 10px 20px rgba(0, 0, 0, 0.18);
	transform-origin: left center;
	animation: flg-wave 3.2s ease-in-out infinite;
	filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
}

.fruto-lang-gate__flag::after {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	background: linear-gradient(
		105deg,
		rgba(255, 255, 255, 0.28) 0%,
		rgba(255, 255, 255, 0) 32%,
		rgba(0, 0, 0, 0.08) 58%,
		rgba(255, 255, 255, 0.12) 78%,
		rgba(0, 0, 0, 0.06) 100%
	);
	mix-blend-mode: soft-light;
}

.fruto-lang-gate__option:hover .fruto-lang-gate__flag,
.fruto-lang-gate__option:focus-visible .fruto-lang-gate__flag {
	animation-duration: 1.6s;
}

.fruto-lang-gate__flag svg {
	display: block;
	width: 100%;
	height: 100%;
}

.fruto-lang-gate__native {
	font-size: 16px;
	font-weight: 700;
	color: var(--flg-ink);
	letter-spacing: 0.01em;
}

.fruto-lang-gate__label {
	font-size: 12px;
	color: var(--flg-muted);
	margin-top: -6px;
}

.fruto-lang-gate__dont-show {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin: 0 0 14px;
	font-size: 13px;
	line-height: 1.3;
	color: var(--flg-ink);
	cursor: pointer;
	user-select: none;
}

.fruto-lang-gate__dont-show input {
	width: 16px;
	height: 16px;
	margin: 0;
	accent-color: var(--flg-green);
	cursor: pointer;
}

.fruto-lang-gate__hint {
	margin: 0;
	font-size: 12px;
	color: var(--flg-muted);
}

body.fruto-lang-gate-open {
	overflow: hidden;
}

@keyframes flg-fade-in {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes flg-rise {
	from {
		opacity: 0;
		transform: translateY(16px) scale(0.98);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

@keyframes flg-wave {
	0%,
	100% {
		transform: perspective(420px) rotateY(-6deg) skewY(0.4deg);
	}
	50% {
		transform: perspective(420px) rotateY(6deg) skewY(-0.4deg);
	}
}

@media (prefers-reduced-motion: reduce) {
	.fruto-lang-gate,
	.fruto-lang-gate__dialog,
	.fruto-lang-gate__flag {
		animation: none;
	}
}

@media (max-width: 640px) {
	.fruto-lang-gate__dialog {
		padding: 28px 18px 22px;
		border-radius: 20px;
		border-width: 2px;
	}

	.fruto-lang-gate__options {
		grid-template-columns: 1fr;
		gap: 10px;
	}

	.fruto-lang-gate__option {
		flex-direction: row;
		justify-content: flex-start;
		gap: 14px;
		padding: 14px 16px;
		text-align: left;
	}

	.fruto-lang-gate__flag {
		width: 72px;
		height: 48px;
		animation: none;
		transform: none;
	}

	.fruto-lang-gate__native,
	.fruto-lang-gate__label {
		text-align: left;
	}

	.fruto-lang-gate__label {
		margin-top: 0;
	}

	.fruto-lang-gate__option:hover,
	.fruto-lang-gate__option:focus-visible {
		transform: none;
	}
}
