/* Varahi Donation Intent – popup (v1.0.3)
   Scoped under #vdi-popup with !important on form controls so theme /
   Elementor global input styles (big heights, margins, shadows) can't leak in. */

#vdi-popup {
	--vdi-navy: #0b2c5f;
	--vdi-navy-2: #12397a;
	--vdi-gold: #d4a537;
	--vdi-cream: #faf6ec;
	--vdi-text: #26303d;
	--vdi-muted: #6b7280;
	--vdi-border: #e3e0d8;
	--vdi-error: #c0392b;
	--vdi-r: 10px;
}

html.vdi-lock, html.vdi-lock body { overflow: hidden !important; }

/* ---------- Overlay ---------- */
#vdi-popup.vdi-overlay {
	position: fixed; inset: 0; z-index: 999999;
	display: flex; align-items: center; justify-content: center;
	padding: 24px;
	background: rgba(8, 18, 38, .6);
	-webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
	opacity: 0; visibility: hidden;
	transition: opacity .22s ease, visibility .22s;
	box-sizing: border-box;
}
#vdi-popup.vdi-overlay.is-open { opacity: 1; visibility: visible; }
#vdi-popup *, #vdi-popup *::before, #vdi-popup *::after { box-sizing: border-box; }

/* ---------- Modal: head / scroll body / sticky foot ---------- */
#vdi-popup .vdi-modal {
	position: relative;
	display: flex; flex-direction: column;
	width: 100%; max-width: 620px;
	max-height: calc(100vh - 48px);
	max-height: calc(100dvh - 48px);
	background: #fff; border-radius: 16px; overflow: hidden;
	box-shadow: 0 30px 70px rgba(0, 0, 0, .28);
	color: var(--vdi-text); font-size: 14px; line-height: 1.45;
	transform: translateY(14px) scale(.985);
	transition: transform .24s cubic-bezier(.2, .8, .2, 1);
}
#vdi-popup.is-open .vdi-modal { transform: none; }

#vdi-popup .vdi-head {
	flex: 0 0 auto;
	display: flex; align-items: center; justify-content: space-between; gap: 16px;
	padding: 18px 22px 16px 26px;
	background: var(--vdi-navy); border-bottom: 3px solid var(--vdi-gold);
}
#vdi-popup .vdi-kicker {
	display: block; margin: 0 0 2px;
	font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--vdi-gold);
}
#vdi-popup .vdi-head h3 {
	margin: 0 !important; padding: 0; color: #fff !important;
	font-size: 21px !important; line-height: 1.25 !important; font-weight: 700;
}
#vdi-popup .vdi-head h3 span { color: var(--vdi-gold); }

#vdi-popup .vdi-close {
	flex: 0 0 auto; display: grid; place-items: center;
	width: 36px !important; height: 36px !important; min-height: 0 !important;
	padding: 0 !important; margin: 0 !important; border: 0 !important; border-radius: 50% !important;
	background: rgba(255, 255, 255, .12) !important; color: #fff !important; cursor: pointer;
	box-shadow: none !important; transition: background .15s;
}
#vdi-popup .vdi-close:hover { background: rgba(255, 255, 255, .25) !important; }

#vdi-popup .vdi-form {
	flex: 1 1 auto; min-height: 0;
	display: flex; flex-direction: column;
	margin: 0; padding: 0;
}

#vdi-popup .vdi-body {
	flex: 1 1 auto; min-height: 0;
	overflow-y: auto; overscroll-behavior: contain;
	padding: 18px 26px 6px;
	/* Hide scrollbar visually – still scrolls on very short screens */
	scrollbar-width: none; -ms-overflow-style: none;
}
#vdi-popup .vdi-body::-webkit-scrollbar { display: none; }

#vdi-popup .vdi-foot {
	flex: 0 0 auto;
	padding: 12px 26px 18px;
	background: #fff; border-top: 1px solid #f0ede6;
}

#vdi-popup .vdi-hp { position: absolute !important; left: -9999px !important; width: 1px !important; height: 1px !important; opacity: 0 !important; }

/* ---------- Fields ---------- */
#vdi-popup .vdi-field { margin: 0 0 12px; }
#vdi-popup .vdi-field label {
	display: block; margin: 0 0 5px !important; padding: 0;
	font-size: 12.5px !important; font-weight: 600; color: var(--vdi-navy) !important; line-height: 1.3;
}
#vdi-popup .vdi-field label i { color: var(--vdi-error); font-style: normal; }
#vdi-popup .vdi-opt { font-weight: 400; color: var(--vdi-muted); }

#vdi-popup input[type="text"],
#vdi-popup input[type="tel"],
#vdi-popup input[type="email"],
#vdi-popup input[type="number"],
#vdi-popup select,
#vdi-popup textarea {
	display: block; width: 100% !important;
	height: 42px !important; min-height: 0 !important;
	margin: 0 !important; padding: 0 12px !important;
	border: 1px solid var(--vdi-border) !important; border-radius: 8px !important;
	background: #fff !important; box-shadow: none !important;
	font: inherit; font-size: 14.5px !important; line-height: 40px !important; color: var(--vdi-text) !important;
	transition: border-color .15s, box-shadow .15s;
	-webkit-appearance: none; appearance: none;
}
#vdi-popup textarea {
	height: 72px !important; padding: 10px 12px !important; line-height: 1.45 !important; resize: none;
}
#vdi-popup select {
	padding-right: 36px !important; cursor: pointer;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%230b2c5f' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E") !important;
	background-repeat: no-repeat !important; background-position: right 13px center !important;
}
#vdi-popup input::placeholder, #vdi-popup textarea::placeholder { color: #a3a8b1; opacity: 1; }
#vdi-popup input:focus, #vdi-popup select:focus, #vdi-popup textarea:focus {
	outline: none !important; border-color: var(--vdi-gold) !important; box-shadow: 0 0 0 3px rgba(212, 165, 55, .18) !important;
}
#vdi-popup .has-error { border-color: var(--vdi-error) !important; }
#vdi-popup .vdi-err { display: block; margin-top: 4px; font-size: 12px; color: var(--vdi-error); }
#vdi-popup .vdi-err:empty { display: none; }

/* Hide number spinners */
#vdi-popup input[type="number"]::-webkit-outer-spin-button,
#vdi-popup input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
#vdi-popup input[type="number"] { -moz-appearance: textfield; }

/* ---------- Amount: chips + other amount on one row ---------- */
#vdi-popup .vdi-amount-row { display: grid; grid-template-columns: 1fr 150px; gap: 8px; }
#vdi-popup .vdi-chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
#vdi-popup .vdi-chip {
	height: 42px !important; min-height: 0 !important; margin: 0 !important; padding: 0 4px !important;
	border: 1px solid var(--vdi-border) !important; border-radius: 8px !important;
	background: var(--vdi-cream) !important; color: var(--vdi-navy) !important; box-shadow: none !important;
	font: inherit; font-size: 14px !important; font-weight: 700 !important; line-height: 1 !important;
	cursor: pointer; white-space: nowrap; transition: border-color .15s, background .15s, color .15s;
}
#vdi-popup .vdi-chip:hover { border-color: var(--vdi-gold) !important; }
#vdi-popup .vdi-chip.is-active { background: var(--vdi-gold) !important; border-color: var(--vdi-gold) !important; color: #fff !important; }

#vdi-popup .vdi-amount { position: relative; }
#vdi-popup .vdi-amount span {
	position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
	font-weight: 700; color: var(--vdi-navy); pointer-events: none;
}
#vdi-popup .vdi-amount input { padding-left: 26px !important; font-weight: 600; }

/* ---------- 2-col grid ---------- */
#vdi-popup .vdi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
#vdi-popup .vdi-full { grid-column: 1 / -1; }

/* ---------- Message toggle ---------- */
#vdi-popup .vdi-msg-toggle {
	display: inline-block; width: auto !important; height: auto !important; min-height: 0 !important;
	margin: 0 0 12px !important; padding: 0 !important; border: 0 !important;
	background: none !important; box-shadow: none !important;
	color: var(--vdi-navy) !important; font: inherit; font-size: 13px !important; font-weight: 600;
	cursor: pointer; text-decoration: underline; text-underline-offset: 3px;
}
#vdi-popup .vdi-msg-toggle[hidden], #vdi-popup [hidden] { display: none !important; }

/* ---------- Footer ---------- */
#vdi-popup .vdi-consent {
	display: flex; align-items: flex-start; gap: 8px; margin: 0; cursor: pointer;
	font-size: 12.5px; color: var(--vdi-muted); line-height: 1.4;
}
#vdi-popup .vdi-consent input {
	flex: 0 0 auto; width: 16px !important; height: 16px !important; margin: 1px 0 0 !important;
	accent-color: var(--vdi-gold); cursor: pointer;
}
#vdi-popup .vdi-alert {
	margin-top: 10px; padding: 9px 12px; border-radius: 8px;
	background: #fdecea; color: var(--vdi-error); font-size: 13px;
}
#vdi-popup .vdi-submit {
	position: relative; display: flex; align-items: center; justify-content: center; gap: 8px;
	width: 100% !important; height: 48px !important; min-height: 0 !important;
	margin: 12px 0 0 !important; padding: 0 18px !important;
	border: 0 !important; border-radius: var(--vdi-r) !important;
	background: var(--vdi-navy) !important; color: #fff !important;
	box-shadow: inset 0 -3px 0 var(--vdi-gold) !important;
	font: inherit; font-size: 15.5px !important; font-weight: 700 !important; letter-spacing: .01em;
	cursor: pointer; transition: background .15s;
}
#vdi-popup .vdi-submit:hover { background: var(--vdi-navy-2) !important; }
#vdi-popup .vdi-submit:disabled { opacity: .75; cursor: wait; }
#vdi-popup .vdi-spinner {
	display: none; width: 17px; height: 17px;
	border: 2px solid rgba(255, 255, 255, .4); border-top-color: #fff; border-radius: 50%;
	animation: vdi-spin .7s linear infinite;
}
#vdi-popup .vdi-submit.is-loading .vdi-spinner { display: inline-block; }
#vdi-popup .vdi-secure { margin: 8px 0 0 !important; text-align: center; font-size: 12px; color: var(--vdi-muted); }
@keyframes vdi-spin { to { transform: rotate(360deg); } }

/* ---------- Tablet ---------- */
@media (max-width: 760px) {
	#vdi-popup .vdi-amount-row { grid-template-columns: 1fr; }
}

/* ---------- Mobile: bottom sheet ---------- */
@media (max-width: 600px) {
	#vdi-popup.vdi-overlay { padding: 0; align-items: flex-end; }
	#vdi-popup .vdi-modal {
		max-width: 100%;
		max-height: 92vh; max-height: 92dvh;
		border-radius: 18px 18px 0 0;
		transform: translateY(100%);
	}
	#vdi-popup.is-open .vdi-modal { transform: none; }
	#vdi-popup .vdi-head { padding: 16px 16px 14px 20px; }
	#vdi-popup .vdi-head h3 { font-size: 18px !important; }
	#vdi-popup .vdi-body { padding: 16px 20px 4px; }
	#vdi-popup .vdi-foot { padding: 10px 20px calc(14px + env(safe-area-inset-bottom)); }
	#vdi-popup .vdi-grid { grid-template-columns: 1fr; }
	#vdi-popup .vdi-chip { font-size: 13px !important; }
	/* 16px stops iOS from zooming into inputs */
	#vdi-popup input[type="text"], #vdi-popup input[type="tel"], #vdi-popup input[type="email"],
	#vdi-popup input[type="number"], #vdi-popup select, #vdi-popup textarea { font-size: 16px !important; }
}

@media (max-width: 360px) {
	#vdi-popup .vdi-chips { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Short desktop screens (laptops 768px tall) ---------- */
@media (min-width: 601px) and (max-height: 760px) {
	#vdi-popup.vdi-overlay { padding: 12px; }
	#vdi-popup .vdi-modal { max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); }
	#vdi-popup .vdi-head { padding-top: 14px; padding-bottom: 12px; }
	#vdi-popup .vdi-body { padding-top: 14px; }
	#vdi-popup .vdi-field { margin-bottom: 10px; }
}

/* ========== Banner inside #donate (after submit) ========== */
.vdi-banner {
	--vdi-navy: #0b2c5f; --vdi-gold: #d4a537; --vdi-muted: #6b7280;
	position: relative; display: flex; gap: 14px; align-items: flex-start;
	width: 100%; max-width: 1380px; margin: 0 auto 28px; padding: 18px 48px 18px 18px;
	background: #faf6ec; border: 1px solid #ecdfbf; border-left: 5px solid var(--vdi-gold); border-radius: 12px;
	box-sizing: border-box; color: #26303d; font-size: 15px; line-height: 1.55;
	animation: vdi-in .4s ease both;
}
.vdi-banner-icon {
	flex: 0 0 36px; width: 36px; height: 36px; border-radius: 50%;
	display: grid; place-items: center; background: var(--vdi-gold); color: #fff; font-weight: 700;
}
.vdi-banner strong { color: var(--vdi-navy); }
.vdi-ref { margin-top: 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.vdi-ref code { padding: 3px 10px; background: #fff; border: 1px dashed var(--vdi-gold); border-radius: 6px; font-size: 15px; font-weight: 700; color: var(--vdi-navy); }
.vdi-copy { padding: 3px 10px !important; border: 1px solid var(--vdi-navy) !important; background: transparent !important; color: var(--vdi-navy) !important; border-radius: 6px !important; font-size: 13px !important; cursor: pointer; }
.vdi-ref-note { width: 100%; font-size: 13px; color: var(--vdi-muted); }
.vdi-upi { display: inline-block; margin-top: 12px; padding: 10px 18px; background: var(--vdi-navy); color: #fff !important; border-radius: 8px; font-weight: 600; text-decoration: none; }
.vdi-banner-close { position: absolute; top: 8px; right: 10px; border: 0 !important; background: none !important; font-size: 24px; color: var(--vdi-muted) !important; cursor: pointer; padding: 0 !important; }
.vdi-banner--floating { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 99998; margin: 0 auto; box-shadow: 0 12px 30px rgba(0, 0, 0, .18); }
.vdi-highlight { animation: vdi-glow 1.8s ease .5s 1; }
@keyframes vdi-glow { 0%, 100% { box-shadow: none; } 40% { box-shadow: inset 0 0 0 4px rgba(212, 165, 55, .55); } }
@keyframes vdi-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@media (max-width: 600px) { .vdi-banner { padding: 16px 40px 16px 14px; font-size: 14px; } }

@media (prefers-reduced-motion: reduce) {
	#vdi-popup.vdi-overlay, #vdi-popup .vdi-modal, .vdi-banner, .vdi-highlight { transition: none; animation: none; }
}
