/* ==========================================================================
   KS Designs Marketing Automation Pro — popup & inline form styles
   Three themes: classic, gifting, love
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
	--ksdmap-brand: #6d28d9;
	--ksdmap-accent: #ec4899;
	--ksdmap-ink: #14121a;
	--ksdmap-muted: #6b6675;
	--ksdmap-surface: rgba(255, 255, 255, 0.72);
	--ksdmap-border: rgba(20, 18, 26, 0.10);
	--ksdmap-font-display: 'Fraunces', Georgia, serif;
	--ksdmap-font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
	--ksdmap-radius: 22px;
	--ksdmap-shadow: 0 30px 80px -20px rgba(40, 20, 80, 0.45);
}

@media (prefers-color-scheme: dark) {
	:root {
		--ksdmap-ink: #f4f1fb;
		--ksdmap-muted: #a59fb5;
		--ksdmap-surface: rgba(28, 24, 38, 0.78);
		--ksdmap-border: rgba(255, 255, 255, 0.10);
	}
}

/* ---------- Overlay ---------- */
.ksdmap-overlay {
	position: fixed; inset: 0; z-index: 999999;
	display: flex; align-items: center; justify-content: center; padding: 20px;
	background: radial-gradient(120% 120% at 50% 0%, rgba(109, 40, 217, 0.28), rgba(10, 6, 20, 0.55));
	backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
	opacity: 0; transition: opacity .4s ease;
}
.ksdmap-overlay.is-open { opacity: 1; }

/* ---------- Card (base) ---------- */
.ksdmap-card {
	position: relative;
	width: 100%; max-width: 440px;
	background: var(--ksdmap-surface);
	border: 1px solid var(--ksdmap-border);
	border-radius: var(--ksdmap-radius);
	box-shadow: var(--ksdmap-shadow);
	backdrop-filter: blur(24px) saturate(140%); -webkit-backdrop-filter: blur(24px) saturate(140%);
	padding: 38px 34px 32px;
	font-family: var(--ksdmap-font-body); color: var(--ksdmap-ink);
	transform: translateY(24px) scale(.96); opacity: 0;
	transition: transform .5s cubic-bezier(.16, 1, .3, 1), opacity .5s ease;
	overflow: hidden;
}
.ksdmap-overlay.is-open .ksdmap-card { transform: translateY(0) scale(1); opacity: 1; }

/* Soft animated gradient halo */
.ksdmap-card::before {
	content: ''; position: absolute; top: -60%; left: -20%; width: 140%; height: 120%;
	background: conic-gradient(from 90deg, var(--ksdmap-brand), var(--ksdmap-accent), var(--ksdmap-brand));
	filter: blur(60px); opacity: .18;
	animation: ksdmap-spin 14s linear infinite; pointer-events: none;
}
@keyframes ksdmap-spin { to { transform: rotate(360deg); } }

/* ---------- THEMES ---------- */
/* CLASSIC = default (no overrides needed) */

/* GIFTING — warm gold + rose with floating gift emoji */
.ksdmap-card[data-theme="gifting"] {
	--ksdmap-brand: #d4881f;
	--ksdmap-accent: #c2410c;
	background: linear-gradient(160deg, rgba(255, 248, 235, 0.92), rgba(254, 231, 204, 0.88));
	border-color: rgba(212, 136, 31, 0.25);
}
@media (prefers-color-scheme: dark) {
	.ksdmap-card[data-theme="gifting"] {
		background: linear-gradient(160deg, rgba(60, 38, 18, 0.88), rgba(78, 35, 16, 0.85));
	}
}
.ksdmap-deco-gifting {
	position: absolute; top: -20px; right: -10px; font-size: 90px;
	transform: rotate(18deg); opacity: .9; pointer-events: none; z-index: 2;
	filter: drop-shadow(0 6px 14px rgba(194, 65, 12, 0.35));
	animation: ksdmap-bob 4s ease-in-out infinite;
}
@keyframes ksdmap-bob { 0%,100% { transform: rotate(18deg) translateY(0); } 50% { transform: rotate(14deg) translateY(-6px); } }

/* LOVE INVITATION — romantic red/pink with floating hearts */
.ksdmap-card[data-theme="love"] {
	--ksdmap-brand: #e11d48;
	--ksdmap-accent: #f472b6;
	background: linear-gradient(160deg, rgba(255, 235, 240, 0.92), rgba(255, 215, 230, 0.88));
	border-color: rgba(225, 29, 72, 0.22);
}
@media (prefers-color-scheme: dark) {
	.ksdmap-card[data-theme="love"] {
		background: linear-gradient(160deg, rgba(68, 16, 30, 0.9), rgba(86, 22, 50, 0.86));
	}
}
.ksdmap-deco-love {
	position: absolute; top: -10px; right: 16px; pointer-events: none; z-index: 2;
}
.ksdmap-deco-love span {
	display: block; line-height: 1;
	filter: drop-shadow(0 4px 10px rgba(225, 29, 72, 0.4));
}
.ksdmap-deco-love span:nth-child(1) {
	font-size: 60px; animation: ksdmap-float 3.5s ease-in-out infinite;
}
.ksdmap-deco-love span:nth-child(2) {
	font-size: 32px; margin-top: -10px; margin-left: 36px;
	animation: ksdmap-float 4.5s ease-in-out infinite 0.5s;
}
@keyframes ksdmap-float {
	0%, 100% { transform: translateY(0) rotate(-6deg); }
	50%      { transform: translateY(-10px) rotate(4deg); }
}

/* ---------- Card content ---------- */
.ksdmap-logo { max-height: 40px; margin-bottom: 18px; position: relative; z-index: 1; }

.ksdmap-card h2 {
	font-family: var(--ksdmap-font-display);
	font-weight: 600; font-size: 1.72rem; line-height: 1.12; letter-spacing: -.01em;
	margin: 0 0 10px; color: var(--ksdmap-ink); position: relative; z-index: 1;
}
.ksdmap-card p.ksdmap-sub {
	margin: 0 0 22px; color: var(--ksdmap-muted);
	font-size: .98rem; line-height: 1.5; position: relative; z-index: 1;
}

/* ---------- Fields ---------- */
.ksdmap-field { margin-bottom: 12px; position: relative; z-index: 1; }
.ksdmap-field input {
	width: 100%; box-sizing: border-box;
	padding: 14px 16px; border: 1px solid var(--ksdmap-border);
	border-radius: 14px; background: rgba(255, 255, 255, 0.55);
	font-family: inherit; font-size: .96rem; color: var(--ksdmap-ink);
	transition: border-color .2s, box-shadow .2s, background .2s;
}
@media (prefers-color-scheme: dark) {
	.ksdmap-field input { background: rgba(255, 255, 255, 0.06); }
}
.ksdmap-field input:focus {
	outline: none; border-color: var(--ksdmap-brand);
	box-shadow: 0 0 0 4px color-mix(in srgb, var(--ksdmap-brand) 22%, transparent);
}
.ksdmap-field input::placeholder { color: var(--ksdmap-muted); opacity: .8; }

.ksdmap-consent {
	display: flex; gap: 9px; align-items: flex-start;
	margin: 6px 0 18px; font-size: .8rem; color: var(--ksdmap-muted); line-height: 1.45;
	position: relative; z-index: 1;
}
.ksdmap-consent input { margin-top: 2px; accent-color: var(--ksdmap-brand); }

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

/* ---------- Button ---------- */
.ksdmap-btn {
	position: relative; z-index: 1;
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	width: 100%; padding: 15px 20px; border: none; border-radius: 14px;
	font-family: var(--ksdmap-font-body); font-weight: 700; font-size: 1rem; color: #fff;
	cursor: pointer;
	background: linear-gradient(120deg, var(--ksdmap-brand), var(--ksdmap-accent));
	background-size: 180% 180%;
	box-shadow: 0 12px 30px -8px color-mix(in srgb, var(--ksdmap-brand) 60%, transparent);
	transition: transform .18s ease, box-shadow .25s ease, background-position .6s ease;
}
.ksdmap-btn:hover { transform: translateY(-2px); background-position: 100% 0; box-shadow: 0 18px 40px -10px color-mix(in srgb, var(--ksdmap-accent) 55%, transparent); }
.ksdmap-btn:active { transform: translateY(0); }
.ksdmap-btn[disabled] { opacity: .65; cursor: progress; transform: none; }
.ksdmap-btn-sm { width: auto; padding: 10px 18px; font-size: .9rem; border-radius: 11px; }

/* ---------- Close ---------- */
.ksdmap-close {
	position: absolute; top: 14px; right: 14px;
	width: 34px; height: 34px; border: none; border-radius: 50%;
	background: rgba(0, 0, 0, 0.06); color: var(--ksdmap-ink);
	font-size: 18px; line-height: 1; cursor: pointer;
	transition: background .2s, transform .2s; z-index: 3;
}
.ksdmap-close:hover { background: rgba(0, 0, 0, 0.12); transform: rotate(90deg); }

.ksdmap-msg { margin: 12px 0 0; font-size: .85rem; min-height: 1em; position: relative; z-index: 1; }
.ksdmap-msg.is-error { color: #e11d48; }

/* ---------- Success state ---------- */
.ksdmap-success { text-align: center; padding: 14px 0 4px; position: relative; z-index: 1; }
.ksdmap-check {
	width: 78px; height: 78px; margin: 0 auto 18px; border-radius: 50%;
	background: linear-gradient(120deg, var(--ksdmap-brand), var(--ksdmap-accent));
	display: flex; align-items: center; justify-content: center;
	animation: ksdmap-pop .55s cubic-bezier(.16, 1, .3, 1) both;
}
.ksdmap-check svg { width: 38px; height: 38px; stroke: #fff; stroke-width: 4; fill: none; }
.ksdmap-check path { stroke-dasharray: 48; stroke-dashoffset: 48; animation: ksdmap-draw .5s .25s ease forwards; }
.ksdmap-coupon-code {
	display: inline-block; margin-top: 8px; padding: 12px 20px;
	font-family: var(--ksdmap-font-display); font-size: 1.3rem; letter-spacing: .12em;
	border: 2px dashed var(--ksdmap-brand); border-radius: 12px; color: var(--ksdmap-brand);
}
@keyframes ksdmap-pop { from { transform: scale(0); } to { transform: scale(1); } }
@keyframes ksdmap-draw { to { stroke-dashoffset: 0; } }

/* ---------- Inline shortcode form ---------- */
.ksdmap-inline-form {
	max-width: 520px; margin: 24px auto; padding: 30px;
	background: var(--ksdmap-surface); border: 1px solid var(--ksdmap-border);
	border-radius: var(--ksdmap-radius); backdrop-filter: blur(18px);
	font-family: var(--ksdmap-font-body); color: var(--ksdmap-ink);
}
.ksdmap-inline-heading { font-family: var(--ksdmap-font-display); font-weight: 600; margin: 0 0 16px; }
.ksdmap-inline-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.ksdmap-inline-row input { flex: 1 1 180px; padding: 13px 15px; border-radius: 12px; border: 1px solid var(--ksdmap-border); font-family: inherit; }
.ksdmap-inline-msg { font-size: .85rem; margin: 10px 0 0; }

/* ---------- Banner + CTA ---------- */
.ksdmap-offer-banner {
	display: flex; align-items: center; justify-content: center; gap: 18px; flex-wrap: wrap;
	padding: 14px 20px; border-radius: 16px; font-family: var(--ksdmap-font-body); font-weight: 600;
	color: #fff; background: linear-gradient(120deg, var(--ksdmap-brand), var(--ksdmap-accent));
}
.ksdmap-cta-section {
	text-align: center; padding: 56px 24px; border-radius: 28px; font-family: var(--ksdmap-font-body);
	background: radial-gradient(120% 120% at 50% 0%, color-mix(in srgb, var(--ksdmap-brand) 14%, transparent), transparent);
}
.ksdmap-cta-section h2 { font-family: var(--ksdmap-font-display); font-size: 2.1rem; margin: 0 0 12px; }
.ksdmap-cta-section p { color: var(--ksdmap-muted); margin: 0 0 22px; }
.ksdmap-cta-section .ksdmap-btn { width: auto; padding: 14px 34px; }

@media (max-width: 480px) {
	.ksdmap-card { padding: 30px 22px 26px; }
	.ksdmap-card h2 { font-size: 1.45rem; }
	.ksdmap-deco-gifting { font-size: 70px; top: -16px; right: -8px; }
	.ksdmap-deco-love span:nth-child(1) { font-size: 48px; }
	.ksdmap-deco-love span:nth-child(2) { font-size: 26px; }
}
