.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: grid;
  place-items: center;
  padding: var(--space-4);
  background: rgb(15 10 30 / .55);
  backdrop-filter: blur(.4rem);
  animation: fade-in .2s var(--ease) both;
  overflow-y: auto;
}

.modal {
  width: min(100%, 52rem);
  max-height: calc(100vh - 3.2rem);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  color: var(--text);
  border: .1rem solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  animation: modal-in .28s var(--ease) both;
}

.modal--sm { width: min(100%, 42rem); }
.modal--lg { width: min(100%, 76rem); }
.modal--xl { width: min(100%, 104rem); }

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-5) var(--space-5) var(--space-3);
}

.modal__title {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--fs-xl);
}

.modal__body {
  padding: var(--space-3) var(--space-5);
  overflow-y: auto;
}

.modal__footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5) var(--space-5);
}

.modal__icon {
  display: grid;
  place-items: center;
  width: 4.4rem;
  height: 4.4rem;
  flex: none;
  border-radius: 50%;
  background: var(--accent-soft-strong);
  color: var(--accent-text);
}

.modal__icon--danger {
  background: var(--danger-soft);
  color: var(--danger);
}

body.has-modal {
  overflow: hidden;
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(2rem) scale(.97); }
  to { opacity: 1; transform: none; }
}
