/**
 * Mantiz Modal Builder - Frontend Base
 */

.mantiz-trigger {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	border: 0;
	cursor: pointer;
	text-decoration: none;
	line-height: 1.4;
	font-family: Montserrat, Inter, system-ui, sans-serif;
	box-sizing: border-box;
	width: auto;
	min-width: max-content;
}

.mantiz-trigger__text {
	white-space: nowrap;
	flex-shrink: 0;
}

.mantiz-modal {
	position: fixed;
	inset: 0;
	z-index: var(--mantiz-z-index, 2147483646);
	isolation: isolate;
	pointer-events: none;
}

.mantiz-modal.is-open {
	pointer-events: auto;
}

.mantiz-modal[hidden] { display: none !important; }

.mantiz-modal__overlay {
	position: fixed;
	inset: 0;
	background: var(--mantiz-overlay-color, rgba(0, 0, 0, 0.5));
	opacity: 0;
	transition: none;
	z-index: 1;
}

.mantiz-modal.is-open .mantiz-modal__overlay { opacity: 1; }

.mantiz-modal__dialog {
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	z-index: 2;
	width: min(420px, 92vw);
	max-height: 90vh;
	overflow-x: hidden;
	overflow-y: auto;
	opacity: 0;
	transition: none;
	pointer-events: auto;
	background-color: #ffffff;
	border-radius: 16px;
}

.mantiz-modal__close {
	appearance: none;
	-webkit-appearance: none;
	-moz-appearance: none;
	position: absolute;
	top: 20px;
	right: 20px;
	z-index: 5;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	min-width: 0;
	min-height: 0;
	padding: 0;
	margin: 0;
	border: 0;
	border-radius: 0;
	background: none !important;
	background-color: transparent !important;
	box-shadow: none !important;
	outline: none;
	color: #64748b;
	cursor: pointer;
	line-height: 1;
}

.mantiz-modal__close:hover,
.mantiz-modal__close:focus,
.mantiz-modal__close:active,
.mantiz-modal__close:focus-visible {
	background: none !important;
	background-color: transparent !important;
	box-shadow: none !important;
	color: #12264C;
	outline: none;
}

.mantiz-modal__close svg {
	display: block;
	width: 18px;
	height: 18px;
	stroke: currentColor;
	fill: none;
}

.mantiz-modal__body {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: 20px;
}

.mantiz-modal__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: visible;
	min-height: 72px;
	padding: 8px 0;
}

.mantiz-modal__icon-motion {
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.mantiz-modal__icon-motion > svg,
.mantiz-modal__icon-svg {
	display: block;
	overflow: visible;
}

.mantiz-modal__icon-bubble {
	transform-box: fill-box;
	transform-origin: center;
	animation-play-state: paused;
}

.mantiz-modal.is-open .mantiz-modal__icon-bubble {
	animation-play-state: running;
}

.mantiz-modal__icon-bubble--blue {
	transform-origin: 32px 31px;
	animation: mantiz-bubble-blue 2.6s cubic-bezier(0.45, 0, 0.55, 1) infinite alternate;
}

.mantiz-modal__icon-bubble--orange {
	transform-origin: 44px 41px;
	animation: mantiz-bubble-orange 2.6s cubic-bezier(0.45, 0, 0.55, 1) infinite alternate;
	animation-delay: -1.3s;
}

@keyframes mantiz-bubble-blue {
	from {
		transform: scale(1) translateY(0);
	}

	to {
		transform: scale(1.1) translateY(-5px);
	}
}

@keyframes mantiz-bubble-orange {
	from {
		transform: scale(1) translateY(0);
	}

	to {
		transform: scale(1.12) translateY(-6px);
	}
}

.mantiz-modal__title {
	margin: 0;
	font-family: Montserrat, Inter, system-ui, sans-serif;
}

.mantiz-modal__subtitle,
.mantiz-modal__description {
	margin: 0;
}

.mantiz-modal__actions {
	display: flex;
	flex-direction: column;
	gap: 12px;
	width: min(100%, 280px);
}

.mantiz-modal__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 0;
	cursor: pointer;
	font-family: Montserrat, Inter, system-ui, sans-serif;
}

@media (max-width: 640px) {
	.mantiz-modal__dialog {
		top: 0;
		left: 0;
		width: 100%;
		max-width: 100%;
		min-height: 100vh;
		max-height: none;
		border-radius: 0 !important;
	}
}

body.mantiz-modal-open {
	overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
	.mantiz-modal__overlay,
	.mantiz-modal__dialog,
	.mantiz-trigger {
		transition: none !important;
	}

	.mantiz-modal__icon-bubble--blue,
	.mantiz-modal__icon-bubble--orange {
		animation-duration: 4.8s;
	}

	@keyframes mantiz-bubble-blue {
		from {
			transform: scale(1) translateY(0);
		}

		to {
			transform: scale(1.05) translateY(-2px);
		}
	}

	@keyframes mantiz-bubble-orange {
		from {
			transform: scale(1) translateY(0);
		}

		to {
			transform: scale(1.06) translateY(-3px);
		}
	}
}
