/* Modal icon styles */

.dialog-open {
	overflow: hidden;
}

#modal-root {
	position: relative;
	z-index: 1000;
}

.modal-backdrop {
	position: fixed;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	background: rgba(12, 31, 68, 0.45);
	z-index: 1000;
}

.modal-dialog {
	width: min(100%, 820px);
	max-height: calc(100vh - 48px);
	background: #fff;
	border-radius: 28px;
	box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
	overflow: hidden;
}

.modal-dialog__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	padding: 28px 30px;
	border-bottom: 1px solid var(--gray-200);
}

.modal-dialog__header h2 {
	margin: 0;
}

.modal-dialog__body {
	padding: 36px 30px;
}

.modal-dialog__body--with-icon {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	gap: 18px;
	align-items: start;
}

.modal-dialog__icon {
	width: 56px;
	height: 56px;
	display: inline-grid;
	place-items: center;
	border-radius: 999px;
	font-size: 1.5rem;
	font-weight: 900;
}

.modal-dialog__icon--success {
	background: #eaf7ed;
	color: #1f7a35;
}

.modal-dialog__icon--error,
.modal-dialog__icon--permission {
	background: #fff0ee;
	color: #b42318;
}

.modal-dialog__icon--warning,
.modal-dialog__icon--timeout {
	background: #fff7df;
	color: #8a5b00;
}

.modal-dialog__icon--info {
	background: var(--blue-100);
	color: var(--blue-700);
}

.modal-dialog__message p {
	margin-top: 0;
}

.modal-dialog__message p:last-child {
	margin-bottom: 0;
}

.modal-dialog__footer {
	display: flex;
	justify-content: flex-end;
	gap: 14px;
	padding: 28px 30px;
	border-top: 1px solid var(--gray-200);
	background: var(--gray-50);
}

@media (max-width: 560px) {
	.modal-backdrop {
		padding: 16px;
	}

	.modal-dialog {
		border-radius: 20px;
	}

	.modal-dialog__header,
	.modal-dialog__body,
	.modal-dialog__footer {
		padding-left: 20px;
		padding-right: 20px;
	}

	.modal-dialog__body--with-icon {
		grid-template-columns: 1fr;
	}

	.modal-dialog__footer {
		flex-direction: column;
	}

	.modal-dialog__footer .button {
		width: 100%;
	}
}
