/**
 * Newsletter signup (site footer) – styles.
 *
 * File:       wp-content/themes/ascendus/assets/css/newsletter-signup.css
 * Markup:     template-parts/newsletter-signup.php
 * Enqueued:   inc/newsletter-signup.php (handle "ascendus-newsletter-signup", no dependencies)
 * Font:       bilo comes from the theme's Adobe Fonts kit; Aptos / system fallbacks otherwise.
 * Scope:      every selector starts with .asc-nl. No global rules, nothing leaks into the theme.
 *
 * Look and feel: copied from the product-page blocks (#pl-loc, read from the live site on
 * 8 Oct 2026): lavender band, white card with purple-tinted shadow, bilo 500 headings in
 * charcoal, purple pill button with deep-orange hover, 48×3 orange accent rule.
 *
 * Spacing scale: 4 pt (4, 8, 12, 16, 24, 32, 48, 64, 80). Every spacing value below uses it.
 * Type scale (measured on the product pages, not modular): 14 / 15 / 16 / 18 / 28–35 px.
 */

.asc-nl {
	/* Color tokens. Contrast ratios measured; see the handover. */
	--asc-nl-purple: #753dbd;   /* primary button, checked option, focus ring. White on it: 6.65:1 */
	--asc-nl-violet: #5f04c5;   /* links. On white 9.1:1 */
	--asc-nl-ink: #2c2c2c;      /* headings, labels, option names. On white 14.0:1, on lavender 12.4:1 */
	--asc-nl-text: #5a5a5a;     /* body, hints. On white 6.9:1, on lavender 6.1:1 */
	--asc-nl-lavender: #f4effa; /* section band, checked option fill */
	--asc-nl-white: #fff;
	--asc-nl-line: #9869cc;     /* interactive borders. On white 4.0:1 (UI minimum 3:1) */
	--asc-nl-hover: #c74409;    /* primary button hover. White on it: 4.93:1 */
	--asc-nl-accent: #ea560d;   /* 48×3 accent rule only, never text */
	--asc-nl-danger: #b42318;   /* errors. NEW token: the brand set has no error color. On white 6.6:1 */

	/* Type tokens */
	--asc-nl-font: bilo, aptos, "Segoe UI", system-ui, -apple-system, sans-serif;
	--asc-nl-fs-button: 14px;
	--asc-nl-fs-body: 15px;
	--asc-nl-fs-control: 16px;  /* 16 px stops iOS from zooming into fields */
	--asc-nl-fs-name: 18px;
	--asc-nl-fs-title: clamp(28px, 1.25vw + 18px, 35px);
	--asc-nl-lh-tight: 1.15;
	--asc-nl-lh-snug: 1.35;
	--asc-nl-lh-body: 1.55;
	--asc-nl-track-button: 0.2em; /* 2.8 px at 14 px, as on the product pages */

	/* Spacing tokens (4 pt scale) */
	--asc-nl-s1: 4px;
	--asc-nl-s2: 8px;
	--asc-nl-s3: 12px;
	--asc-nl-s4: 16px;
	--asc-nl-s5: 24px;
	--asc-nl-s6: 32px;
	--asc-nl-s7: 48px;
	--asc-nl-s8: 64px;
	--asc-nl-s9: 80px;

	/* Shape and depth tokens */
	--asc-nl-radius-field: 12px;
	--asc-nl-radius-card: 16px;
	--asc-nl-radius-pill: 28px;
	--asc-nl-control: 48px;     /* control height; touch targets stay at 44 px or more */
	--asc-nl-target: 44px;
	--asc-nl-rule-w: 48px;
	--asc-nl-rule-h: 3px;
	--asc-nl-ring: 3px;
	--asc-nl-shadow: 0 18px 48px rgba(58, 30, 97, 0.18), 0 2px 6px rgba(58, 30, 97, 0.08);
	--asc-nl-wrap: 1216px;
	--asc-nl-ease: 150ms ease;

	box-sizing: border-box;
	padding: var(--asc-nl-s7) 0;
	background: var(--asc-nl-lavender);
	color: var(--asc-nl-text);
	font-family: var(--asc-nl-font);
	font-size: var(--asc-nl-fs-body);
	line-height: var(--asc-nl-lh-body);
	-webkit-font-smoothing: antialiased;
}

.asc-nl *,
.asc-nl *::before,
.asc-nl *::after {
	box-sizing: inherit;
}

/* ---------- Layout ---------- */

.asc-nl .asc-nl__wrap {
	max-width: var(--asc-nl-wrap);
	margin: 0 auto;
	padding: 0 var(--asc-nl-s5);
}

.asc-nl .asc-nl__card {
	display: grid;
	gap: var(--asc-nl-s6);
	padding: var(--asc-nl-s5);
	background: var(--asc-nl-white);
	border-radius: var(--asc-nl-radius-card);
	box-shadow: var(--asc-nl-shadow);
}

/* ---------- Intro: rule, title, links ---------- */

.asc-nl .asc-nl__title {
	max-width: 18ch;
	margin: 0;
	color: var(--asc-nl-ink);
	font-family: var(--asc-nl-font);
	font-size: var(--asc-nl-fs-title);
	font-style: normal;
	font-weight: 500;
	letter-spacing: -0.01em;
	line-height: var(--asc-nl-lh-tight);
	text-transform: none;
}

.asc-nl .asc-nl__title::before {
	content: "";
	display: block;
	width: var(--asc-nl-rule-w);
	height: var(--asc-nl-rule-h);
	margin-bottom: var(--asc-nl-s5);
	background: var(--asc-nl-accent);
}

.asc-nl .asc-nl__links {
	margin: var(--asc-nl-s5) 0 0;
	padding: 0;
	list-style: none;
}

.asc-nl .asc-nl__links li {
	margin: 0;
	padding: 0;
	color: var(--asc-nl-text);
	font-size: var(--asc-nl-fs-body);
	line-height: var(--asc-nl-lh-body);
}

.asc-nl .asc-nl__links li::before {
	content: none;
}

.asc-nl .asc-nl__link {
	display: inline-flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0 var(--asc-nl-s1);
	min-height: var(--asc-nl-target);
	color: var(--asc-nl-violet);
	font-weight: 500;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
	border-radius: var(--asc-nl-s1);
}

.asc-nl .asc-nl__link:hover {
	color: var(--asc-nl-violet);
	text-decoration-thickness: 2px;
}

.asc-nl .asc-nl__lang-note {
	color: var(--asc-nl-text);
	font-weight: 400;
}

/* ---------- Form ---------- */

/* Hidden children (the action input, the collapsed extra fields) are display:none, so they add no gap. */
.asc-nl .asc-nl__form {
	display: flex;
	flex-direction: column;
	gap: var(--asc-nl-s5);
	position: relative;
	margin: 0;
	padding: 0;
}

.asc-nl .asc-nl__group {
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
}

.asc-nl .asc-nl__legend {
	display: block;
	float: none;
	width: 100%;
	margin: 0 0 var(--asc-nl-s3);
	padding: 0;
	color: var(--asc-nl-ink);
	font-family: var(--asc-nl-font);
	font-size: var(--asc-nl-fs-control);
	font-weight: 500;
	line-height: var(--asc-nl-lh-snug);
	white-space: normal;
}

/* Newsletter option cards */

.asc-nl .asc-nl__options {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
	gap: var(--asc-nl-s3);
}

.asc-nl .asc-nl__opt {
	position: relative;
	display: grid;
	grid-template-columns: var(--asc-nl-s5) minmax(0, 1fr);
	gap: var(--asc-nl-s3);
	align-items: start;
	min-height: var(--asc-nl-target);
	padding: var(--asc-nl-s4);
	background: var(--asc-nl-white);
	border: 1px solid var(--asc-nl-line);
	border-radius: var(--asc-nl-radius-field);
	cursor: pointer;
	transition: border-color var(--asc-nl-ease), box-shadow var(--asc-nl-ease), background-color var(--asc-nl-ease);
}

.asc-nl .asc-nl__opt:hover {
	border-color: var(--asc-nl-purple);
}

.asc-nl .asc-nl__opt:has(.asc-nl__check:checked) {
	background: var(--asc-nl-lavender);
	border-color: var(--asc-nl-purple);
	box-shadow: inset 0 0 0 1px var(--asc-nl-purple);
}

.asc-nl .asc-nl__check {
	position: relative;
	z-index: 1; /* sits above the label overlay so it stays directly clickable */
	width: 22px;
	height: 22px;
	margin: 1px 0 0;
	accent-color: var(--asc-nl-purple);
	cursor: pointer;
}

.asc-nl .asc-nl__check:focus-visible {
	outline: var(--asc-nl-ring) solid var(--asc-nl-purple);
	outline-offset: 2px;
}

/* When :has() is supported, the ring moves to the whole card instead. */
@supports selector(:has(*)) {

	.asc-nl .asc-nl__check:focus-visible {
		outline: none;
	}

	.asc-nl .asc-nl__opt:has(.asc-nl__check:focus-visible) {
		outline: var(--asc-nl-ring) solid var(--asc-nl-purple);
		outline-offset: 2px;
	}
}

.asc-nl .asc-nl__opt-text {
	min-width: 0;
}

.asc-nl .asc-nl__opt-name {
	display: block;
	margin: 0;
	color: var(--asc-nl-ink);
	font-family: var(--asc-nl-font);
	font-size: var(--asc-nl-fs-name);
	font-weight: 500;
	line-height: var(--asc-nl-lh-snug);
	cursor: pointer;
}

/* The label covers the whole card, so a click anywhere toggles the checkbox. */
.asc-nl .asc-nl__opt-name::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
}

.asc-nl .asc-nl__opt-desc {
	display: block;
	margin-top: var(--asc-nl-s1);
	color: var(--asc-nl-text);
	font-size: var(--asc-nl-fs-body);
	line-height: var(--asc-nl-lh-body);
}

.asc-nl .asc-nl__group[data-invalid] .asc-nl__opt {
	border-color: var(--asc-nl-danger);
}

/* Text fields and selects */

.asc-nl .asc-nl__row {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
	gap: var(--asc-nl-s4);
}

.asc-nl .asc-nl__field {
	display: grid;
	gap: var(--asc-nl-s2);
	min-width: 0;
	margin: 0;
}

.asc-nl .asc-nl__label {
	display: block;
	margin: 0;
	color: var(--asc-nl-ink);
	font-family: var(--asc-nl-font);
	font-size: var(--asc-nl-fs-body);
	font-weight: 500;
	line-height: var(--asc-nl-lh-snug);
}

.asc-nl .asc-nl__input,
.asc-nl .asc-nl__select {
	display: block;
	width: 100%;
	height: var(--asc-nl-control);
	margin: 0;
	padding: 0 var(--asc-nl-s4);
	color: var(--asc-nl-ink);
	background-color: var(--asc-nl-white);
	border: 1px solid var(--asc-nl-line);
	border-radius: var(--asc-nl-radius-field);
	box-shadow: none;
	font-family: var(--asc-nl-font);
	font-size: var(--asc-nl-fs-control);
	line-height: var(--asc-nl-lh-snug);
	-webkit-appearance: none;
	appearance: none;
	transition: border-color var(--asc-nl-ease), box-shadow var(--asc-nl-ease);
}

.asc-nl .asc-nl__select {
	padding-right: var(--asc-nl-s7);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='M3 6l5 5 5-5' fill='none' stroke='%23753dbd' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-position: right var(--asc-nl-s4) center;
	background-repeat: no-repeat;
	background-size: var(--asc-nl-s4);
	cursor: pointer;
}

.asc-nl .asc-nl__input:hover,
.asc-nl .asc-nl__select:hover {
	border-color: var(--asc-nl-purple);
}

.asc-nl .asc-nl__input:focus,
.asc-nl .asc-nl__select:focus {
	border-color: var(--asc-nl-purple);
	outline: var(--asc-nl-ring) solid var(--asc-nl-purple);
	outline-offset: 2px;
}

.asc-nl .asc-nl__input[aria-invalid="true"],
.asc-nl .asc-nl__select[aria-invalid="true"] {
	border-color: var(--asc-nl-danger);
	box-shadow: inset 0 0 0 1px var(--asc-nl-danger);
}

/* Errors and status */

.asc-nl .asc-nl__error {
	margin: var(--asc-nl-s2) 0 0;
	color: var(--asc-nl-danger);
	font-size: var(--asc-nl-fs-body);
	font-weight: 500;
	line-height: var(--asc-nl-lh-snug);
}

.asc-nl .asc-nl__field .asc-nl__error {
	margin-top: 0;
}

/* The live region stays rendered (never display:none) so screen readers announce changes. */
.asc-nl .asc-nl__status {
	margin: 0;
	color: var(--asc-nl-text);
	font-size: var(--asc-nl-fs-body);
	line-height: var(--asc-nl-lh-body);
}

.asc-nl .asc-nl__status:not(:empty) {
	margin-top: var(--asc-nl-s4);
}

.asc-nl .asc-nl__status[data-state="loading"] {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

.asc-nl .asc-nl__status[data-state="error"] {
	color: var(--asc-nl-danger);
	font-weight: 500;
}

/* Result shown after the handler answers (replaces the fields, keeps the title) */

.asc-nl .asc-nl__result {
	margin: 0;
	padding: var(--asc-nl-s5);
	color: var(--asc-nl-ink);
	background: var(--asc-nl-lavender);
	border-radius: var(--asc-nl-radius-field);
	font-size: var(--asc-nl-fs-name);
	font-weight: 500;
	line-height: var(--asc-nl-lh-body);
	overflow-wrap: anywhere;
}

.asc-nl .asc-nl__result:focus-visible {
	outline: var(--asc-nl-ring) solid var(--asc-nl-purple);
	outline-offset: 2px;
}

/* ---------- Button ---------- */

.asc-nl .asc-nl__actions {
	display: flex;
	flex-direction: column;
	align-items: stretch;
}

.asc-nl .asc-nl__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--asc-nl-s2);
	width: 100%;
	min-height: var(--asc-nl-control);
	margin: 0;
	padding: 0 var(--asc-nl-s6);
	color: var(--asc-nl-white);
	background: var(--asc-nl-purple);
	border: 1px solid var(--asc-nl-purple);
	border-radius: var(--asc-nl-radius-pill);
	box-shadow: none;
	font-family: var(--asc-nl-font);
	font-size: var(--asc-nl-fs-button);
	font-weight: 500;
	letter-spacing: var(--asc-nl-track-button);
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	text-transform: uppercase;
	white-space: normal;
	cursor: pointer;
	transition: background-color var(--asc-nl-ease), border-color var(--asc-nl-ease), transform var(--asc-nl-ease);
}

.asc-nl .asc-nl__btn:hover {
	color: var(--asc-nl-white);
	background: var(--asc-nl-hover);
	border-color: var(--asc-nl-hover);
}

.asc-nl .asc-nl__btn:focus-visible {
	outline: var(--asc-nl-ring) solid var(--asc-nl-purple);
	outline-offset: 3px;
}

.asc-nl .asc-nl__btn:active {
	transform: translateY(1px);
}

/* Loading: stays purple and readable; aria-disabled keeps focus on the button. */
.asc-nl .asc-nl__btn[aria-disabled="true"],
.asc-nl .asc-nl__btn[aria-disabled="true"]:hover {
	background: var(--asc-nl-purple);
	border-color: var(--asc-nl-purple);
	cursor: progress;
	transform: none;
}

.asc-nl .asc-nl__spinner {
	display: none;
	flex: none;
	width: var(--asc-nl-s4);
	height: var(--asc-nl-s4);
	border: 2px solid currentcolor;
	border-right-color: transparent;
	border-radius: 50%;
	animation: asc-nl-spin 800ms linear infinite;
}

.asc-nl .asc-nl__btn[aria-busy="true"] .asc-nl__spinner {
	display: inline-block;
}

@keyframes asc-nl-spin {

	to {
		transform: rotate(360deg);
	}
}

/* Must win over every display rule above. */
.asc-nl [hidden] {
	display: none !important;
}

/* ---------- Breakpoints ---------- */

@media (min-width: 600px) {

	.asc-nl .asc-nl__card {
		padding: var(--asc-nl-s6);
	}

	.asc-nl .asc-nl__actions {
		align-items: flex-start;
	}

	.asc-nl .asc-nl__btn {
		width: auto;
		min-width: 200px;
	}
}

@media (min-width: 768px) {

	.asc-nl {
		padding: var(--asc-nl-s9) 0;
	}

	.asc-nl .asc-nl__wrap {
		padding: 0 var(--asc-nl-s7);
	}
}

@media (min-width: 1024px) {

	.asc-nl .asc-nl__card {
		grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
		gap: var(--asc-nl-s8);
		align-items: start;
		padding: var(--asc-nl-s7);
	}
}

/* ---------- User preferences ---------- */

@media (prefers-reduced-motion: reduce) {

	.asc-nl .asc-nl__opt,
	.asc-nl .asc-nl__input,
	.asc-nl .asc-nl__select,
	.asc-nl .asc-nl__btn {
		transition: none;
	}

	.asc-nl .asc-nl__btn:active {
		transform: none;
	}

	.asc-nl .asc-nl__spinner {
		animation: none;
		border-right-color: currentcolor;
		opacity: 0.6;
	}
}

@media (forced-colors: active) {

	.asc-nl .asc-nl__select {
		background-image: none;
		-webkit-appearance: auto;
		appearance: auto;
	}

	.asc-nl .asc-nl__opt:has(.asc-nl__check:checked) {
		outline: 2px solid Highlight;
	}

	.asc-nl .asc-nl__title::before {
		background: CanvasText;
	}
}

@media print {

	.asc-nl {
		display: none;
	}
}
