/* ==========================================================================
   popup.css — Newsletter popup (prospects) + referral hint (returning customers)
   ========================================================================== */

html.nh-popup-open {
	overflow: hidden;
}

/* Above sticky header (200) and mobile menu */
.nh-popup {
	position: fixed;
	inset: 0;
	z-index: 1000;
	display: flex;
	align-items: flex-end;
	justify-content: center;
}

.nh-popup[hidden] {
	display: none;
}

.nh-popup__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(13, 27, 53, 0.6);
	opacity: 0;
	transition: opacity var(--duration-slow) var(--ease);
}

.nh-popup__dialog {
	position: relative;
	width: 100%;
	max-height: 92vh;
	max-height: 92dvh;
	overflow-y: auto;
	overscroll-behavior: contain;
	background: var(--color-void);
	color: var(--color-text-light);
	border-radius: var(--radius-xl) var(--radius-xl) 0 0;
	box-shadow: var(--shadow-xl);
	transform: translateY(100%);
	transition: transform var(--duration-slow) var(--ease-out);
}

.nh-popup__dialog:focus {
	outline: none;
}

.nh-popup.is-open .nh-popup__backdrop {
	opacity: 1;
}

.nh-popup.is-open .nh-popup__dialog {
	transform: none;
}

.nh-popup__close {
	position: absolute;
	top: var(--space-3);
	right: var(--space-3);
	z-index: 1;
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	border: 0;
	border-radius: 50%;
	background: rgba(240, 237, 230, 0.08);
	color: var(--color-text-light);
	cursor: pointer;
	transition: background-color var(--duration-fast) var(--ease);
}

.nh-popup__close:hover {
	background: rgba(240, 237, 230, 0.16);
}

.nh-popup__body {
	padding: var(--space-10) var(--space-6) var(--space-6);
}

.nh-popup__step {
	display: flex;
	flex-direction: column;
	gap: var(--space-3);
}

.nh-popup__step[hidden] {
	display: none;
}

.nh-popup__title {
	display: flex;
	flex-direction: column;
	gap: var(--space-1);
	margin: 0;
	font-family: var(--font-display);
	font-weight: 600;
	color: var(--color-text-light);
}

.nh-popup__amount {
	font-size: 4rem;
	line-height: 0.9;
	color: var(--color-cyan);
}

.nh-popup__headline {
	font-size: var(--text-xl);
	line-height: var(--leading-snug);
}

.nh-popup__text {
	font-size: var(--text-sm);
	line-height: var(--leading-normal);
	color: var(--color-text-dim);
}

.nh-popup__terms {
	font-size: var(--text-xs);
	color: rgba(240, 237, 230, 0.45);
}

.nh-popup__decline {
	align-self: center;
	padding: var(--space-2) var(--space-4);
	border: 0;
	background: none;
	font-family: var(--font-body);
	font-size: var(--text-xs);
	color: rgba(240, 237, 230, 0.55);
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}

.nh-popup__decline:hover {
	color: var(--color-text-light);
}

.nh-popup__cta {
	align-self: flex-start;
	margin-top: var(--space-3);
	background: var(--color-cyan);
	color: var(--color-void);
	border-color: var(--color-cyan);
	min-height: 48px;
}

.nh-popup__cta:hover {
	background: var(--color-cyan-dark);
	border-color: var(--color-cyan-dark);
}

/* --------------------------------------------------------------------------
   Brevo form inside the popup
   -------------------------------------------------------------------------- */

.nh-popup__form form {
	margin-top: var(--space-2);
	font-family: var(--font-body);
	font-size: 0.72rem;
	line-height: 1.45;
	color: rgba(240, 237, 230, 0.5);
	background: transparent;
}

/* Brevo nests <p> in <p>, which leaves empty wrappers; spacing lives on inputs instead */
.nh-popup__form p {
	margin: 0;
}

.nh-popup__form label {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

.nh-popup__form input[type="email"],
.nh-popup__form input[type="text"] {
	width: 100%;
	min-height: 50px;
	margin-bottom: var(--space-3);
	padding: var(--space-3) var(--space-4);
	border: 1.5px solid rgba(240, 237, 230, 0.2);
	border-radius: var(--radius-md);
	background: rgba(255, 255, 255, 0.06);
	font-family: var(--font-body);
	font-size: var(--text-base);
	color: var(--color-text-light);
	transition: border-color var(--duration-fast) var(--ease);
}

.nh-popup__form input::placeholder {
	color: rgba(240, 237, 230, 0.45);
}

.nh-popup__form input[type="email"]:focus,
.nh-popup__form input[type="text"]:focus {
	outline: none;
	border-color: var(--color-cyan);
}

.nh-popup__form input[type="checkbox"] {
	width: 14px;
	height: 14px;
	margin-right: var(--space-2);
	vertical-align: middle;
	accent-color: var(--color-cyan);
}

.nh-popup__form a {
	color: rgba(240, 237, 230, 0.75);
	text-decoration: underline;
}

.nh-popup__form input[type="submit"] {
	width: 100%;
	min-height: 52px;
	margin-top: var(--space-3);
	padding: var(--space-3) var(--space-6);
	border: 0;
	border-radius: var(--radius-md);
	background: var(--color-cyan);
	font-family: var(--font-body);
	font-size: var(--text-sm);
	font-weight: 600;
	color: var(--color-void);
	cursor: pointer;
	transition: background-color var(--duration-base) var(--ease);
}

.nh-popup__form input[type="submit"]:hover {
	background: var(--color-cyan-dark);
}

.nh-popup__form .sib-alert-message {
	margin-bottom: var(--space-3);
	padding: var(--space-2) var(--space-3);
	border: 0;
	border-radius: var(--radius-sm);
	font-size: var(--text-xs);
}

/* --------------------------------------------------------------------------
   Desktop: centered modal with image column
   -------------------------------------------------------------------------- */

@media (min-width: 768px) {
	.nh-popup {
		align-items: center;
		padding: var(--space-6);
	}

	.nh-popup__dialog {
		max-width: 480px;
		border-radius: var(--radius-xl);
		overflow: hidden;
		transform: translateY(16px) scale(0.98);
		opacity: 0;
		transition:
			transform var(--duration-slow) var(--ease-out),
			opacity var(--duration-slow) var(--ease-out);
	}

	.nh-popup.is-open .nh-popup__dialog {
		opacity: 1;
	}

	.nh-popup__body {
		max-height: 92vh;
		overflow-y: auto;
		padding: var(--space-12) var(--space-10) var(--space-8);
	}

	.nh-popup__amount {
		font-size: 5.5rem;
	}

	.nh-popup__headline {
		font-size: var(--text-2xl);
	}
}

/* --------------------------------------------------------------------------
   Referral hint (returning customers)
   -------------------------------------------------------------------------- */

.nh-hint {
	position: fixed;
	left: var(--space-4);
	right: var(--space-4);
	bottom: var(--space-4);
	z-index: 900;
	padding: var(--space-5) var(--space-12) var(--space-5) var(--space-5);
	border-left: 3px solid var(--color-cyan);
	border-radius: var(--radius-lg);
	background: var(--color-surface);
	box-shadow: var(--shadow-xl);
	transform: translateY(calc(100% + var(--space-6)));
	transition: transform var(--duration-slow) var(--ease-out);
}

.nh-hint[hidden] {
	display: none;
}

.nh-hint.is-open {
	transform: none;
}

.nh-hint__close {
	position: absolute;
	top: var(--space-2);
	right: var(--space-2);
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	border: 0;
	border-radius: 50%;
	background: none;
	color: var(--color-text-muted);
	cursor: pointer;
}

.nh-hint__close:hover {
	background: var(--color-canvas);
}

.nh-hint__title {
	font-family: var(--font-display);
	font-size: var(--text-xl);
	font-weight: 600;
	line-height: var(--leading-tight);
	color: var(--color-text-dark);
}

.nh-hint__text {
	margin-top: var(--space-1);
	font-size: var(--text-sm);
	color: var(--color-text-muted);
}

.nh-hint__link {
	display: inline-block;
	margin-top: var(--space-3);
	font-size: var(--text-sm);
	font-weight: 500;
	color: var(--color-navy);
	text-decoration: underline;
	text-decoration-color: var(--color-cyan);
	text-underline-offset: 4px;
}

@media (min-width: 768px) {
	.nh-hint {
		right: auto;
		left: var(--space-6);
		bottom: var(--space-6);
		max-width: 360px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.nh-popup__backdrop,
	.nh-popup__dialog,
	.nh-hint {
		transition: none;
	}
}
