/* 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%, 560px); max-height: calc(100dvh - 48px); display: flex; flex-direction: column; background: #fff; border-radius: 16px; box-shadow: 0 20px 50px rgba(0, 0, 0, .25); overflow: hidden; }
.modal-dialog__header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.modal-dialog__header h2 { margin: 0; font-size: 1.25rem; }
.modal-dialog__body { padding: 24px; overflow-y: auto; min-height: 0; }
.modal-dialog__footer { display: flex; justify-content: flex-end; gap: 12px; padding: 16px 24px; border-top: 1px solid var(--line); background: var(--surface-soft, #f3f8fe); }
.modal-dialog__header,
.modal-dialog__footer { flex-shrink: 0; }

.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, #e8f1ff); color: var(--blue-700, #0044ab); }

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

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

@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%;
	}
}

.modal-dialog__footer .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 44px;
    padding: 10px 22px;
    border: 1px solid var(--blue, #0046c7);
    border-radius: 7px;
    background: var(--blue, #0046c7);
    color: #fff;
    font: inherit;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
}
.modal-dialog__footer .button--outline {
    background: #fff;
    color: var(--blue, #0046c7);
    box-shadow: none;
}
.modal-dialog__footer .button:hover { filter: brightness(.95); }
.modal-dialog__header .icon-button {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--ink, #071a44);
    font: inherit;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
}
.modal-dialog__header .icon-button:hover { background: var(--soft, #f3f8fe); }
.modal-dialog button:focus-visible { outline: 3px solid rgba(0, 70, 199, .35); outline-offset: 3px; }

