/**
 * Simple Newsletter — form and pop-up.
 *
 * Deliberately little: layout, and the site's own colours through --snl-*
 * custom properties (printed inline from the detected brand). Fonts, sizes
 * and everything else come from the theme or the Elementor section the form
 * sits in.
 */

/* ── Form ── */

.newsletter-form {
	position: relative;
	margin: 0;
}

.newsletter-fields {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 12px;
}

.newsletter-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
	flex: 1 1 220px;
	min-width: 0;
}

.newsletter-field--submit {
	flex: 0 0 auto;
}

.newsletter-label {
	font-size: 0.875em;
	font-weight: 600;
}

.newsletter-required {
	color: var(--snl-accent, currentColor);
}

.newsletter-form .newsletter-input {
	box-sizing: border-box;
	width: 100%;
	min-height: 46px;
	padding: 0.65em 0.9em;
	border: 1px solid var(--snl-input-border, #c9c9c9);
	border-radius: 6px;
	background: #fff;
	color: inherit;
	font: inherit;
}

.newsletter-form .newsletter-input:focus {
	outline: 2px solid var(--snl-accent, currentColor);
	outline-offset: 1px;
	border-color: transparent;
}

.newsletter-form .newsletter-button,
.snl-popup .snl-popup__button {
	display: inline-block;
	min-height: 46px;
	padding: 0.7em 1.6em;
	border: 0;
	border-radius: var(--snl-radius, 6px);
	background: var(--snl-accent, #222);
	color: var(--snl-accent-text, #fff);
	font: inherit;
	font-weight: 700;
	line-height: 1.2;
	cursor: pointer;
	transition: opacity 0.15s ease;
}

.newsletter-form .newsletter-button:hover,
.newsletter-form .newsletter-button:focus-visible,
.snl-popup .snl-popup__button:hover,
.snl-popup .snl-popup__button:focus-visible {
	opacity: 0.88;
	background: var(--snl-accent, #222);
	color: var(--snl-accent-text, #fff);
}

.newsletter-form .newsletter-button:disabled {
	opacity: 0.6;
	cursor: wait;
}

.newsletter-message {
	margin: 0.75em 0 0;
	font-size: 0.9em;
}

.newsletter-message:empty {
	display: none;
}

.newsletter-message.is-error {
	color: #b3261e;
}

.newsletter-privacy {
	margin: 0.6em 0 0;
	font-size: 0.8em;
	opacity: 0.8;
}

/* The honeypot: out of sight and out of the tab order, but still in the form. */
.newsletter-hp {
	position: absolute !important;
	left: -10000px !important;
	top: auto !important;
	width: 1px !important;
	height: 1px !important;
	overflow: hidden !important;
}

/* ── Pop-up ── */

.snl-popup {
	width: 420px;
	max-width: calc(100vw - 32px);
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--snl-text, inherit);
	overflow: visible;
}

.snl-popup::backdrop {
	background: rgba(18, 14, 17, 0.55);
}

/* Browsers without <dialog>: a plain fixed box. */
.snl-popup.is-open {
	position: fixed;
	inset: 0;
	z-index: 100000;
	margin: auto;
	height: fit-content;
	box-shadow: 0 0 0 100vmax rgba(18, 14, 17, 0.55);
}

.snl-popup__box {
	position: relative;
	padding: 40px 32px 32px;
	border-radius: 16px;
	background: var(--snl-surface, #fff);
	text-align: center;
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
}

.snl-popup[open] .snl-popup__box {
	animation: snl-popup-in 0.22s ease-out;
}

@keyframes snl-popup-in {
	from {
		opacity: 0;
		transform: translateY(10px) scale(0.98);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.snl-popup[open] .snl-popup__box {
		animation: none;
	}
}

.snl-popup .snl-popup__close {
	position: absolute;
	top: 8px;
	right: 10px;
	min-height: 0;
	padding: 6px 10px;
	border: 0;
	background: transparent;
	color: var(--snl-muted, #888);
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
}

.snl-popup .snl-popup__close:hover {
	background: transparent;
	color: var(--snl-heading, #222);
}

.snl-popup__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 60px;
	height: 60px;
	margin: 0 auto 18px;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.05);
	background: color-mix(in srgb, var(--snl-accent, #222) 12%, transparent);
	color: var(--snl-accent, #222);
}

.snl-popup__svg {
	display: none;
}

.snl-popup[data-state="check"] .snl-popup__svg--check,
.snl-popup[data-state="mail"] .snl-popup__svg--mail,
.snl-popup[data-state="alert"] .snl-popup__svg--alert {
	display: block;
}

.snl-popup .snl-popup__title {
	margin: 0 0 10px;
	color: var(--snl-heading, inherit);
	font-family: var(--snl-font-heading, inherit);
	font-size: 1.6rem;
	font-weight: 400;
	line-height: 1.25;
}

.snl-popup .snl-popup__message {
	margin: 0 0 26px;
	line-height: 1.6;
}

/* ── Status page ── */

.snl-status {
	max-width: 560px;
	margin: 0 auto;
	padding: 56px 16px;
	text-align: center;
}

/* A size of its own: utility-CSS themes (Tailwind) reset headings to body size. */
.snl-status .snl-status__title {
	margin: 0 0 12px;
	color: var(--snl-heading, inherit);
	font-family: var(--snl-font-heading, inherit);
	font-size: clamp(1.6rem, 3vw, 2.1rem);
	font-weight: 400;
	line-height: 1.25;
}

.snl-status__message {
	margin: 0 0 28px;
}

.snl-status__form {
	text-align: left;
}

.snl-status__hint {
	margin: 0 0 16px;
	text-align: center;
	opacity: 0.85;
}
