/**
 * LymLyt capture form.
 *
 * Deliberately restrained. This has to sit inside whatever theme the site
 * runs, so it inherits fonts and uses custom properties that a theme or a
 * child stylesheet can override without fighting specificity.
 */

.lymlyt-form {
	--lymlyt-bg: #ffffff;
	--lymlyt-fg: #1c1c1a;
	--lymlyt-muted: #6b6b64;
	--lymlyt-border: #d9d9d2;
	--lymlyt-accent: #1c1c1a;
	--lymlyt-accent-fg: #ffffff;
	--lymlyt-error: #a4231f;
	--lymlyt-success: #1f6b45;
	--lymlyt-radius: 10px;

	background: var(--lymlyt-bg);
	color: var(--lymlyt-fg);
	border: 1px solid var(--lymlyt-border);
	border-radius: var(--lymlyt-radius);
	padding: 1.5rem;
	max-width: 34rem;
}

.lymlyt-form__headline {
	margin: 0 0 0.5rem;
	font-size: 1.35rem;
	line-height: 1.25;
}

.lymlyt-form__body {
	margin: 0 0 1rem;
	color: var(--lymlyt-muted);
}

.lymlyt-form__body p:last-child {
	margin-bottom: 0;
}

.lymlyt-form__field {
	margin-bottom: 0.85rem;
}

.lymlyt-form__label {
	display: block;
	margin-bottom: 0.3rem;
	font-size: 0.9rem;
	font-weight: 600;
}

.lymlyt-form__optional {
	font-weight: 400;
	color: var(--lymlyt-muted);
}

.lymlyt-form__input {
	width: 100%;
	box-sizing: border-box;
	padding: 0.7rem 0.8rem;
	font: inherit;
	color: inherit;
	background: var(--lymlyt-bg);
	border: 1px solid var(--lymlyt-border);
	border-radius: calc(var(--lymlyt-radius) - 4px);
}

.lymlyt-form__input:focus {
	outline: 2px solid var(--lymlyt-accent);
	outline-offset: 1px;
}

.lymlyt-form__button {
	display: inline-block;
	width: 100%;
	padding: 0.8rem 1.2rem;
	font: inherit;
	font-weight: 600;
	color: var(--lymlyt-accent-fg);
	background: var(--lymlyt-accent);
	border: 0;
	border-radius: calc(var(--lymlyt-radius) - 4px);
	cursor: pointer;
}

.lymlyt-form__button[disabled] {
	opacity: 0.6;
	cursor: progress;
}

.lymlyt-form__consent {
	margin: 0.75rem 0 0;
	font-size: 0.8rem;
	line-height: 1.45;
	color: var(--lymlyt-muted);
}

.lymlyt-form__error {
	margin: 0.75rem 0 0;
	font-size: 0.9rem;
	color: var(--lymlyt-error);
}

.lymlyt-form__notice {
	margin: 0 0 1rem;
	padding: 0.7rem 0.9rem;
	border-radius: calc(var(--lymlyt-radius) - 4px);
	font-size: 0.95rem;
}

.lymlyt-form__notice--success {
	color: var(--lymlyt-success);
	background: rgba(31, 107, 69, 0.08);
}

.lymlyt-form__notice--error {
	color: var(--lymlyt-error);
	background: rgba(164, 35, 31, 0.08);
}

.lymlyt-form__success:focus {
	outline: none;
}

/*
 * The honeypot. Off screen rather than display:none or hidden, because those
 * two are exactly what a spam script checks for before deciding to skip a
 * field. Screen readers are kept out with aria-hidden on the wrapper and
 * tabindex="-1" on the input, both set in the markup.
 */
.lymlyt-form__hp {
	position: absolute !important;
	left: -9999px !important;
	top: auto;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.lymlyt-form__admin-note {
	padding: 0.75rem 1rem;
	border-left: 3px solid #a4231f;
	background: #fdf2f2;
	color: #a4231f;
	font-size: 0.9rem;
}

/* Confirm and unsubscribe result blocks. */
.lymlyt-result {
	margin: 0 0 1.5rem;
	padding: 1.25rem 1.5rem;
	border: 1px solid #d9d9d2;
	border-radius: 10px;
	background: #fbfbf8;
}

.lymlyt-result--confirmed {
	border-color: rgba(31, 107, 69, 0.35);
}

.lymlyt-result--invalid {
	border-color: rgba(164, 35, 31, 0.35);
}

.lymlyt-result__heading {
	margin: 0 0 0.35rem;
	font-size: 1.25rem;
}

.lymlyt-result__body {
	margin: 0;
}

/* ---------------------------------------------------------------------------
 * Automatic placements: the sticky bar and the exit popup.
 *
 * Both are printed into the page hidden and revealed by script. The explicit
 * [hidden] rules below matter: this file gives these elements a display value,
 * and that would otherwise beat the browser's own styling for the hidden
 * attribute, leaving them permanently on screen.
 * ------------------------------------------------------------------------ */

.lymlyt-sticky[hidden],
.lymlyt-modal[hidden] {
	display: none !important;
}

.lymlyt-sticky {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 9998;
	display: block;
	padding: 0.85rem 1rem;
	background: #ffffff;
	border-top: 1px solid #d9d9d2;
	box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.08);
	transform: translateY(100%);
	transition: transform 0.25s ease;
}

.lymlyt-sticky.is-visible {
	transform: translateY(0);
}

.lymlyt-sticky__inner {
	position: relative;
	max-width: 44rem;
	margin: 0 auto;
	padding-right: 2rem;
}

.lymlyt-modal {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
	opacity: 0;
	transition: opacity 0.2s ease;
}

.lymlyt-modal.is-visible {
	opacity: 1;
}

.lymlyt-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(28, 28, 26, 0.55);
}

.lymlyt-modal__panel {
	position: relative;
	width: 100%;
	max-width: 30rem;
	max-height: 90vh;
	overflow-y: auto;
	background: #ffffff;
	border-radius: 14px;
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
}

.lymlyt-modal__panel:focus {
	outline: none;
}

/*
 * The form supplies its own frame, which would be a second border inside the
 * bar or the panel. Inside these two it drops back to being just content.
 */
.lymlyt-sticky .lymlyt-form,
.lymlyt-modal .lymlyt-form {
	max-width: none;
	border: 0;
	background: transparent;
}

.lymlyt-sticky .lymlyt-form {
	padding: 0;
}

.lymlyt-sticky .lymlyt-form__headline {
	font-size: 1.05rem;
}

.lymlyt-sticky .lymlyt-form__body,
.lymlyt-sticky .lymlyt-form__consent {
	display: none;
}

.lymlyt-auto__close {
	position: absolute;
	top: 0.4rem;
	right: 0.4rem;
	width: 2rem;
	height: 2rem;
	padding: 0;
	font-size: 1.4rem;
	line-height: 1;
	color: var(--lymlyt-muted, #6b6b64);
	background: transparent;
	border: 0;
	border-radius: 50%;
	cursor: pointer;
}

.lymlyt-auto__close:hover,
.lymlyt-auto__close:focus {
	background: rgba(0, 0, 0, 0.06);
}

/* On a wide screen the sticky bar reads better as one row. */
@media (min-width: 48em) {
	.lymlyt-sticky .lymlyt-form__form {
		display: flex;
		flex-wrap: wrap;
		align-items: flex-end;
		gap: 0.6rem;
	}

	.lymlyt-sticky .lymlyt-form__field {
		flex: 1 1 12rem;
		margin-bottom: 0;
	}

	.lymlyt-sticky .lymlyt-form__button {
		width: auto;
		flex: 0 0 auto;
	}

	.lymlyt-sticky .lymlyt-form__error {
		flex: 1 1 100%;
		margin-top: 0.4rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.lymlyt-sticky,
	.lymlyt-modal {
		transition: none;
	}
}
