/*
 * Annette Quiz — Free Meditation lead-magnet popup
 * Self-contained: does NOT rely on quiz-page CSS vars (which are only injected
 * where the [annette_quiz] shortcode runs). Brand-locked to warm earth tones
 * matching annettepaterakis.com. Accent color is themable via --aq-med-accent.
 */

.aq-med-popup {
	--aq-med-accent: #B48748;
	--aq-med-accent-hover: #705547;
	--aq-med-bg: #FFFFFF;
	--aq-med-text: #3D2F26;
	--aq-med-text-muted: #7A6F66;
	--aq-med-border: #E9E1D6;
	--aq-med-warm: #FAF8F5;

	position: fixed;
	inset: 0;
	z-index: 100000;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 16px;
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
	color: var(--aq-med-text);
}

/* Contain box-sizing + reset theme margins for everything inside the popup —
   themes like Showit / block themes commonly add padding to form elements or
   set max-width on buttons, which throws the internal alignment off. */
.aq-med-popup, .aq-med-popup *, .aq-med-popup *::before, .aq-med-popup *::after {
	box-sizing: border-box;
}

.aq-med-popup.is-open {
	display: flex;
}

.aq-med-popup__overlay {
	position: absolute;
	inset: 0;
	background: rgba(61, 47, 38, 0.55);
	backdrop-filter: blur(3px);
	-webkit-backdrop-filter: blur(3px);
	animation: aq-med-fade 220ms ease both;
}

.aq-med-popup__card {
	position: relative;
	width: 100%;
	max-width: 460px;
	background: var(--aq-med-bg);
	border-radius: 20px;
	box-shadow: 0 30px 80px rgba(61, 47, 38, 0.35);
	overflow: hidden;
	animation: aq-med-rise 320ms cubic-bezier(0.22, 1, 0.36, 1) both;
	max-height: calc(100vh - 32px);
	overflow-y: auto;
}

.aq-med-popup__close {
	position: absolute;
	top: 12px;
	right: 12px;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.9);
	border: 1px solid var(--aq-med-border);
	color: var(--aq-med-text);
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: background 160ms ease, transform 160ms ease;
	z-index: 2;
}

.aq-med-popup__close:hover,
.aq-med-popup__close:focus-visible {
	background: var(--aq-med-warm);
	transform: rotate(90deg);
	outline: none;
}

.aq-med-popup__image {
	width: 100%;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: var(--aq-med-warm);
}

.aq-med-popup__image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.aq-med-popup__content {
	padding: 26px 24px 24px;
}

.aq-med-popup__headline {
	font-family: 'Instrument Serif', 'Times New Roman', Georgia, serif;
	font-weight: 400;
	font-size: 30px;
	line-height: 1.15;
	letter-spacing: -0.01em;
	color: var(--aq-med-text);
	margin: 0 0 12px;
}

.aq-med-popup__body {
	font-size: 15px;
	line-height: 1.55;
	color: var(--aq-med-text-muted);
	margin: 0 0 18px;
}

.aq-med-popup__form {
	display: flex;
	flex-direction: column;
	gap: 12px;
	position: relative;
	margin: 0;
	padding: 0;
	width: 100%;
}

.aq-med-popup__label {
	display: flex;
	flex-direction: column;
	gap: 6px;
	font-size: 13px;
	color: var(--aq-med-text-muted);
	margin: 0;
	width: 100%;
}

.aq-med-popup__label span {
	font-weight: 500;
	letter-spacing: 0.01em;
}

.aq-med-popup__label input {
	appearance: none;
	-webkit-appearance: none;
	width: 100%;
	padding: 12px 14px;
	font-size: 15px;
	font-family: inherit;
	color: var(--aq-med-text);
	background: #FFFFFF;
	border: 1px solid var(--aq-med-border);
	border-radius: 10px;
	transition: border-color 160ms ease, box-shadow 160ms ease;
	line-height: 1.3;
}

.aq-med-popup__label input:focus {
	outline: none;
	border-color: var(--aq-med-accent);
	box-shadow: 0 0 0 3px rgba(180, 135, 72, 0.18);
}

.aq-med-popup__consent {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	font-size: 12px;
	color: var(--aq-med-text-muted);
	line-height: 1.5;
	padding-top: 4px;
}

.aq-med-popup__consent input {
	margin-top: 2px;
	accent-color: var(--aq-med-accent);
	flex: 0 0 auto;
}

.aq-med-popup__consent a {
	color: var(--aq-med-accent);
	text-decoration: underline;
}

.aq-med-popup__error {
	color: #b3261e;
	font-size: 13px;
	min-height: 0;
}

.aq-med-popup__error:not(:empty) {
	padding: 6px 0 0;
}

.aq-med-popup__submit {
	appearance: none;
	-webkit-appearance: none;
	background: var(--aq-med-accent);
	color: #FFFFFF;
	border: none;
	border-radius: 999px;
	padding: 14px 22px;
	font-size: 15px;
	font-weight: 600;
	letter-spacing: 0.02em;
	cursor: pointer;
	transition: background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
	box-shadow: 0 8px 22px rgba(180, 135, 72, 0.3);
	margin: 4px 0 0;
	font-family: inherit;
	width: 100%;
	max-width: 100%;
	display: block;
}

.aq-med-popup__submit:hover,
.aq-med-popup__submit:focus-visible {
	background: var(--aq-med-accent-hover);
	transform: translateY(-1px);
	box-shadow: 0 12px 26px rgba(112, 85, 71, 0.35);
	outline: none;
}

.aq-med-popup__submit:disabled {
	opacity: 0.65;
	cursor: wait;
	transform: none;
}

.aq-med-popup__success {
	text-align: center;
	padding: 12px 4px 4px;
}

.aq-med-popup__success-icon {
	color: var(--aq-med-accent);
	background: var(--aq-med-warm);
	width: 72px;
	height: 72px;
	border-radius: 50%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin: 0 auto 14px;
}

.aq-med-popup__success-text {
	font-family: 'Instrument Serif', 'Times New Roman', Georgia, serif;
	font-size: 22px;
	line-height: 1.35;
	color: var(--aq-med-text);
	margin: 0;
}

@keyframes aq-med-fade {
	from { opacity: 0; }
	to   { opacity: 1; }
}

@keyframes aq-med-rise {
	from { opacity: 0; transform: translateY(16px) scale(0.98); }
	to   { opacity: 1; transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
	.aq-med-popup__overlay,
	.aq-med-popup__card {
		animation: none;
	}
	.aq-med-popup__close,
	.aq-med-popup__submit,
	.aq-med-popup__label input {
		transition: none;
	}
}

@media (max-width: 480px) {
	.aq-med-popup {
		padding: 0;
		align-items: flex-end;
	}
	.aq-med-popup__card {
		max-width: 100%;
		border-radius: 20px 20px 0 0;
		max-height: 92vh;
	}
	.aq-med-popup__content {
		padding: 22px 20px 20px;
	}
	.aq-med-popup__headline {
		font-size: 26px;
	}
}
