:root {
	--awnl-accent: #2f6fed;
	--awnl-accent-dark: #1d4fd1;
	--awnl-accent-soft: rgba(47, 111, 237, 0.12);
	--awnl-text: #1f2937;
	--awnl-muted: #6b7280;
	--awnl-surface: #ffffff;
	--awnl-border: #e2e8f0;
	--awnl-radius: 20px;
}

/* Standalone button (shortcode / classic widget) */
.awnl-subscribe-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: linear-gradient(135deg, var(--awnl-accent), var(--awnl-accent-dark));
	color: #fff;
	border: none;
	border-radius: 999px;
	padding: 10px 20px;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	transition: transform 0.18s ease, box-shadow 0.18s ease;
	box-shadow: 0 6px 16px rgba(47, 111, 237, 0.28);
}

.awnl-subscribe-btn:hover,
.awnl-subscribe-btn:focus-visible {
	transform: translateY(-1px);
	box-shadow: 0 10px 22px rgba(47, 111, 237, 0.35);
	outline: none;
}

.awnl-subscribe-btn__icon {
	display: inline-flex;
}

.awnl-subscribe-btn__icon svg {
	display: block;
}

/* Overlay */
.awnl-modal-overlay {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(15, 23, 42, 0.55);
	backdrop-filter: blur(4px);
	padding: 20px;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.25s ease;
}

.awnl-modal-overlay.is-open {
	opacity: 1;
	visibility: visible;
}

.awnl-modal-overlay[hidden] {
	display: none;
}

.awnl-modal {
	position: relative;
	width: 100%;
	max-width: 440px;
	max-height: calc(100vh - 40px);
	overflow-y: auto;
	background: var(--awnl-surface);
	border-radius: var(--awnl-radius);
	padding: 40px 32px 32px;
	box-shadow: 0 30px 60px rgba(15, 23, 42, 0.35);
	transform: translateY(16px) scale(0.98);
	transition: transform 0.25s ease;
	font-family: inherit;
}

.awnl-modal-overlay.is-open .awnl-modal {
	transform: translateY(0) scale(1);
}

.awnl-modal__close {
	position: absolute;
	top: 14px;
	right: 14px;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	border: none;
	background: #f1f5f9;
	color: var(--awnl-muted);
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.15s ease, color 0.15s ease;
}

.awnl-modal__close:hover {
	background: #e2e8f0;
	color: var(--awnl-text);
}

.awnl-modal__icon {
	width: 64px;
	height: 64px;
	border-radius: 50%;
	background: var(--awnl-accent-soft);
	color: var(--awnl-accent);
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0 auto 20px;
}

.awnl-modal__icon--success {
	background: rgba(34, 197, 94, 0.12);
	color: #16a34a;
}

.awnl-modal__title {
	margin: 0 0 10px;
	font-size: 22px;
	font-weight: 700;
	text-align: center;
	color: var(--awnl-text);
	line-height: 1.3;
}

.awnl-modal__subtitle {
	margin: 0 0 24px;
	font-size: 14px;
	line-height: 1.6;
	text-align: center;
	color: var(--awnl-muted);
}

.awnl-modal__form {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.awnl-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
	text-align: left;
}

.awnl-field__label {
	font-size: 13px;
	font-weight: 600;
	color: var(--awnl-text);
}

.awnl-field input {
	padding: 12px 14px;
	border: 1.5px solid var(--awnl-border);
	border-radius: 12px;
	font-size: 14px;
	color: var(--awnl-text);
	background: #fff;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.awnl-field input:focus {
	outline: none;
	border-color: var(--awnl-accent);
	box-shadow: 0 0 0 3px var(--awnl-accent-soft);
}

.awnl-field input.is-invalid {
	border-color: #ef4444;
}

.awnl-hp-field {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	opacity: 0;
}

.awnl-modal__error {
	margin: -6px 0 0;
	color: #dc2626;
	font-size: 13px;
	min-height: 1px;
}

.awnl-modal__error:empty {
	display: none;
}

.awnl-modal__submit {
	background: linear-gradient(135deg, var(--awnl-accent), var(--awnl-accent-dark));
	color: #fff;
	border: none;
	border-radius: 12px;
	padding: 14px;
	font-size: 15px;
	font-weight: 700;
	cursor: pointer;
	transition: opacity 0.15s ease, transform 0.15s ease;
}

.awnl-modal__submit:hover {
	transform: translateY(-1px);
}

.awnl-modal__submit:disabled {
	opacity: 0.65;
	cursor: not-allowed;
	transform: none;
}

.awnl-modal__privacy {
	margin: 4px 0 0;
	font-size: 12px;
	line-height: 1.6;
	color: var(--awnl-muted);
	text-align: center;
}

.awnl-modal__success {
	text-align: center;
}

.awnl-modal__success .awnl-modal__submit {
	margin-top: 8px;
}

/* Mobile: bottom sheet */
@media (max-width: 600px) {
	.awnl-modal-overlay {
		align-items: flex-end;
		padding: 0;
	}

	.awnl-modal {
		max-width: 100%;
		width: 100%;
		border-radius: 20px 20px 0 0;
		padding: 32px 20px calc(24px + env(safe-area-inset-bottom));
		max-height: 88vh;
		transform: translateY(100%);
	}

	.awnl-modal-overlay.is-open .awnl-modal {
		transform: translateY(0);
	}
}

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

/* Dark mode (Blogsy sets <html scheme="dark">) */
html[scheme="dark"] .awnl-modal {
	background: #111827;
}

html[scheme="dark"] .awnl-modal__title {
	color: #f9fafb;
}

html[scheme="dark"] .awnl-modal__subtitle,
html[scheme="dark"] .awnl-modal__privacy {
	color: #9ca3af;
}

html[scheme="dark"] .awnl-field__label {
	color: #e5e7eb;
}

html[scheme="dark"] .awnl-field input {
	background: #1f2937;
	border-color: #374151;
	color: #f3f4f6;
}

html[scheme="dark"] .awnl-modal__close {
	background: #1f2937;
	color: #9ca3af;
}

html[scheme="dark"] .awnl-modal__close:hover {
	background: #374151;
	color: #f3f4f6;
}
