/*
 * serviNec: pop-up de suscripción (template-parts/components/snec-popup.php)
 * assets/css/popup.css · escritorio: dos columnas (foto | formulario) · móvil (≤640 px): foto arriba, formulario abajo.
 */

.snec-pop {
	--pp-blue: #1565e8;
	--pp-blue-h: #0f55c9;
	--pp-ink: #111827;
	--pp-mute: #6b7280;
	--pp-line: #e5e7eb;
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: grid;
	place-items: center;
	padding: 16px;
	box-sizing: border-box;
	font-family: 'Inter', system-ui, -apple-system, sans-serif;
	color: var(--pp-ink);
}

.snec-pop[hidden] {
	display: none;
}

.snec-pop .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

html.snec-pop-lock {
	overflow: hidden;
}

.snec-pop__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, .55);
	opacity: 0;
	transition: opacity .22s ease;
}

.snec-pop__dialog {
	position: relative;
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	width: 100%;
	max-width: 880px;
	min-height: 420px;
	max-height: calc(100dvh - 32px);
	overflow: auto;
	border-radius: 16px;
	background: #ffffff;
	box-shadow: 0 30px 80px -20px rgba(15, 23, 42, .45);
	opacity: 0;
	transform: translateY(14px) scale(.98);
	transition: opacity .22s ease, transform .22s ease;
	overscroll-behavior: contain;
}

.snec-pop__dialog:focus {
	outline: none;
}

.snec-pop.is-open .snec-pop__backdrop,
.snec-pop.is-open .snec-pop__dialog {
	opacity: 1;
}

.snec-pop.is-open .snec-pop__dialog {
	transform: none;
}

.snec-pop__close {
	position: absolute;
	top: 18px;
	right: 18px;
	z-index: 3;
	display: grid;
	place-items: center;
	width: 34px;
	height: 34px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--pp-blue);
	cursor: pointer;
	transition: background .15s;
}

.snec-pop__close svg {
	width: 22px;
	height: 22px;
}

.snec-pop__close:hover {
	background: #e8f0fd;
}

/* ── Foto y ventajas ─────────────────────────────────────────────────────── */
.snec-pop__media {
	position: relative;
	min-height: 100%;
	overflow: hidden;
	background: #0f2f6b;
	color: #ffffff;
}

.snec-pop__img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Velo oscuro arriba para que el texto se lea sobre cualquier foto. */
.snec-pop__media::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(8, 18, 38, .62) 0%, rgba(8, 18, 38, .25) 45%, rgba(8, 18, 38, 0) 70%);
	pointer-events: none;
}

/* Sin foto: fondo azul de la marca. */
.snec-pop__media--marca {
	background:
		radial-gradient(circle at 85% 90%, rgba(255, 255, 255, .12) 0, rgba(255, 255, 255, .12) 90px, transparent 91px),
		radial-gradient(circle at 85% 90%, transparent 140px, rgba(255, 255, 255, .07) 141px, rgba(255, 255, 255, .07) 142px, transparent 143px),
		radial-gradient(circle at 15% 10%, rgba(255, 255, 255, .10) 0, transparent 45%),
		linear-gradient(150deg, #0b3a8f 0%, #1565e8 100%);
}

.snec-pop__media--marca::after {
	display: none;
}

.snec-pop__media-in {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	height: 100%;
	padding: 36px 36px 26px;
	box-sizing: border-box;
}

.snec-pop__media-title {
	margin: 0 0 22px;
	font-size: 24px;
	font-weight: 500;
	line-height: 1.2;
	letter-spacing: -0.01em;
}

.snec-pop__media-title > span {
	display: block;
}

.snec-pop__perks {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: 14px;
	font-weight: 400;
	line-height: 1.3;
}

.snec-pop__perks li {
	display: flex;
	align-items: center;
	gap: 12px;
}

.snec-pop__perk-ico {
	flex: none;
	display: grid;
	place-items: center;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: rgba(37, 99, 235, .75);
	box-shadow: 0 0 0 1px rgba(255, 255, 255, .15);
}

.snec-pop__perk-ico svg {
	width: 15px;
	height: 15px;
}

.snec-pop__seal {
	display: flex;
	align-items: center;
	gap: 14px;
	align-self: flex-start;
	margin: auto 0 0;
	padding: 12px 26px 12px 18px;
	border-radius: 999px;
	background: #ffffff;
	box-shadow: 0 10px 30px rgba(8, 18, 38, .18);
	color: var(--pp-ink);
}

.snec-pop__seal-ico {
	flex: none;
	width: 24px;
	height: 24px;
	color: var(--pp-blue);
}

.snec-pop__seal-ico svg {
	width: 100%;
	height: 100%;
}

.snec-pop__seal-txt {
	display: flex;
	flex-direction: column;
	gap: 3px;
	font-size: 12.5px;
	line-height: 1.3;
	color: var(--pp-mute);
}

.snec-pop__seal-txt strong {
	font-size: 13px;
	font-weight: 500;
	color: var(--pp-ink);
}

/* ── Formulario ──────────────────────────────────────────────────────────── */
.snec-pop__panel {
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: 40px 36px 28px;
	box-sizing: border-box;
}

.snec-pop__step {
	display: flex;
	flex-direction: column;
}

.snec-pop__step[hidden] {
	display: none;
}

.snec-pop__title {
	margin: 0 0 14px;
	font-size: 31px;
	font-weight: 700;
	line-height: 1.12;
	letter-spacing: -0.025em;
	color: var(--pp-ink);
}

.snec-pop__title strong {
	display: block;
	font-weight: 700;
	color: var(--pp-blue);
}

.snec-pop__text {
	margin: 0 0 24px;
	font-size: 15px;
	line-height: 1.5;
	color: var(--pp-mute);
}

.snec-pop__text strong {
	font-weight: 700;
	color: var(--pp-blue);
}

.snec-pop__form {
	position: relative;
}

.snec-pop__field {
	display: flex;
	align-items: center;
	gap: 10px;
	height: 56px;
	padding: 0 8px 0 18px;
	box-sizing: border-box;
	border: 1px solid var(--pp-line);
	border-radius: 999px;
	background: #ffffff;
	transition: border-color .15s, box-shadow .15s;
}

.snec-pop__field:focus-within {
	border-color: #9fbef5;
	box-shadow: 0 0 0 4px rgba(21, 101, 232, .1);
}

.snec-pop__field-ico {
	flex: none;
	width: 18px;
	height: 18px;
	color: var(--pp-mute);
}

.snec-pop__field-ico svg {
	display: block;
	width: 100%;
	height: 100%;
}

.snec-pop__field input {
	flex: 1;
	min-width: 0;
	height: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	box-shadow: none;
	font: 400 14px/1.2 'Inter', system-ui, sans-serif;
	color: var(--pp-ink);
}

.snec-pop__field input::placeholder {
	color: var(--pp-mute);
	opacity: 1;
}

.snec-pop__field input:focus {
	outline: none;
}

.snec-pop__field input[aria-invalid="true"] {
	color: #b42318;
}

.snec-pop__send {
	flex: none;
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--pp-blue);
	color: #ffffff;
	cursor: pointer;
	transition: background .15s;
}

.snec-pop__send svg {
	width: 16px;
	height: 16px;
}

.snec-pop__send:hover {
	background: var(--pp-blue-h);
}

.snec-pop__send:disabled {
	cursor: wait;
	opacity: .7;
}

.snec-pop__form.is-loading .snec-pop__send svg {
	animation: snec-pop-pulse .8s ease-in-out infinite alternate;
}

@keyframes snec-pop-pulse {
	to {
		transform: translateX(3px);
		opacity: .5;
	}
}

.snec-pop__hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	opacity: 0;
}

.snec-pop__error {
	margin: 8px 0 0 18px;
	font-size: 12.5px;
	color: #d92d20;
}

.snec-pop__trust {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 10px;
	margin: 34px 0 0;
	padding: 0;
	list-style: none;
	text-align: center;
}

.snec-pop__trust li {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
}

.snec-pop__trust-ico {
	width: 22px;
	height: 22px;
	color: var(--pp-blue);
}

.snec-pop__trust-ico svg {
	display: block;
	width: 100%;
	height: 100%;
}

.snec-pop__trust-txt {
	font-size: 12.5px;
	line-height: 1.35;
	color: var(--pp-ink);
}

.snec-pop__trust-txt > span {
	display: block;
}

.snec-pop__legal {
	margin: 38px 0 0;
	font-size: 12px;
	line-height: 1.5;
	text-align: center;
	color: var(--pp-mute);
}

.snec-pop__legal a {
	color: var(--pp-blue);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.snec-pop__close:focus-visible,
.snec-pop__send:focus-visible,
.snec-pop__legal a:focus-visible,
.snec-pop__btn:focus-visible,
.snec-pop__copy:focus-visible {
	outline: 2px solid var(--pp-blue);
	outline-offset: 3px;
}

/* Agradecimiento */
.snec-pop__done {
	align-items: center;
	text-align: center;
}

.snec-pop__done:focus {
	outline: none;
}

.snec-pop__done-ico {
	display: grid;
	place-items: center;
	width: 64px;
	height: 64px;
	margin-bottom: 18px;
	border-radius: 50%;
	background: #e7f8e6;
	color: #16a34a;
}

.snec-pop__done-ico svg {
	width: 32px;
	height: 32px;
}

.snec-pop__done .snec-pop__title {
	font-size: 24px;
}

.snec-pop__coupon {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0 0 22px;
	padding: 8px 8px 8px 18px;
	border: 1.5px dashed #9fbef5;
	border-radius: 12px;
	background: #f2f6fd;
}

.snec-pop__coupon[hidden] {
	display: none;
}

.snec-pop__coupon code {
	font: 700 18px/1 'Inter', system-ui, sans-serif;
	letter-spacing: .06em;
	color: var(--pp-blue);
	background: none;
}

.snec-pop__copy {
	height: 34px;
	padding: 0 14px;
	border: 0;
	border-radius: 999px;
	background: #ffffff;
	font: 600 12.5px/1 'Inter', system-ui, sans-serif;
	color: var(--pp-blue);
	cursor: pointer;
}

.snec-pop__btn {
	height: 46px;
	padding: 0 28px;
	border: 0;
	border-radius: 999px;
	background: var(--pp-blue);
	font: 600 14px/1 'Inter', system-ui, sans-serif;
	color: #ffffff;
	cursor: pointer;
}

.snec-pop__btn:hover {
	background: var(--pp-blue-h);
}

/* ── Móvil ───────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
	.snec-pop {
		padding: 12px;
	}

	.snec-pop__dialog {
		display: block;
		max-width: 400px;
		min-height: 0;
		max-height: calc(100dvh - 24px);
		border-radius: 14px;
	}

	.snec-pop__close {
		top: 10px;
		right: 10px;
		color: #ffffff;
	}

	.snec-pop__close:hover {
		background: rgba(255, 255, 255, .15);
	}

	.snec-pop.is-done .snec-pop__close {
		color: var(--pp-blue);
	}

	.snec-pop__media {
		min-height: 0;
	}

	.snec-pop.is-done .snec-pop__media {
		display: none;
	}

	.snec-pop__media-in {
		padding: 28px 24px 26px;
	}

	.snec-pop__media-title {
		margin-bottom: 18px;
		padding-right: 28px;
		font-size: 23px;
	}

	.snec-pop__perks {
		gap: 10px;
		font-size: 13.5px;
	}

	.snec-pop__seal {
		display: none;
	}

	.snec-pop__panel {
		padding: 26px 22px 24px;
	}

	.snec-pop__title {
		margin-bottom: 10px;
		font-size: 19px;
		letter-spacing: -0.01em;
	}

	.snec-pop__title strong {
		display: inline;
	}

	.snec-pop__text {
		margin-bottom: 20px;
		font-size: 14px;
	}

	.snec-pop__field {
		height: 50px;
		padding-left: 16px;
	}

	.snec-pop__field input {
		font-size: 16px; /* evita el zoom de iOS al enfocar */
	}

	.snec-pop__send {
		width: 36px;
		height: 36px;
	}

	.snec-pop__trust {
		display: none;
	}

	.snec-pop__legal {
		margin-top: 22px;
		font-size: 11.5px;
		text-align: left;
	}

	.snec-pop__done .snec-pop__title {
		font-size: 21px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.snec-pop__backdrop,
	.snec-pop__dialog {
		transition: none;
	}

	.snec-pop__form.is-loading .snec-pop__send svg {
		animation: none;
	}
}
