:root {
	--iti-path-flags-1x: url("https://unpkg.com/intl-tel-input@24.6.0/build/img/flags.webp");
	--iti-path-flags-2x: url("https://unpkg.com/intl-tel-input@24.6.0/build/img/flags@2x.webp");
	--iti-path-globe-1x: url("https://unpkg.com/intl-tel-input@24.6.0/build/img/globe.webp");
	--iti-path-globe-2x: url("https://unpkg.com/intl-tel-input@24.6.0/build/img/globe@2x.webp");
}

/* === Overlay === */
.sd-overlay {
	position: fixed;
	inset: 0;
	z-index: 99999;
	background: rgba(0, 0, 0, 0.55);
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.35s ease, visibility 0.35s ease;
	padding: 20px;
	backdrop-filter: blur(2px);
	-webkit-backdrop-filter: blur(2px);
}

.sd-overlay.active {
	opacity: 1;
	visibility: visible;
}

/* === Popup === */
.sd-popup {
	background: var(--global-palette9, #ffffff);
	border-radius: 16px;
	max-width: 760px;
	width: 100%;
	display: flex;
	overflow: hidden;
	box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
	max-height: 92vh;
	position: relative;
	transform: scale(0.92) translateY(20px);
	opacity: 0;
	transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
		opacity 0.4s ease;
}

.sd-overlay.active .sd-popup {
	transform: scale(1) translateY(0);
	opacity: 1;
}

/* Accent bar at the top */
.sd-popup::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 4px;
	background: #24CDD5;
	z-index: 2;
}

/* === Image Side === */
.sd-popup-image {
	width: 42%;
	flex-shrink: 0;
	overflow: hidden;
	position: relative;
}

.sd-popup-image::after {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(135deg, rgba(0, 0, 0, 0.15) 0%, transparent 50%);
	pointer-events: none;
}

.sd-popup-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* === Content Side === */
.sd-popup-content {
	flex: 1;
	padding: 44px 38px 38px;
	overflow-y: auto;
}

/* === Close === */
.sd-close {
	position: absolute;
	top: 14px;
	right: 14px;
	width: 32px;
	height: 32px;
	background: rgba(0, 0, 0, 0.06);
	border: none;
	border-radius: 50%;
	font-size: 20px;
	line-height: 1;
	color: var(--global-palette5, #4A5568);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s, color 0.2s, transform 0.2s;
	z-index: 3;
	padding: 0;
}

.sd-close:hover {
	background: #24CDD5;
	color: #fff;
	transform: rotate(90deg);
}

.sd-close:focus-visible {
	outline: 2px solid #24CDD5;
	outline-offset: 2px;
}

/* === Typography === */
.sd-popup h2 {
	margin: 0 0 4px;
	font-size: 1.45rem;
	font-weight: 700;
	color: var(--global-palette3, #1A202C);
	font-family: var(--global-heading-font-family, inherit);
	line-height: 1.3;
}

.sd-popup .sd-subtitle {
	margin: 0 0 26px;
	color: var(--global-palette5, #4A5568);
	font-size: 0.92rem;
	line-height: 1.5;
}

/* === Fields === */
.sd-field {
	margin-bottom: 14px;
}

/* --- intl-tel-input --- */
.sd-field .iti {
	width: 100%;
}

.sd-field .iti__tel-input {
	border-radius: 8px;
}

.sd-field .iti__country-container {
	z-index: 2;
}

.sd-field .iti--allow-dropdown .iti__selected-country:hover {
	background-color: rgba(0, 0, 0, 0.04);
}

.sd-field .iti__search-input {
	font-size: 0.85rem;
}

body .iti--container {
	z-index: 1000000 !important;
}

.sd-field label {
	display: block;
	margin-bottom: 5px;
	font-weight: 600;
	font-size: 0.78rem;
	color: var(--global-palette4, #2D3748);
	text-transform: uppercase;
	letter-spacing: 0.6px;
}

.sd-field .sd-required {
	color: #e53e3e;
}

.sd-field input,
.sd-field textarea {
	width: 100%;
	padding: 11px 14px;
	border: 1.5px solid var(--global-gray-400, #CBD5E0);
	border-radius: 8px;
	font-size: 0.95rem;
	font-family: var(--global-body-font-family, inherit);
	background: var(--global-palette9, #ffffff);
	color: var(--global-palette3, #1A202C);
	transition: border-color 0.25s, box-shadow 0.25s;
	box-sizing: border-box;
	-webkit-appearance: none;
}

.sd-field input::placeholder,
.sd-field textarea::placeholder {
	color: var(--global-gray-500, #A0AEC0);
}

.sd-field input:focus,
.sd-field textarea:focus {
	border-color: #24CDD5;
	outline: none;
	box-shadow: 0 0 0 3px rgba(36, 205, 213, 0.12);
}

.sd-field textarea {
	resize: vertical;
	min-height: 72px;
}

/* === Submit Button === */
.sd-submit {
	background: #24CDD5;
	color: #fff;
	border: none;
	padding: 13px 28px;
	border-radius: 8px;
	font-size: 0.95rem;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.25s, transform 0.15s, box-shadow 0.25s;
	width: 100%;
	font-family: var(--global-body-font-family, inherit);
	position: relative;
	overflow: hidden;
}

.sd-submit:hover {
	background: #1FB8BF;
	box-shadow: 0 4px 14px rgba(36, 205, 213, 0.35);
}

.sd-submit:active {
	transform: scale(0.97);
}

.sd-submit:disabled {
	opacity: 0.7;
	cursor: not-allowed;
	box-shadow: none;
	transform: none;
}

/* Loading spinner on submit button */
.sd-submit.loading {
	color: transparent;
}

.sd-submit.loading::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 20px;
	height: 20px;
	margin: -10px 0 0 -10px;
	border: 2.5px solid rgba(255, 255, 255, 0.3);
	border-top-color: #fff;
	border-radius: 50%;
	animation: sd-spin 0.6s linear infinite;
}

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

/* === Validation === */
.sd-error {
	color: #e53e3e;
	font-size: 0.78rem;
	margin-top: 4px;
	display: none;
	line-height: 1.3;
}

.sd-field.error input,
.sd-field.error textarea {
	border-color: #e53e3e;
}

.sd-field.error input:focus,
.sd-field.error textarea:focus {
	box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.12);
}

/* === Success === */
.sd-success {
	text-align: center;
	padding: 50px 20px 40px;
	animation: sd-fadeUp 0.5s ease;
}

@keyframes sd-fadeUp {
	from {
		opacity: 0;
		transform: translateY(16px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.sd-success .sd-check {
	width: 64px;
	height: 64px;
	border-radius: 50%;
	background: #24CDD5;
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 28px;
	margin: 0 auto 18px;
	animation: sd-checkBounce 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes sd-checkBounce {
	0% {
		transform: scale(0);
	}

	50% {
		transform: scale(1.15);
	}

	100% {
		transform: scale(1);
	}
}

.sd-success h3 {
	margin: 0 0 8px;
	font-size: 1.35rem;
	font-weight: 700;
	color: var(--global-palette3, #1A202C);
	font-family: var(--global-heading-font-family, inherit);
}

.sd-success p {
	margin: 0;
	color: var(--global-palette5, #4A5568);
	font-size: 0.95rem;
	line-height: 1.6;
	max-width: 380px;
	margin-left: auto;
	margin-right: auto;
}

/* === Responsive === */
@media (max-width: 640px) {
	.sd-overlay {
		padding: 0;
		align-items: flex-end;
	}

	.sd-popup {
		flex-direction: column;
		max-width: 100%;
		border-radius: 16px 16px 0 0;
		margin: 0;
		max-height: 94vh;
		transform: scale(1) translateY(40px);
	}

	.sd-overlay.active .sd-popup {
		transform: scale(1) translateY(0);
	}

	.sd-popup::before {
		border-radius: 16px 16px 0 0;
	}

	.sd-popup-image {
		width: 100%;
		height: 160px;
	}

	.sd-popup-content {
		padding: 28px 22px 24px;
	}

	.sd-close {
		top: 10px;
		right: 10px;
		width: 28px;
		height: 28px;
		font-size: 17px;
		background: rgba(255, 255, 255, 0.9);
	}

	.sd-popup h2 {
		font-size: 1.25rem;
	}

	.sd-success {
		padding: 36px 16px 28px;
	}
}