.pmsm-modal[hidden] {
	display: none;
}

.pmsm-modal {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: clamp(18px, 4vw, 40px);
}

.pmsm-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(10, 15, 25, 0.62);
}

.pmsm-modal__dialog {
	position: relative;
	width: min(100%, 680px);
	max-height: calc(100vh - 56px);
	overflow: auto;
	padding: clamp(28px, 4vw, 42px);
	border-radius: 8px;
	background: #fff;
	color: #1f2937;
	box-shadow: 0 24px 72px rgba(10, 15, 25, 0.32);
	text-align: left;
}

.pmsm-modal__dialog--center {
	text-align: center;
}

.pmsm-modal__dialog--right {
	text-align: right;
}

.pmsm-modal__close {
	position: absolute;
	top: 14px;
	right: 14px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: #6b7280;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
}

.pmsm-modal__close:hover,
.pmsm-modal__close:focus {
	background: #f3f4f6;
	color: #374151;
	outline: none;
}

.pmsm-modal__close:focus-visible,
.pmsm-modal__button:focus-visible {
	outline: 2px solid var(--pmsm-primary, #1f6feb);
	outline-offset: 3px;
}

.pmsm-modal__banner {
	aspect-ratio: 3 / 1;
	width: 100%;
	margin: 0 0 22px;
	overflow: hidden;
	border-radius: 7px;
	background: #f3f4f6;
}

.pmsm-modal__banner-image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.pmsm-modal__title {
	margin: 0 40px 14px 0;
	color: #111827;
	font-size: clamp(1.3rem, 2.2vw, 1.65rem);
	font-weight: 650;
	line-height: 1.28;
	letter-spacing: 0;
}

.pmsm-modal__dialog--center .pmsm-modal__title,
.pmsm-modal__dialog--right .pmsm-modal__title {
	margin-left: 40px;
}

.pmsm-modal__body {
	margin: 0;
	font-size: 1rem;
	line-height: 1.6;
	color: #374151;
}

.pmsm-modal__body > *:first-child {
	margin-top: 0;
}

.pmsm-modal__body > *:last-child {
	margin-bottom: 0;
}

.pmsm-modal__body a {
	color: var(--pmsm-primary, #1f6feb);
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}

.pmsm-modal__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-start;
	gap: 12px;
	margin-top: 28px;
}

.pmsm-modal__dialog--center .pmsm-modal__actions {
	justify-content: center;
}

.pmsm-modal__dialog--right .pmsm-modal__actions {
	justify-content: flex-end;
}

.pmsm-modal__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 10px 18px;
	border-radius: 6px;
	border: 1px solid transparent;
	font: inherit;
	font-weight: 650;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease, filter 140ms ease;
}

.pmsm-modal__button--primary {
	background: var(--pmsm-primary, #1f6feb);
	color: #fff;
}

.pmsm-modal__button--primary:hover,
.pmsm-modal__button--primary:focus {
	color: #fff;
	filter: brightness(0.94);
	text-decoration: none;
}

.pmsm-modal .pmsm-modal__button--secondary {
	background: #fff;
	border-color: #d1d5db;
	color: #4b5563;
	font-weight: 500;
	letter-spacing: 0 !important;
	text-transform: none !important;
}

.pmsm-modal .pmsm-modal__button--secondary:hover,
.pmsm-modal .pmsm-modal__button--secondary:focus {
	background: #f9fafb;
	border-color: #9ca3af;
	color: #374151;
	text-decoration: none;
}

@media (max-width: 600px) {
	.pmsm-modal {
		align-items: center;
		padding: 16px;
	}

	.pmsm-modal__dialog {
		width: 100%;
		max-height: calc(100vh - 32px);
		padding: 28px 20px 22px;
	}

	.pmsm-modal__banner {
		aspect-ratio: 16 / 5;
		margin-bottom: 18px;
	}

	.pmsm-modal__title {
		margin-right: 34px;
		font-size: 1.25rem;
	}

	.pmsm-modal__dialog--center .pmsm-modal__title,
	.pmsm-modal__dialog--right .pmsm-modal__title {
		margin-left: 34px;
	}

	.pmsm-modal__actions {
		flex-direction: column;
		align-items: stretch;
		gap: 10px;
		margin-top: 24px;
	}

	.pmsm-modal__button {
		width: 100%;
	}
}

@media (prefers-reduced-motion: no-preference) {
	.pmsm-modal__dialog {
		animation: pmsm-modal-in 160ms ease-out;
	}

	@keyframes pmsm-modal-in {
		from {
			opacity: 0;
			transform: translateY(8px) scale(0.98);
		}
		to {
			opacity: 1;
			transform: translateY(0) scale(1);
		}
	}
}
