/**
 * EasyPush opt-in prompt.
 *
 * Scoped hard so it cannot collide with theme styles, and written so the box
 * reads correctly in both light and dark themes without any JS theme sniffing.
 */

.easypush-prompt {
	--easypush-accent: #2563eb;
	--easypush-bg: #ffffff;
	--easypush-fg: #111827;
	--easypush-muted: #4b5563;
	--easypush-border: rgba( 0, 0, 0, 0.08 );

	position: fixed;
	z-index: 999999;
	box-sizing: border-box;
	width: calc( 100% - 32px );
	max-width: 380px;
	padding: 18px;
	border: 1px solid var( --easypush-border );
	border-radius: 14px;
	background: var( --easypush-bg );
	color: var( --easypush-fg );
	box-shadow: 0 12px 40px rgba( 0, 0, 0, 0.16 );
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 14px;
	line-height: 1.5;
	opacity: 0;
	transform: translateY( 12px );
	transition: opacity 220ms ease, transform 220ms ease;
}

.easypush-prompt.is-visible {
	opacity: 1;
	transform: translateY( 0 );
}

.easypush-prompt * {
	box-sizing: border-box;
}

.easypush-prompt--bottom-right {
	right: 16px;
	bottom: 16px;
}

.easypush-prompt--bottom-left {
	left: 16px;
	bottom: 16px;
}

.easypush-prompt--top-bar {
	top: 0;
	left: 0;
	right: 0;
	width: 100%;
	max-width: none;
	border-radius: 0;
	border-width: 0 0 1px;
	transform: translateY( -100% );
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 20px;
	flex-wrap: wrap;
}

.easypush-prompt--top-bar.is-visible {
	transform: translateY( 0 );
}

.easypush-prompt--center {
	top: 50%;
	left: 50%;
	transform: translate( -50%, calc( -50% + 12px ) );
}

.easypush-prompt--center.is-visible {
	transform: translate( -50%, -50% );
}

.easypush-prompt__inner {
	display: flex;
	align-items: flex-start;
	gap: 14px;
}

.easypush-prompt__icon {
	flex: 0 0 auto;
	width: 48px;
	height: 48px;
	border-radius: 10px;
	object-fit: cover;
}

.easypush-prompt__title {
	margin: 0 0 4px;
	font-size: 15px;
	font-weight: 600;
	color: var( --easypush-fg );
}

.easypush-prompt__message {
	margin: 0;
	font-size: 13.5px;
	color: var( --easypush-muted );
}

.easypush-prompt__actions {
	display: flex;
	justify-content: flex-end;
	gap: 10px;
	margin-top: 16px;
}

.easypush-prompt--top-bar .easypush-prompt__actions {
	margin-top: 0;
}

.easypush-prompt__btn {
	appearance: none;
	border: 1px solid transparent;
	border-radius: 8px;
	padding: 9px 18px;
	font: inherit;
	font-size: 13.5px;
	font-weight: 600;
	cursor: pointer;
	transition: filter 120ms ease, background 120ms ease;
}

.easypush-prompt__btn:focus-visible {
	outline: 2px solid var( --easypush-accent );
	outline-offset: 2px;
}

.easypush-prompt__btn--allow {
	background: var( --easypush-accent );
	color: #fff;
}

.easypush-prompt__btn--allow:hover {
	filter: brightness( 1.08 );
}

.easypush-prompt__btn--deny {
	background: transparent;
	color: var( --easypush-muted );
	border-color: var( --easypush-border );
}

.easypush-prompt__btn--deny:hover {
	background: rgba( 0, 0, 0, 0.04 );
}

@media ( prefers-color-scheme: dark ) {
	.easypush-prompt {
		--easypush-bg: #1f2430;
		--easypush-fg: #f3f4f6;
		--easypush-muted: #b6bcc8;
		--easypush-border: rgba( 255, 255, 255, 0.12 );
		box-shadow: 0 12px 40px rgba( 0, 0, 0, 0.5 );
	}

	.easypush-prompt__btn--deny:hover {
		background: rgba( 255, 255, 255, 0.07 );
	}
}

@media ( max-width: 480px ) {
	.easypush-prompt--bottom-right,
	.easypush-prompt--bottom-left {
		left: 16px;
		right: 16px;
		max-width: none;
	}
}

@media ( prefers-reduced-motion: reduce ) {
	.easypush-prompt {
		transition: none;
	}
}

/* ------------------------------------------------------------------
 * Subscribe / unsubscribe controls ([easypush_button], [easypush_link],
 * and the editor block).
 *
 * These inherit the theme's own button and link styling as far as possible —
 * a subscribe button that ignores the site's design looks bolted on, and the
 * site owner should not have to fight our CSS to fix it.
 * ------------------------------------------------------------------ */

.easypush-control[hidden] {
	display: none !important;
}

.easypush-btn {
	--easypush-accent: #2563eb;

	appearance: none;
	display: inline-block;
	border: 1px solid transparent;
	border-radius: 8px;
	padding: 10px 20px;
	background: var( --easypush-accent );
	color: #fff;
	font: inherit;
	font-size: inherit;
	font-weight: 600;
	line-height: 1.4;
	cursor: pointer;
	text-align: center;
	transition: filter 120ms ease, opacity 120ms ease;
}

.easypush-btn:hover:not( [disabled] ) {
	filter: brightness( 1.08 );
}

.easypush-btn:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.easypush-btn[disabled] {
	opacity: 0.6;
	cursor: default;
}

/* Already subscribed: step back visually. Unsubscribing is not the action we
   are encouraging, so it should not be the loudest thing on the page. */
.easypush-btn[data-state="on"] {
	background: transparent;
	color: inherit;
	border-color: currentColor;
	font-weight: 500;
	opacity: 0.85;
}

.easypush-btn[data-state="blocked"] {
	background: transparent;
	color: inherit;
	border-color: currentColor;
	opacity: 0.5;
}

.easypush-link {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 2px;
	cursor: pointer;
}

.easypush-link[data-state="busy"],
.easypush-link[data-state="blocked"] {
	opacity: 0.6;
	cursor: default;
}

.easypush-control__status {
	display: inline-block;
	font-size: 0.875em;
	opacity: 0.75;
	line-height: 1.5;
}

.easypush-control__status:not( :empty ) {
	margin-left: 10px;
}

@media ( max-width: 480px ) {
	.easypush-control__status:not( :empty ) {
		display: block;
		margin: 8px 0 0;
	}
}

@media ( prefers-reduced-motion: reduce ) {
	.easypush-btn {
		transition: none;
	}
}
