/**
 * Buen Pique Newsletter Popup — lightweight, no external fonts/libs.
 */

.bp-sf {
	--bp-sf-primary: #1e3a5f;
	--bp-sf-accent: #0ea5e9;
	--bp-sf-bg: #ffffff;
	--bp-sf-text: #0f172a;
	--bp-sf-muted: #64748b;
	--bp-sf-border: #e2e8f0;
	--bp-sf-danger: #b91c1c;
	--bp-sf-ok: #166534;
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.28s ease, visibility 0.28s ease;
}

.bp-sf.is-open {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

.bp-sf[hidden] {
	display: none !important;
}

.bp-sf__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, 0.45);
	cursor: pointer;
}

.bp-sf__dialog {
	position: relative;
	z-index: 1;
	width: min(100%, 440px);
	max-height: min(92vh, 720px);
	overflow: auto;
	background: var(--bp-sf-bg);
	color: var(--bp-sf-text);
	border-radius: 12px;
	box-shadow: 0 18px 50px rgba(15, 23, 42, 0.22);
	transform: translateY(12px) scale(0.98);
	transition: transform 0.28s ease;
	outline: none;
}

.bp-sf.is-open .bp-sf__dialog {
	transform: translateY(0) scale(1);
}

.bp-sf__close {
	position: absolute;
	top: 0.4rem;
	right: 0.45rem;
	z-index: 2;
	width: 2.25rem;
	height: 2.25rem;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: var(--bp-sf-muted);
	font-size: 1.6rem;
	line-height: 1;
	cursor: pointer;
}

.bp-sf__close:hover,
.bp-sf__close:focus-visible {
	color: var(--bp-sf-text);
	background: rgba(15, 23, 42, 0.06);
	outline: none;
}

.bp-sf__body {
	padding: 1.5rem 1.35rem 1.35rem;
}

.bp-sf__body--with-image {
	padding-top: 0;
}

.bp-sf__media {
	margin: 0 0 1rem;
	border-radius: 12px 12px 0 0;
	overflow: hidden;
	line-height: 0;
}

.bp-sf__image {
	display: block;
	width: 100%;
	height: auto;
	max-height: 160px;
	object-fit: cover;
}

.bp-sf__title {
	margin: 0 0 0.4rem;
	padding-right: 1.75rem;
	font-size: clamp(1.15rem, 2.6vw, 1.35rem);
	line-height: 1.3;
	font-weight: 700;
}

.bp-sf__subtitle {
	margin: 0 0 1rem;
	color: var(--bp-sf-muted);
	font-size: 0.95rem;
	line-height: 1.45;
}

.bp-sf__benefits {
	margin: 0 0 1.1rem;
	padding: 0;
	list-style: none;
}

.bp-sf__benefits li {
	display: flex;
	align-items: flex-start;
	gap: 0.45rem;
	margin: 0 0 0.35rem;
	font-size: 0.92rem;
	line-height: 1.4;
}

.bp-sf__check {
	color: var(--bp-sf-accent);
	font-weight: 700;
	flex: 0 0 auto;
}

.bp-sf__field {
	margin: 0 0 0.85rem;
}

.bp-sf__label {
	display: block;
	margin: 0 0 0.35rem;
	font-size: 0.85rem;
	font-weight: 600;
}

.bp-sf__input {
	width: 100%;
	box-sizing: border-box;
	padding: 0.7rem 0.8rem;
	border: 1px solid var(--bp-sf-border);
	border-radius: 8px;
	font: inherit;
	color: var(--bp-sf-text);
	background: #fff;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.bp-sf__input:focus {
	outline: none;
	border-color: var(--bp-sf-accent);
	box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
}

.bp-sf__optin {
	display: flex;
	align-items: flex-start;
	gap: 0.55rem;
	margin: 0 0 0.9rem;
	font-size: 0.82rem;
	line-height: 1.4;
	color: var(--bp-sf-muted);
	cursor: pointer;
}

.bp-sf__optin input {
	margin-top: 0.15rem;
	flex: 0 0 auto;
}

.bp-sf__optin a {
	color: var(--bp-sf-accent);
	text-decoration: underline;
}

.bp-sf__hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.bp-sf__status {
	margin: 0 0 0.75rem;
	padding: 0.55rem 0.7rem;
	border-radius: 8px;
	font-size: 0.88rem;
	line-height: 1.35;
}

.bp-sf__status.is-error {
	color: var(--bp-sf-danger);
	background: #fef2f2;
}

.bp-sf__status.is-success {
	color: var(--bp-sf-ok);
	background: #ecfdf5;
}

.bp-sf__submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 2.75rem;
	padding: 0.7rem 1rem;
	border: 0;
	border-radius: 8px;
	background: var(--bp-sf-primary);
	color: #fff;
	font: inherit;
	font-weight: 700;
	cursor: pointer;
	transition: background 0.15s ease, transform 0.15s ease, opacity 0.15s ease;
}

.bp-sf__submit:hover:not(:disabled) {
	filter: brightness(1.08);
}

.bp-sf__submit:focus-visible {
	outline: 2px solid var(--bp-sf-accent);
	outline-offset: 2px;
}

.bp-sf__submit:disabled {
	opacity: 0.65;
	cursor: wait;
}

.bp-sf.is-success .bp-sf__form .bp-sf__field,
.bp-sf.is-success .bp-sf__form .bp-sf__optin,
.bp-sf.is-success .bp-sf__form .bp-sf__submit {
	display: none;
}

@media (max-width: 480px) {
	.bp-sf {
		padding: 0.5rem;
		align-items: flex-end;
	}

	.bp-sf__dialog {
		width: 100%;
		border-radius: 14px 14px 10px 10px;
		max-height: 88vh;
	}
}

@media (prefers-reduced-motion: reduce) {
	.bp-sf,
	.bp-sf__dialog,
	.bp-sf__input,
	.bp-sf__submit {
		transition: none;
	}
}
