.demo-modal {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;

	button, input, select, textarea {
		font-size: revert;
	}
}

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

.demo-modal__overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
	cursor: pointer;
}

.demo-modal__dialog {
	position: relative;
	background-color: var(--wp--preset--color--white);
	border-radius: 2rem;
	padding: 4rem;
	width: min(480px, 92vw);
	max-height: 90vh;
	overflow-y: auto;
	z-index: 1;

	@media (prefers-color-scheme: dark) {
		background-color: var(--wp--preset--color--sc-surface-card);
		box-shadow: 0 0 18px 0 rgba(0,135,160,.22);
	}
}

.demo-modal__close {
	position: absolute;
	top: 0.75rem;
	right: 1rem;
	background: none;
	border: none;
	font-size: 1.8rem;
	line-height: 1;
	cursor: pointer;
	padding: 0;
	color: inherit;
	background-color: var(--wp--preset--color--sc-button-green);
	border-radius: 1.7rem;
	width: 3.4rem;
	height: 3.4rem;
}

.demo-modal__title {
	color: var(--wp--preset--color--sc-primary-text);
	font-weight: 600;
	font-family: 'Poppins-Bold', 'Poppins', Arial, sans-serif;
	line-height: 1.2;
	margin-block-end: 0.6rem;


	@media (prefers-color-scheme: dark) {
		color: var(--wp--preset--color--white);
	}
}

.demo-modal__success {
	padding: 1rem 0;
	font-size: 1.8rem;
	font-weight: 600;

	@media (prefers-color-scheme: dark) {
		color: var(--wp--preset--color--sc-secondary-text-dark-mode);
	}
}

.demo-modal__success[hidden] {
	display: none;
}

.demo-modal__errors {
	margin-bottom: 1rem;
	color: #c0392b;
	font-size: 1.4rem;
}

.demo-modal__errors[hidden] {
	display: none;
}

.demo-modal__errors p {
	margin: 0 0 0.25rem;
	line-height: 150%;
}

.demo-modal__description {
	color: var(--wp--preset--color--sc-secondary-text);
	line-height: 150%;

	@media (prefers-color-scheme: dark) {
		color: var(--wp--preset--color--sc-secondary-text-dark-mode);
	}
}

.demo-modal__description[hidden] {
	display: none;
}

.demo-modal__form {
	margin-block-start: 2.2rem;
}

.demo-modal__field-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0 1rem;
}

.demo-modal__field {
	display: flex;
	flex-direction: column;
	margin-bottom: 1.5rem;
}

.demo-modal__field label {
	font-weight: 600;
	font-size: 1.3rem;
	margin-block-end: 0.7rem;

	@media (prefers-color-scheme: dark) {
		color: var(--wp--preset--color--sc-secondary-text-dark-mode);
	}
}

.demo-modal__field input,
.demo-modal__field select {
	width: 100%;
	padding-inline: 1.3rem;
	padding-block: 1.2rem;
	border: 1px solid #ccc;
	border-radius: 1rem;

	&:focus {
		background-color: var(--wp--preset--color--sc-background-secondary);
	}
}

.demo-modal__field-input--error {
	border-color: #c0392b !important;
}

.demo-modal__field-error {
	margin-top: 0.4rem;
	font-size: 1.3rem;
	color: #c0392b;
}

.demo-modal__submit {
	display: block;
	width: 100%;
	margin-block-start: 4.3rem;
	cursor: pointer;
	background-color: var(--wp--preset--color--sc-button-green);
	color: var(--wp--preset--color--sc-primary-text);
	font-weight: 600;
	font-family: 'Poppins-Bold', 'Poppins', Arial, sans-serif;
}


.wp-block-button.demo-modal-elem {
	.wp-block-button__link {
		background-color: var(--wp--preset--color--sc-button-green);
		color: var(--wp--preset--color--sc-primary-text);
		font-weight: 500;
		font-family: 'Poppins-SemiBold', 'Poppins', Arial, sans-serif;
		font-size: 1.4rem;
		text-decoration: none;

		@media (width >= 64rem) {
			font-size: 1.6rem;
		}
	}
}