.am-nl-form {
	--am-nl-accent: var(--e-global-color-primary, #063836);
	display: grid;
	max-width: 560px;
}

/* The fields and the message after a sign-up share one cell, so the form keeps its height
   when one replaces the other and the page around it does not move. */
.am-nl-form__fields,
.am-nl-form__done {
	grid-area: 1 / 1;
}

.am-nl-form__consent {
	margin: 0 0 20px;
}

.am-nl-form__row {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.am-nl-form__label,
.am-nl-form__hp {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

.am-nl-form__input {
	flex: 1 1 220px;
	min-width: 0;
	padding: 12px 14px;
	font-size: 16px;
	border: 1px solid #c9c9c9;
	border-radius: 6px;
}

.am-nl-form .am-nl-form__button {
	flex: 0 0 auto;
	padding: 12px 24px;
	font-size: 16px;
	font-weight: 600;
	color: #fff;
	background: var(--am-nl-accent);
	border: 1px solid var(--am-nl-accent);
	border-radius: 6px;
	cursor: pointer;
}

.am-nl-form .am-nl-form__button:hover {
	color: #fff;
	opacity: 0.9;
}

.am-nl-form .am-nl-form__button:disabled {
	opacity: 0.6;
	cursor: wait;
}

/* A small ring spins in the button while the sign-up is on its way. */
.am-nl-form.is-loading .am-nl-form__button::before {
	content: "";
	display: inline-block;
	width: 14px;
	height: 14px;
	margin-right: 8px;
	vertical-align: -2px;
	border: 2px solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	animation: am-nl-spin 0.7s linear infinite;
}

@keyframes am-nl-spin {
	to {
		transform: rotate(360deg);
	}
}

@media (prefers-reduced-motion: reduce) {
	.am-nl-form.is-loading .am-nl-form__button::before {
		animation: none;
	}
}

.am-nl-form__privacy {
	margin: 8px 0 0;
	font-size: 13px;
}

/* Links follow the form's text colour, so the form also works on dark backgrounds. */
.am-nl-form.am-nl-form a {
	color: inherit;
	text-decoration: underline;
}

.am-nl-form.am-nl-form a:hover {
	color: inherit;
	text-decoration: none;
}

/* Two rings, light and dark, so focus shows on any background. */
.am-nl-form.am-nl-form a:focus-visible,
.am-nl-form .am-nl-form__button:focus-visible,
.am-nl-form .am-nl-form__input:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 0;
	box-shadow: 0 0 0 4px #063836;
}

.am-nl-form.am-nl-form a:focus-visible {
	color: inherit;
	text-decoration: underline;
	border-radius: 2px;
}

.am-nl-nowrap {
	white-space: nowrap;
}

/* The form's own text colour by default, which is already chosen to suit the background. */
.am-nl-form .am-nl-form__error {
	margin: 8px 0 0;
	padding: 0 2px;
	font-size: 15px;
	line-height: 1.4;
	text-align: left;
	color: var(--am-nl-error, inherit);
}

.am-nl-form .am-nl-form__error:empty {
	display: none;
}

.am-nl-form .am-nl-form__input[aria-invalid="true"] {
	border-color: var(--am-nl-error, #b3261e);
}

.am-nl-form__done {
	visibility: hidden;
	opacity: 0;
	align-self: center;
	padding: 20px 24px;
	border: 1px solid currentColor;
	border-radius: 6px;
}

/* Opacity on the wrapper hides the fields at once: themes animate every change on a button,
   which would keep it drawn over the message for the length of that animation. */
.am-nl-form.is-done .am-nl-form__fields {
	visibility: hidden;
	opacity: 0;
	pointer-events: none;
}

.am-nl-form.is-done .am-nl-form__done {
	visibility: visible;
	opacity: 1;
}

.am-nl-form__done:focus {
	outline: none;
}

/* Space only between two paragraphs: the second one is empty and hidden most of the time. */
.am-nl-form .am-nl-form__done p {
	margin: 0;
}

.am-nl-form .am-nl-form__done p + p {
	margin-top: 12px;
}

.am-nl-form .am-nl-form__done p:empty {
	display: none;
}

@media (max-width: 480px) {
	.am-nl-form .am-nl-form__button {
		flex: 1 1 100%;
	}
}

.am-nl-page {
	padding: 64px 16px;
}

.am-nl-page .am-nl-page__title {
	font-size: clamp(32px, 5vw, 48px);
	line-height: 1.15;
}

.am-nl-page__inner {
	max-width: 640px;
	margin: 0 auto;
	text-align: center;
}

.am-nl-page a:not(.am-nl-button) {
	text-decoration: underline;
}

.am-nl-page a:not(.am-nl-button):hover {
	text-decoration: none;
}

/* While the confirmation page sends itself, its message stays out of sight, so the person
   sees the thank-you page instead of a text that changes a moment later. */
.am-nl-confirming .am-nl-message,
.am-nl-confirming .am-nl-page__inner {
	visibility: hidden;
}

/* The same message inside an Elementor template: spacing and colours come from the template. */
.am-nl-message {
	text-align: center;
}

.am-nl-message .am-nl-page__title {
	margin: 0 0 24px;
}

.am-nl-message p:last-child {
	margin-bottom: 0;
}

.am-nl-message a:not(.am-nl-button) {
	color: inherit;
	text-decoration: underline;
}

.am-nl-message a:not(.am-nl-button):hover {
	color: inherit;
	text-decoration: none;
}

.am-nl-page__note {
	margin-top: 24px;
	font-size: 14px;
	opacity: 0.8;
}

.am-nl-page .am-nl-button,
.am-nl-button {
	display: inline-block;
	padding: 14px 28px;
	font-weight: 600;
	color: #fff;
	background: var(--e-global-color-primary, #063836);
	border: 1px solid var(--e-global-color-primary, #063836);
	border-radius: 6px;
	text-decoration: none;
	cursor: pointer;
}

.am-nl-page .am-nl-button:hover,
.am-nl-page .am-nl-button:focus,
.am-nl-button:hover,
.am-nl-button:focus {
	color: #fff;
	opacity: 0.9;
}

/* Checkout and My Account */
/* Heavier than WooCommerce's own ".woocommerce form .form-row", which sets margin and padding. */
.woocommerce form .form-row.am-newsletter-consent--checkout {
	margin: 24px 0 8px;
	padding: 22px 3px 3px;
	border-top: 1px solid rgba(0, 0, 0, 0.12);
}

.am-newsletter-consent a {
	text-decoration: underline;
}

.am-newsletter-consent input[type="checkbox"] {
	width: 18px;
	height: 18px;
	vertical-align: middle;
}

.am-newsletter-consent input[type="checkbox"]:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.am-newsletter-account__state {
	font-size: 14px;
	opacity: 0.85;
}

.am-newsletter-account {
	max-width: 640px;
}
