/**
 * Elix Newsletter — popup, minimised tab, footer form.
 *
 * Layout is shared; [data-skin] carries the brand. Colours and fonts read the
 * active theme's own tokens (both themes emit them on :root) with the brand
 * values as fallbacks, so a token change in a theme flows through here.
 *
 *   airfresh24 — light, rounded, claret pill CTA, flower-dot accent.
 *   amarella   — dark editorial panel, serif display, gold hairline, square.
 */

/* ------------------------------------------------------------------ base */

.elix-nl,
.elix-nl-teaser {
	--enl-ink: #221a1c;
	--enl-muted: #6e6366;
	--enl-surface: #fff;
	--enl-line: #ebe6e2;
	--enl-accent: #811328;
	--enl-accent-hover: #5c0c1c;
	--enl-on-accent: #fff;
	--enl-soft: #f7eeef;
	--enl-error: #c0301c;
	--enl-radius: 20px;
	--enl-field-radius: 999px;
	--enl-display: system-ui, sans-serif;
	--enl-body: system-ui, sans-serif;
	--enl-shadow: 0 18px 50px rgb(34 26 28 / 0.18), 0 2px 6px rgb(34 26 28 / 0.06);
	--enl-gap: 16px;
}

.elix-nl {
	position: fixed;
	bottom: var(--enl-gap);
	left: var(--enl-gap);
	z-index: 95;
	width: min(420px, calc(100vw - 2 * var(--enl-gap)));
	max-height: calc(100vh - 2 * var(--enl-gap));
	max-height: calc(100dvh - 2 * var(--enl-gap));
	opacity: 0;
	transform: translateY(24px);
	transition: opacity 0.28s ease, transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.elix-nl[data-pos="right"] {
	right: var(--enl-gap);
	left: auto;
}

.elix-nl.is-open {
	opacity: 1;
	transform: none;
}

.elix-nl[hidden],
.elix-nl-teaser[hidden],
.elix-nl [hidden] {
	display: none !important;
}

.elix-nl *,
.elix-nl *::before,
.elix-nl *::after {
	box-sizing: border-box;
}

.elix-nl__card {
	position: relative;
	max-height: inherit;
	overflow: auto;
	overscroll-behavior: contain;
	border-radius: var(--enl-radius);
	background: var(--enl-surface);
	box-shadow: var(--enl-shadow);
	color: var(--enl-ink);
	font-family: var(--enl-body);
	font-size: 15px;
	line-height: 1.5;
}

.elix-nl__media img {
	display: block;
	width: 100%;
	height: 160px;
	object-fit: cover;
}

.elix-nl__body {
	padding: 28px;
}

.elix-nl__close {
	position: absolute;
	top: 8px;
	right: 8px;
	z-index: 2;
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: inherit;
	cursor: pointer;
	opacity: 0.7;
}

.elix-nl__close:hover {
	opacity: 1;
}

.elix-nl__card:has(.elix-nl__media) .elix-nl__close {
	background: rgb(255 255 255 / 0.85);
	color: #221a1c;
	opacity: 1;
}

.elix-nl__badge {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	width: 84px;
	height: 84px;
	margin-bottom: 14px;
	border-radius: 50%;
	text-align: center;
}

.elix-nl__badge-num {
	font-family: var(--enl-display);
	font-size: 26px;
	font-weight: 700;
	line-height: 1;
	letter-spacing: -0.02em;
}

.elix-nl__badge-label {
	margin-top: 3px;
	padding-inline: 6px;
	font-size: 9.5px;
	font-weight: 600;
	line-height: 1.15;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.elix-nl__eyebrow {
	margin: 0 0 6px;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.elix-nl__title {
	margin: 0 0 10px;
	padding-right: 28px;
	color: inherit;
	font-family: var(--enl-display);
	font-size: 26px;
	font-weight: 700;
	line-height: 1.12;
	letter-spacing: -0.015em;
	text-wrap: balance;
	overflow-wrap: anywhere;
}

.elix-nl__title em {
	font-style: normal;
}

.elix-nl__desc {
	margin: 0 0 18px;
	color: var(--enl-muted);
	font-size: 15px;
}

/* form */

.elix-nl__trap {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.elix-nl__sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

.elix-nl .elix-nl__row {
	display: grid;
	gap: 10px;
}

.elix-nl .elix-nl__input {
	width: 100%;
	min-height: 48px;
	margin: 0;
	padding: 0 20px;
	border: 1px solid var(--enl-line);
	border-radius: var(--enl-field-radius);
	background: var(--enl-surface);
	color: var(--enl-ink);
	font: inherit;
	font-size: 16px; /* no iOS zoom */
	box-shadow: none;
}

.elix-nl .elix-nl__input::placeholder {
	color: var(--enl-muted);
	opacity: 0.85;
}

.elix-nl .elix-nl__input[aria-invalid="true"] {
	border-color: var(--enl-error);
}

.elix-nl .elix-nl__submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	min-height: 48px;
	margin: 0;
	padding: 0 24px;
	border: 1px solid var(--enl-accent);
	border-radius: var(--enl-field-radius);
	background: var(--enl-accent);
	color: var(--enl-on-accent);
	font: inherit;
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.18s ease, border-color 0.18s ease;
}

.elix-nl .elix-nl__submit:hover {
	border-color: var(--enl-accent-hover);
	background: var(--enl-accent-hover);
}

.elix-nl__form.is-busy .elix-nl__submit {
	cursor: progress;
	opacity: 0.7;
}

.elix-nl__form.is-busy .elix-nl__submit span::after {
	content: '…';
}

.elix-nl__consent {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	margin-top: 14px;
	color: var(--enl-muted);
	font-size: 12.5px;
	line-height: 1.45;
	cursor: pointer;
}

.elix-nl__consent input {
	flex: none;
	width: 18px;
	height: 18px;
	margin: 1px 0 0;
	accent-color: var(--enl-accent);
}

.elix-nl__consent a {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.elix-nl__msg {
	margin: 10px 0 0;
	font-size: 13.5px;
	font-weight: 600;
}

.elix-nl__msg:empty {
	display: none;
}

.elix-nl__msg.is-error {
	color: var(--enl-error);
}

.elix-nl :focus-visible,
.elix-nl-teaser :focus-visible,
.elix-nl-teaser:focus-visible {
	outline: 2px solid var(--enl-accent);
	outline-offset: 2px;
}

/* success */

.elix-nl__done {
	outline: 0;
}

.elix-nl__done-icon {
	display: block;
	margin-bottom: 12px;
	color: var(--enl-accent);
}

.elix-nl.is-done .elix-nl__badge {
	display: none;
}

/* teaser (minimised tab) */

.elix-nl-teaser {
	position: fixed;
	bottom: var(--enl-gap);
	left: var(--enl-gap);
	z-index: 94;
	display: inline-flex;
	align-items: stretch;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: var(--enl-accent);
	box-shadow: var(--enl-shadow);
	color: var(--enl-on-accent);
	font-family: var(--enl-body);
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	cursor: pointer;
	animation: elix-nl-pop 0.3s ease both;
}

.elix-nl-teaser[data-pos="right"] {
	right: var(--enl-gap);
	left: auto;
}

.elix-nl-teaser__open {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 44px;
	padding: 0 6px 0 18px;
}

.elix-nl-teaser__x {
	display: grid;
	place-items: center;
	width: 40px;
	font-size: 20px;
	font-weight: 400;
	opacity: 0.75;
}

.elix-nl-teaser__x:hover {
	opacity: 1;
}

@keyframes elix-nl-pop {
	from { opacity: 0; transform: translateY(12px); }
	to { opacity: 1; transform: none; }
}

/* phones: bottom sheet */

@media (max-width: 599px) {
	.elix-nl {
		right: 0;
		bottom: 0;
		left: 0;
		width: 100%;
		max-height: 88vh;
		max-height: 88dvh;
	}

	.elix-nl[data-pos="right"] {
		right: 0;
	}

	.elix-nl__card {
		border-radius: var(--enl-radius) var(--enl-radius) 0 0;
		padding-bottom: env(safe-area-inset-bottom);
	}

	.elix-nl__body {
		padding: 24px 20px;
	}

	.elix-nl__badge {
		width: 68px;
		height: 68px;
		margin-bottom: 10px;
	}

	.elix-nl__badge-num {
		font-size: 21px;
	}

	.elix-nl__title {
		font-size: 22px;
	}

	.elix-nl__media img {
		height: 120px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.elix-nl,
	.elix-nl-teaser {
		transition: none;
		animation: none;
		transform: none;
	}
}

/* ========================================================= Airfresh24 */

[data-skin="airfresh24"] {
	--enl-ink: var(--color-ink, #221a1c);
	--enl-muted: var(--color-stone, #6e6366);
	--enl-surface: var(--color-surface, #fff);
	--enl-line: var(--color-linen, #ebe6e2);
	--enl-accent: var(--color-claret, #811328);
	--enl-accent-hover: var(--color-claret-deep, #5c0c1c);
	--enl-soft: var(--color-blush, #f7eeef);
	--enl-error: var(--color-error, #c0301c);
	--enl-display: var(--font-display, 'Bricolage Grotesque Variable', sans-serif);
	--enl-body: var(--font-body, 'Instrument Sans Variable', system-ui, sans-serif);
	--enl-radius: 22px;
}

.elix-nl[data-skin="airfresh24"] .elix-nl__card {
	background:
		radial-gradient(120% 70% at 100% 0%, var(--enl-soft) 0%, transparent 60%),
		var(--enl-surface);
	border: 1px solid var(--enl-line);
}

.elix-nl[data-skin="airfresh24"] .elix-nl__badge {
	position: relative;
	background: var(--enl-accent);
	color: #fff;
	box-shadow: 0 8px 22px rgb(129 19 40 / 0.28);
	transform: rotate(-8deg);
}

/* The Elix flower triad as a three-dot accent on the badge. */
.elix-nl[data-skin="airfresh24"] .elix-nl__badge::after {
	content: '';
	position: absolute;
	top: 2px;
	right: -14px;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--color-saffron, #ffc20d);
	box-shadow: 9px 6px 0 -0.5px var(--color-amber, #f99d1b), 4px 15px 0 -1px var(--color-vermilion, #f04d22);
}

.elix-nl[data-skin="airfresh24"] .elix-nl__eyebrow {
	color: var(--enl-accent);
}

.elix-nl[data-skin="airfresh24"] .elix-nl__title em {
	color: var(--enl-accent);
}

/* Footer form: the theme already styles input + button (af-input / af-btn). */
.elix-nl-footer {
	--enl-accent: var(--color-claret, #811328);
	--enl-muted: var(--color-stone, #6e6366);
	--enl-error: var(--color-error, #c0301c);
	max-width: 30rem;
}

.elix-nl-footer .elix-nl__form {
	display: block;
	max-width: none;
}

.elix-nl-footer .elix-nl__row {
	display: flex;
	gap: 0.625rem;
}

.elix-nl-footer .elix-nl__input {
	flex: 1;
	min-width: 0;
}

.elix-nl-footer .elix-nl__submit {
	flex: none;
}

.elix-nl-footer .elix-nl__consent {
	margin-top: 0.75rem;
	font-size: 12.5px;
}

.elix-nl-footer .elix-nl__msg {
	color: var(--color-success, #1e7a4e);
}

.elix-nl-footer .elix-nl__msg.is-error {
	color: var(--enl-error);
}

@media (max-width: 479px) {
	.elix-nl-footer .elix-nl__row {
		flex-direction: column;
	}
}

/* =========================================================== Amarella */

[data-skin="amarella"] {
	--enl-ink: var(--color-on-dark, #fff);
	--enl-muted: var(--color-on-dark-body, #bec9c1);
	--enl-surface: var(--color-ink-footer, #1e2420);
	--enl-line: var(--color-on-dark-underline, #829186);
	--enl-accent: var(--color-paper, #fff);
	--enl-accent-hover: var(--color-on-hero-em, #e7e4d9);
	--enl-on-accent: var(--color-ink, #202321);
	--enl-gold: var(--color-on-dark-gold, #c6ad78);
	--enl-error: var(--color-on-dark-error, #f19a86);
	--enl-display: var(--font-display, Georgia, 'Times New Roman', serif);
	--enl-body: var(--font-body, Arial, Helvetica, sans-serif);
	--enl-radius: 0;
	--enl-field-radius: 0;
	--enl-shadow: var(--shadow-lift, 0 25px 50px rgb(0 0 0 / 0.13)), 0 2px 8px rgb(0 0 0 / 0.12);
}

.elix-nl[data-skin="amarella"] .elix-nl__card {
	border-top: 2px solid var(--enl-gold);
}

.elix-nl[data-skin="amarella"] .elix-nl__body {
	padding: 34px 32px 30px;
}

.elix-nl[data-skin="amarella"] .elix-nl__badge {
	width: auto;
	height: auto;
	flex-direction: row;
	align-items: baseline;
	gap: 10px;
	margin-bottom: 18px;
	border-radius: 0;
	color: var(--enl-gold);
}

.elix-nl[data-skin="amarella"] .elix-nl__badge-num {
	font-size: 46px;
	font-style: italic;
	font-weight: 400;
	letter-spacing: -0.04em;
}

.elix-nl[data-skin="amarella"] .elix-nl__badge-label {
	padding: 0 0 0 12px;
	border-left: 1px solid var(--color-on-dark-line, rgb(255 255 255 / 0.19));
	color: var(--color-on-dark-eyebrow, #c8bb9d);
	font-size: 10.5px;
	font-weight: 500;
	letter-spacing: 0.16em;
}

.elix-nl[data-skin="amarella"] .elix-nl__eyebrow {
	color: var(--color-on-dark-eyebrow, #c8bb9d);
	font-size: 11px;
	font-weight: 500;
	letter-spacing: 0.18em;
}

.elix-nl[data-skin="amarella"] .elix-nl__title {
	font-size: 32px;
	font-weight: 400;
	line-height: 1.07;
	letter-spacing: -0.04em;
}

.elix-nl[data-skin="amarella"] .elix-nl__title em {
	color: var(--color-on-hero-em, #e7e4d9);
	font-style: italic;
}

.elix-nl[data-skin="amarella"] .elix-nl__desc {
	font-size: 14px;
	line-height: 1.6;
}

.elix-nl[data-skin="amarella"] .elix-nl__input {
	padding: 0;
	border-width: 0 0 1px;
	border-color: var(--enl-line);
	background: transparent;
	color: var(--enl-ink);
}

.elix-nl[data-skin="amarella"] .elix-nl__input:focus {
	border-bottom-color: var(--enl-gold);
	outline: 0;
}

.elix-nl[data-skin="amarella"] .elix-nl__row {
	gap: 16px;
}

.elix-nl[data-skin="amarella"] .elix-nl__submit {
	font-size: 12px;
	font-weight: 500;
	letter-spacing: 0.16em;
	text-transform: uppercase;
}

.elix-nl[data-skin="amarella"] .elix-nl__submit span::after {
	content: '  →';
	white-space: pre;
}

.elix-nl[data-skin="amarella"] .elix-nl__form.is-busy .elix-nl__submit span::after {
	content: '  …';
}

.elix-nl[data-skin="amarella"] .elix-nl__consent {
	font-size: 12px;
}

.elix-nl[data-skin="amarella"] .elix-nl__consent input {
	accent-color: var(--enl-gold);
}

.elix-nl[data-skin="amarella"] :focus-visible,
.elix-nl-teaser[data-skin="amarella"]:focus-visible {
	outline-color: var(--enl-gold);
}

.elix-nl[data-skin="amarella"] .elix-nl__done-icon {
	color: var(--enl-gold);
}

.elix-nl-teaser[data-skin="amarella"] {
	border-radius: 0;
	border-top: 2px solid var(--enl-gold);
	background: var(--enl-surface);
	color: var(--enl-ink);
	font-size: 11.5px;
	font-weight: 500;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

.elix-nl-teaser[data-skin="amarella"] svg {
	color: var(--enl-gold);
}

@media (max-width: 599px) {
	.elix-nl[data-skin="amarella"] .elix-nl__body {
		padding: 26px 22px 24px;
	}

	.elix-nl[data-skin="amarella"] .elix-nl__title {
		font-size: 27px;
	}

	.elix-nl[data-skin="amarella"] .elix-nl__badge-num {
		font-size: 38px;
	}
}
