/**
 * Public-facing styles for NewGenCMS Newsletter Popup.
 *
 * @package NewgencmsNewsletterPopup
 * @since   1.0.0
 */

/* ──────────────────────────────────────────────
   Popup Overlay
   ────────────────────────────────────────────── */

.sn-popup-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(15, 23, 42, 0.6);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	z-index: 999999;
	display: none;
	align-items: center;
	justify-content: center;
	opacity: 0;
	transition: opacity 0.3s ease;
	padding: 20px;
	box-sizing: border-box;
}

.sn-popup-overlay.sn-popup-visible {
	display: flex;
	opacity: 1;
}

/* ──────────────────────────────────────────────
   Popup Card
   ────────────────────────────────────────────── */

.sn-popup-card {
	background: #ffffff;
	border-radius: 16px;
	box-shadow:
		0 25px 60px rgba(0, 0, 0, 0.15),
		0 10px 25px rgba(0, 0, 0, 0.08);
	padding: 40px;
	max-width: 440px;
	width: 100%;
	position: relative;
	text-align: center;
	transform: scale(0.9) translateY(20px);
	transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
	opacity: 0;
	animation: none;
}

.sn-popup-visible .sn-popup-card {
	transform: scale(1) translateY(0);
	opacity: 1;
}

/* Decorative gradient bar */
.sn-popup-card::before {
	content: "";
	position: absolute;
	top: 0;
	left: 50%;
	transform: translateX(-50%);
	width: 60px;
	height: 4px;
	background: linear-gradient(135deg, #6366f1, #a855f7);
	border-radius: 0 0 4px 4px;
}

/* ──────────────────────────────────────────────
   Close Button
   ────────────────────────────────────────────── */

.sn-popup-close {
	position: absolute;
	top: 14px;
	right: 14px;
	width: 32px;
	height: 32px;
	border: none;
	background: #f1f5f9;
	border-radius: 50%;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s ease, transform 0.2s ease;
	padding: 0;
	font-size: 0;
	line-height: 1;
}

.sn-popup-close:hover {
	background: #e2e8f0;
	transform: rotate(90deg);
}

.sn-popup-close svg {
	width: 14px;
	height: 14px;
	stroke: #64748b;
	stroke-width: 2;
	fill: none;
}

/* ──────────────────────────────────────────────
   Content
   ────────────────────────────────────────────── */

.sn-popup-icon {
	width: 56px;
	height: 56px;
	background: linear-gradient(135deg, #eef2ff, #e0e7ff);
	border-radius: 14px;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0 auto 20px;
}

.sn-popup-icon svg {
	width: 28px;
	height: 28px;
	fill: none;
	stroke: #6366f1;
	stroke-width: 1.5;
}

.sn-popup-title {
	margin: 0 0 10px;
	line-height: 1.3;
	font-weight: 700;
	word-wrap: break-word;
}

.sn-popup-description {
	margin: 0 0 24px;
	line-height: 1.6;
	word-wrap: break-word;
}

/* ──────────────────────────────────────────────
   Form
   ────────────────────────────────────────────── */

.sn-popup-form {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.sn-popup-input {
	width: 100%;
	box-sizing: border-box;
	border: 2px solid #e2e8f0;
	border-radius: 10px;
	padding: 14px 18px;
	font-size: 15px;
	color: #1e293b;
	background: #f8fafc;
	transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
	outline: none;
	font-family: inherit;
}

.sn-popup-input:focus {
	border-color: #6366f1;
	box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
	background: #ffffff;
}

.sn-popup-input.sn-input-error {
	border-color: #ef4444;
	box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

.sn-popup-input::placeholder {
	color: #94a3b8;
}

.sn-popup-submit {
	width: 100%;
	border: none;
	border-radius: 10px;
	padding: 14px 24px;
	font-weight: 700;
	cursor: pointer;
	transition: opacity 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
	font-family: inherit;
	letter-spacing: 0.3px;
}

.sn-popup-submit:hover {
	opacity: 0.92;
	transform: translateY(-1px);
	box-shadow: 0 6px 20px rgba(99, 102, 241, 0.3);
}

.sn-popup-submit:active {
	transform: translateY(0);
}

.sn-popup-submit:disabled {
	opacity: 0.6;
	cursor: not-allowed;
	transform: none;
	box-shadow: none;
}

/* ──────────────────────────────────────────────
   Messages
   ────────────────────────────────────────────── */

.sn-popup-message {
	font-size: 13px;
	margin-top: 4px;
	display: none;
	border-radius: 8px;
	padding: 10px 14px;
	text-align: center;
}

.sn-popup-message.sn-msg-error {
	display: block;
	background: #fef2f2;
	color: #dc2626;
	border: 1px solid #fecaca;
}

.sn-popup-message.sn-msg-success {
	display: block;
	background: #ecfdf5;
	color: #059669;
	border: 1px solid #a7f3d0;
}

/* ──────────────────────────────────────────────
   Success State
   ────────────────────────────────────────────── */

.sn-popup-success-state {
	display: none;
	text-align: center;
	padding: 10px 0;
}

.sn-popup-success-state .sn-success-icon {
	width: 64px;
	height: 64px;
	background: linear-gradient(135deg, #ecfdf5, #d1fae5);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0 auto 16px;
}

.sn-popup-success-state .sn-success-icon svg {
	width: 32px;
	height: 32px;
	stroke: #059669;
	stroke-width: 2.5;
	fill: none;
}

.sn-popup-success-state h3 {
	font-size: 20px;
	color: #1e293b;
	margin: 0 0 8px;
	font-weight: 700;
}

.sn-popup-success-state p {
	font-size: 14px;
	color: #64748b;
	margin: 0;
	line-height: 1.5;
}

/* ──────────────────────────────────────────────
   Privacy Text
   ────────────────────────────────────────────── */

.sn-popup-privacy {
	font-size: 11px;
	color: #94a3b8;
	margin-top: 12px;
	line-height: 1.4;
}

/* ──────────────────────────────────────────────
   Loading Spinner
   ────────────────────────────────────────────── */

.sn-spinner {
	display: inline-block;
	width: 18px;
	height: 18px;
	border: 2px solid rgba(255, 255, 255, 0.3);
	border-radius: 50%;
	border-top-color: #ffffff;
	animation: sn-spin 0.6s linear infinite;
	vertical-align: middle;
	margin-right: 6px;
}

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

/* ──────────────────────────────────────────────
   Responsive
   ────────────────────────────────────────────── */

@media (max-width: 480px) {
	.sn-popup-card {
		padding: 28px 24px;
		margin: 16px;
	}

	.sn-popup-title {
		font-size: 20px !important;
	}

	.sn-popup-input {
		padding: 12px 14px;
		font-size: 14px;
	}

	.sn-popup-submit {
		padding: 12px 20px;
	}
}
